Andrei Borzenkov wrote:
16.08.2020 23:02, Ralph пишет:
Hello!
Probably a newbie-type question but I've never moved a bootable btrfs os between two drives before so if anyone has any suggestions on best-way it would be highly appreciated :)
I have a machine with 2 nvme drives, both have a Leap installation, both btrfs, both bootable thru efimanager selection as well as grub2. The nvme0 is 15.1, nvme1 is 15.0. I am going to upgrade the 15.1 installation to 15.2. Before I do that, I want to move/copy the existing 15.1 installation to nvme1, overwriting the existing 15.0 installation. There are other partitions on both drives which will remain where they are, and thus there is no extra available space on either drive. For speed-of-drive reasons, I can not just install the new 15.2 over the 15.0, I want it on nvme0.
df -h tells me the 15.0 os total partition size is 60G, while the 15.1 to overwrite it is bigger at 69G. Actual used space of the 15.1 os is 24G says df.
It is always better to show actual commands and their output than describe them.
How best to move the 15.1? I have an available empty 128G usb stick if an intermediary device is needed.
Assuming you have enough space you could simply run
btrfs replace start old-partition new-partition /
While this works for moving, it does that: *move* the installation. So you will *not* have a copy of the 15.1 on both drives - the one on the source drive will be gone! Plus, I'm not sure if it works going to a smaller partition. It does work the other way around, by resizing the FS after the move to the actual partition size (btrfs filesystem resize 1:max /path). In doubt you'd have to run the resize on the 15.1, reducing it to 60GB, so it fits on the smaller partition. I did this with my server, quite some time ago, in exactly the hope to have a backup if something goes bad. In my case it was even a RAID1 that was moved from 2 normal SSDs to 2 NVMe. It even took care of the boot manager and the system *would* have booted without issues, unfortunately the initramfs didn't contain modules for NVME drives :P so it hang trying to mount the system disks. So I had to boot from rescue, and run mkinitrd/dracut. But it was very impressive, seeing this move done on a running system. But again, for making a clone this method won't work. The method jdd suggests I have never tried.... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org