Thought I’d document how to migrate a Linux OS to a larger disk using 100% FOSS tools. 256GB is a bit pokey these days especially when dual booting, virtual or otherwise. Let’s get to it:
The first step is optional & can be disregarded if you are familiar with partitioning but is handy if your a newb like me. In this example we will clone sda to sdb, both disks can be identified by there volumes.
- We will start Clonezilla in disk to disk mode & proceed to clone the smaller volume to the larger. The advantage of this is an exact copy of your smaller disk will be created to use as a template.
- Using GParted, whilst keeping boot & swap untouched, we will delete the home partition. Now grow the root partition, for arguments sake, to double the size. Apply, You may see an error state if root partition is BTRFS, this can be safely ignored. Recreate home partition with remaining space. Apply & execute all changes.
- Now we will reboot into Clonzilla, this time being careful to start in partition to partition mode. Now we will need to select our root source partition (smaller volume) and our root target partition (larger disk.) Clone being sure to recreate the partition table proportionately. We will want to repeat this for our home partition.
- Now to increase the size of your VM;
sudo qemu-img resize generic.qcow2 +20G
This worked perfectly with BTRFS / & XFS /home, any less exotic file systems should be a sinch. Happy computing!