Cloning and Resizing HDD and Partitions

holub457holub457 New or Quiet Member

I am running a SLES 12 sp5 server that has a 500gb drive with partitions that are not configured optimally.
I tried using Clonezilla. Worthless and clone will not boot (I am sure it is something with btrfs designations in Grub (but spending time to fix it is not a good alternative).
Problem is I have a small btrfs partition and a large ext5 partition. I need to shrink the ext5 and then expand the btrfs partitions where my apps run. I know I could toss a new drive in and span the btrfs to it, but this would make backing up too complex. Right now I periodically use DD to copy everything to old harddrive that I could toss in in an emergency. So I like this backup approach.
I cannot believe there are no top notch commerical cloning and partition resizing options. parted does not work.
I thought maybe I could shrink ext5 using rescue off of DVD. Will this work? If so, is there a way to expand the size of btrfs partition into space made by shrinking? -- I experimented DD everything to a larger drive and on boot it just created a bunch of tmpfs partitions.

Comments

  • malcolmlewismalcolmlewis Knowledge Partner

    Hi
    Have a read here: https://www.suse.com/support/kb/doc/?id=000018798

    Sure it's not snapshots taking up disk allocation? Maybe just need some maintenance to recover space?

  • holub457holub457 New or Quiet Member

    Thanks. Not snapshot problem (cleared some snapshot so system functions for now).
    I had already read your link (don't really understand it well as there is too much contradictory info in it on what will not work).
    I am dealing with physical partitions.
    /dev/sda1 2G swap
    /dev/sda2 40G btrfs
    /dev/sda3 423G ext
    I want to shrink sda3 down to 100G, and allocate the rest to sda2. Your link discusses expanding with a virtual drive where you just make a bigger container, but on my physical drive container size is capped.
    I think I could accomplish what I want to do if I could figure out how to safely shrink sda3 (it only contains about 20G of data). I tried saving data on sda3 and just deleting it. But can't boot after deleting it (probably has some hidden boot info).
    So, if you could point me to something on safely shrinking the partition on sda3 I would greatly appreciate it.

  • malcolmlewismalcolmlewis Knowledge Partner

    Hi
    I run 40GB for / and btrfs without problems? Have you configured snapshots vi editing /etc/snapper/root/config have you run the btrfs maintenance tools to clean up?
    Have a read here: https://btrfs.wiki.kernel.org/index.php/FAQ

    AFAIK resizing a btrfs partition is not an option, consider where your issues lie and then move the subvolume to a partition created after you shrink sda3 to what you want.

    What areas are using space on /? If it's data, then move it off btrfs and onto an xfs (or ext4) partition.

  • holub457holub457 New or Quiet Member

    Thanks. I am going to backup everything, then experiment. If I break something, I'll just move some data off btrfs and onto an xfs (or ext4) partition. ... The btrfs file system approach appears to be pretty flexible, but just not in the way I was imagining on resizing. I guess there are always trade-offs. Good to know.

  • malcolmlewismalcolmlewis Knowledge Partner

    Hi
    I only tend to keep a few snapshots, if your wanting more then yes, additional btrfs space is needed, but you can also exclude volumes as well. When btrfs first came about, lots of issues with snapshot/snapper (not btrfs), it just gave btrfs a bad name ;) Experimenting is good to figure out the sweet spot for your needs.

Sign In or Register to comment.