Move BTRFS install to larger disk

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
silmaril
Level 1
Level 1
Posts: 20
Joined: Mon Apr 20, 2020 3:46 pm

Move BTRFS install to larger disk

Post by silmaril »

I have Linux Mint 20.3 in a BTRFS install on a 256 GB SSD.
There are these partitions:
* 1024 MB Ext3 --> /boot
* 34000 MB Swap
* 100 MB EFI
* 220936 MB BTRFS --> /

Now I would like to move this installation to a 500 GB SSD, keeping everything as it is and increasing the size of the large BTRFS partition to fill the whole disk.

What is the best method to do this?

I was thinking:
* Boot GParted Live
* Use GParted to partition the large SSD exactly like the smaller one
* Copy all partition contents using GParted's copy-function.
* Shutdown PC
* Remove smaller SSD (keep as backup until finished)
* Start PC and make sure the system boots up correctly
* Reboot into GParted Live once again
* Use GParted to increase partition size to use all available space
* Reboot => done.

Will this work as expected?
Will the partition UIDs stay the same so my /etc/fstab is still working?
Will resizing the partition work or are there any caveats I should know about beforehand?
Any recommendation to do this migration as painlessly as possible?

Thanks for your advice!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mr-victory
Level 1
Level 1
Posts: 2
Joined: Sat Dec 04, 2021 12:33 pm

Re: Move BTRFS install to larger disk

Post by mr-victory »

I would follow a path like this:
Boot Mint Live, as it already contains GParted (or GParted live if you have that ready)
Copy-paste all partitions. Copy-paste does not copy contents but the partition itself, similar to dd.
Reinstall the bootloader (grub-install)
Remove smaller SSD. Partitions contain the same UUIDs as they are copy-pasted. Linux would get confused with same UUIDs.
Boot to check everything is alright.
If everything works, reboot to Mint Live, fire up GParted and regeerate UUIDs for all of the old SSD's partitions and grow the new root partition copied to new SSD.
Put back in the old SSD.
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Move BTRFS install to larger disk

Post by AndyMH »

Use a tool designed for the job - foxclone, rescuezilla or clonezilla. clonezilla is the most capable but user unfriendly. I'm the dev for foxclone, there is a comprehensive user guide - read the section on cloning. Note, I've not tested it with btrfs.
Screenshot from 2022-01-17 16-51-01.png
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
silmaril
Level 1
Level 1
Posts: 20
Joined: Mon Apr 20, 2020 3:46 pm

[Solved] Move BTRFS install to larger disk

Post by silmaril »

I tried your suggestion of using Foxclone.
Cloning the whole disk in one go took about 40 minutes without any problems.
Seems like a very nice tool for this :)

Unfortunately I wasn't able to repair grub from this system, because it was lacking grub-install.
So I rebooted into GParted Live and used grub-install there successfully.
(Probably this would have been possible to solve in Foxclone as well for someone with better knowledge of grub command line voodoo.)

After booting up my system from the large SSD, I simply started GParted and resized the system partition while it was mounted.
Didn't expect this to work, but it was no problem at all :D

Thanks to everyone who answered! I am very happy that this worked without any major issues!
User avatar
AndyMH
Level 21
Level 21
Posts: 13748
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: [Solved] Move BTRFS install to larger disk

Post by AndyMH »

silmaril wrote: Tue Jan 18, 2022 4:08 pm Unfortunately I wasn't able to repair grub from this system, because it was lacking grub-install.
You should not need to do that, the cloned drive is an identical copy of the source, including the bootloaders. What you cannot do is boot the clone drive in the system with the old drive still present. It will confuse BIOS.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
silmaril
Level 1
Level 1
Posts: 20
Joined: Mon Apr 20, 2020 3:46 pm

Re: Move BTRFS install to larger disk

Post by silmaril »

I think my case was a bit more complicated for "historic reasons" ;-)

The larger disk contained my original Linux installation and I did a fresh setup on the smaller disk, keeping the original in a working state until I was done.
At this point, grub was able to boot both installations, but I think the bootloader was on the larger disk - and I neglected to check that and write it to the disk I was keeping.
When I cloned the smaller disk onto the larger one, the bootloader was overwritten, so I ended up with no bootloader at all and got the punishment for my slopiness :?
Locked

Return to “Installation & Boot”