
In TW I have my BTRFS root partition on an SSD and would like to move it to an NVME. The NVME has a few partitions, including one of the same size as the current root. According to the docs[1], it seems like I can run # btrfs replace start /dev/[ssd_part] /dev/[nvme_part] / on my running system and once that is complete then my root will be on the NVME, but there is also not tons of details given about what actually happens. Has anyone done this? Is it really as simple as that? Also, what, if any implications for reboot/mounting? Does it replace the UUID on the new root so that fstab is unchanged? Do I need to do something with grub to boot from the new root? thanks, -- Jason Craig [1] https://btrfs.readthedocs.io/en/latest/btrfs-replace.html

On 09.10.2023 05:42, Jason Craig wrote:
Yes, filesystem is not changed.
something with grub to boot from the new root?
If it was your boot device - you need to reinstall bootloader. update-bootloader --reinit should be enough. Although if you are using EFI in default configuration (with shim) you probably do not need even that - grub image in ESP looks for /boot using UUID which does not change. I am not sure if you will be able to reboot while replace is running though. It should be OK from the btrfs point of view, but I do not know if grub can handle incomplete replacement.

Jason Craig wrote:
A bit late, still: When I did this on our server several years ago (was even moving a mirrored mdraid setup(*)) everything went fine, except I forgot to re-make the initrd. So when booting, it didn't have the NVME module, and couldn't read the disks :-P But it was indeed amazing to move the whole OS to completely different (and larger) disks, all that on the running system. (*) in that case, I also had to change/update mdadm.conf for the new RAID UUIDs

On 09.10.2023 05:42, Jason Craig wrote:
Yes, filesystem is not changed.
something with grub to boot from the new root?
If it was your boot device - you need to reinstall bootloader. update-bootloader --reinit should be enough. Although if you are using EFI in default configuration (with shim) you probably do not need even that - grub image in ESP looks for /boot using UUID which does not change. I am not sure if you will be able to reboot while replace is running though. It should be OK from the btrfs point of view, but I do not know if grub can handle incomplete replacement.

Jason Craig wrote:
A bit late, still: When I did this on our server several years ago (was even moving a mirrored mdraid setup(*)) everything went fine, except I forgot to re-make the initrd. So when booting, it didn't have the NVME module, and couldn't read the disks :-P But it was indeed amazing to move the whole OS to completely different (and larger) disks, all that on the running system. (*) in that case, I also had to change/update mdadm.conf for the new RAID UUIDs
participants (3)
-
Andrei Borzenkov
-
Jason Craig
-
Pit Suetterlin