First time is not painless, practice in a VM first can help, subsequent times it takes only minutes.
Create partitions for new location.
From live environment …
– Use partclone
to backup your root file system.
– Use partclone
to restore your root file system to new root partition.
– Use uuidgen
and tune2fs
to change the restored file system UUID.
– Chroot into new root file system and change any old UUID references in /etc/default/grub
, /etc/fstab
, /etc/crypttab
, etc.
– For EFI systems mount efi partition in chroot and re-install grub.
– Regenerate initramfs’ using mkinitcpio -P
– Use efibootmgr
to ensure new boot order is correct.
Reboot into your system in a new location.
I’ve cloned my system many times using this technique. Seems complicated but it really is not.
I always keep post update (usually weekly) partclone images of all my systems on backup media. I can use these for disaster recovery, ie disk failure, or to restore if the main system becomes borked. With recovery omit the UUID editing stuff.
If you have a fully encrypted system simply open the luks container with cryptsetup
before running partclone
. On your new location luks encrypt your root partition first. Include the new luks container UUID in the UUID editing steps above.