[opensuse] move a bootable btrfs os between two drives
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. How best to move the 15.1? I have an available empty 128G usb stick if an intermediary device is needed. Thanks. Ralph -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Le 16/08/2020 à 22:02, Ralph a écrit :
How best to move the 15.1? I have an available empty 128G usb stick if an intermediary device is needed.
basically, to move a btrfs disk the rationale is the following: * add the new partition to the copy to keep partition, making the btrfs system twice the size * balance the two to make files spread on the two partitions * remove the old partition. I did this, but some time ago and don't remember the details, easily found on btrfs wiki. be warned than this do *not* copy the partition but *move* it AFAIR this can be done on a running system jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 16 Aug 2020 23:36:00 +0200 "jdd@dodin.org" <jdd@dodin.org> wrote:
Le 16/08/2020 à 22:02, Ralph a écrit :
How best to move the 15.1? I have an available empty 128G usb stick if an intermediary device is needed.
basically, to move a btrfs disk the rationale is the following:
* add the new partition to the copy to keep partition, making the btrfs system twice the size * balance the two to make files spread on the two partitions * remove the old partition.
I did this, but some time ago and don't remember the details, easily found on btrfs wiki.
be warned than this do *not* copy the partition but *move* it AFAIR
this can be done on a running system
Hmm. This does not sound at all like what I am trying to do. There is no 'new partition'. And the two existing btrfs systems are independent and coexistant and I'd like to keep it that way. But I will check the btrfs wiki to see better what you are saying. Is this the btrfs wiki or the openSUSE btrfs wiki where I will find this? Thanks. Ralph -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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 / and after it has finished reinstall bootloader on new device. I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 17 Aug 2020 09:06:46 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
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 /
and after it has finished reinstall bootloader on new device. I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM.
Thanks for reply Andrei (and jdd). I won't have time, until next weekend at least, to get back to this project. After 'google-time' on the subject, this is starting to look like it is more complicated, and time-intensive too, both in planning and in actual transfer, than I had anticipated :( Ralph -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
18.08.2020 12:55, Ralph пишет:
On Mon, 17 Aug 2020 09:06:46 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
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 /
and after it has finished reinstall bootloader on new device. I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM.
Thanks for reply Andrei (and jdd). I won't have time, until next weekend at least, to get back to this project. After 'google-time' on the subject, this is starting to look like it is more complicated, and time-intensive too, both in planning and in actual transfer, than I had anticipated :(
Well, you need to move data from old to new partition, so you need at least as much time as required to read data from old partition and write it to new partition. What did you expect? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 18/08/2020 12.11, Andrei Borzenkov wrote:
18.08.2020 12:55, Ralph пишет:
On Mon, 17 Aug 2020 09:06:46 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
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 /
and after it has finished reinstall bootloader on new device. I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM.
Thanks for reply Andrei (and jdd). I won't have time, until next weekend at least, to get back to this project. After 'google-time' on the subject, this is starting to look like it is more complicated, and time-intensive too, both in planning and in actual transfer, than I had anticipated :(
Well, you need to move data from old to new partition, so you need at least as much time as required to read data from old partition and write it to new partition. What did you expect?
He refers to the time needed because of your advice: "I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM." :-) Question. Can't plain "dd" be used? Sure, the destination partition is bigger, but surely it can be expanded afterwards. And it gets the same UUID, but it is on a different computer. As long as the two disks are never connected to the same computer, no problem. Another possibility that occurs to me is using "clonezilla", which may take care of the expanding, and perhaps (I don't remember) changes the uuid. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On Tue, 18 Aug 2020 13:11:25 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
18.08.2020 12:55, Ralph пишет:
On Mon, 17 Aug 2020 09:06:46 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
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 /
and after it has finished reinstall bootloader on new device. I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM.
Thanks for reply Andrei (and jdd). I won't have time, until next weekend at least, to get back to this project. After 'google-time' on the subject, this is starting to look like it is more complicated, and time-intensive too, both in planning and in actual transfer, than I had anticipated :(
Well, you need to move data from old to new partition, so you need at least as much time as required to read data from old partition and write it to new partition. What did you expect?
Well no, these are both nvme drives, one of them fast (the receiver), the other extremely fast (the source), and the transfer is over a pcie bus, so the movement of the data itself between physical drives is not at all overwhelming, but it will still require backups too, and downtime, and much learning and planning to make sure I know exactly what I should be doing (or not doing). I'm certainly no btrfs expert. What did I expect? Well, something as simple as transfering an ext4 root system would have been nice :) Thanks again for the assistance. Ralph -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
18.08.2020 14:22, Ralph пишет:
On Tue, 18 Aug 2020 13:11:25 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
18.08.2020 12:55, Ralph пишет:
On Mon, 17 Aug 2020 09:06:46 +0300 Andrei Borzenkov <arvidjaar@gmail.com> wrote:
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 /
and after it has finished reinstall bootloader on new device. I am not sure what happens when it is interrupted so you certainly are advised to make backup first and probably test it in VM.
Thanks for reply Andrei (and jdd). I won't have time, until next weekend at least, to get back to this project. After 'google-time' on the subject, this is starting to look like it is more complicated, and time-intensive too, both in planning and in actual transfer, than I had anticipated :(
Well, you need to move data from old to new partition, so you need at least as much time as required to read data from old partition and write it to new partition. What did you expect?
Well no, these are both nvme drives, one of them fast (the receiver), the other extremely fast (the source), and the transfer is over a pcie bus, so the movement of the data itself between physical drives is not at all overwhelming, but it will still require backups too, and downtime,
No, it does not. btrfs replace works online, actually you *must* be online to it to work. It works completely transparently. There could be some unexpected interaction with systemd when device identification suddenly moves to another device, which is why I say it makes sense to check in test environment.
and much learning and planning to make sure I know exactly what I should be doing (or not doing). I'm certainly no btrfs expert.
What did I expect? Well, something as simple as transfering an ext4 root system would have been nice :)
Thanks again for the assistance.
Ralph
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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
participants (5)
-
Andrei Borzenkov
-
Carlos E. R.
-
jdd@dodin.org
-
Peter Suetterlin
-
Ralph