Everything may go wrong in this process. Make backups, prepare a live distribution that can connect to internet.
Sync your current root filesystem to another location, eg. /NEW_ROOTFS
- Edit
/NEW_ROOTFS/etc/fstab
to mount proper devices - Edit your rootfs synchronization tool (
smith-sync
,btrbk
,dcs-tools
,snapper
, ...) config to backup between correct devices - Edit
/NEW_ROOTFS/etc/crypttab
to reflect correct keys/entries - Set NOCOW (
chattr +C folder
) attributes of folders if there were any (like Chromium's~/.config/chromium
, VM disk images, etc)
initrd.img
is responsible for mounting the correct rootfs. Thus, new GRUB entry (or the bootloader entry you use now) should pass the NEW_ROOTFS
strategy/devices to the initrd.
For example, a rootfs may be on a btrfs subvolume on a btrfs filesystem on a LVM volume on a LUKS partition. Now new entry should know about
- New btrfs subvolume (if it is changed)
- New LVM volume names (it is probably changed)
- New LUKS partition UUID (it is absolutely changed)
This is a "new device" scenario where the strategy (btrfs_subvolume/btrfs/LVM/LUKS) is unchanged.
You may want to change the strategy, for example XFS/LUKS/RAID
. If this is the case, initrd should also know about the correct mount order.