Am 2015-10-06 um 14:32 schrieb Rich Freeman: > On Tue, Oct 6, 2015 at 3:52 AM, Stefan G. Weichinger <li...@xunil.at> wrote: >> Am 2015-10-06 um 09:45 schrieb Neil Bothwick: >>> On Tue, 6 Oct 2015 09:35:40 +0200, Stefan G. Weichinger wrote: >>> >>>>> How about btrfs send/receive? I've never used them but used >>>>> the equivalent with ZFS and it was simple to do. >>>> >>>> I think "btrfs-replace" is my friend. Will try that later. >>> >>> If you want to keep the system live, replace will do the trick, but >>> when I tried it to replace a drive that was showing SMART errors it >>> was VERY slow. btrfs send serialises your whole filesystem to a >>> file so it should be much faster. >> >> btrfs send would also have the benefit that I won't lose the >> source-dev in the process. btrfs-replace would "empty" my hdd, if then >> things fail I don't have that backup again to start from. >> >> I just have to find out how to keep the UUID to keep the copy booting etc >> >> I will try that later this day, after some job work. >> > > I doubt send/receive would preserve the UUID. > > I'd probably use btrfs-replace. > > If you do want to keep the same UUID via any mechanism make sure the > original drive isn't visible or btrfs may try to use it instead of the > new one. That is more of a concern in raid configs, but it might > apply to single volume. Btrfs can't tell the difference between the > active volume you unmounted yesterday and the lvm snapshot of it from > six months ago, and will potentially try to mix-and-match them > resulting in carnage. > > Btrfs does support resizing if you just want to shrink the filesystem > and then dd it over to the new partition. Just make sure the old one > isn't attached when you try to mount it. Just shrink your btrfs > partition down to a size smaller than where it is going, use dd to > copy it, then you can run btrfs resize to expand it back to the full > size. The syntax is slightly different but it works the same as > resize2fs, and I believe it works either online or offline. > > However, if you're able to figure out how to use btrfs and migrate it > from one drive to another, you could probably just edit the UUID in > your grub config if necessary. It just takes a text editor, and maybe > a run of grub2-mkconfig if you're using that. You'll also want to > update your fstab, and if you're using dracut you should update that > as well (as long as it gets a decent UUID from the command line I > think it will figure things out on its own though - dracut saves a > copy of your fstab to help find things when you build it but then it > will remount filesystems using the real fstab before it finishes).
I do a plain rsync into a new btrfs on the ssd now and edited the UUID within copied gummiboat loader entries .... some GBs left to sync before I can test booting! ;) I don't use grub2 anymore, just gummiboot .. and even this might be replaced by bootctl soon. step by step, you know.