如何将我的安装克隆到 btrfs 分区并使其可启动?

如何将我的安装克隆到 btrfs 分区并使其可启动?

我正在尝试将所有文​​件、配置、所有内容复制到新的 btrfs 分区,而无需重新安装。

到目前为止,我尝试过的方法是进入实时 CD 会话(实际上是从单独分区上的 iso 启动的),然后使用rsync它将所有内容从主分区复制到新分区。然后更新新分区fstab以获得新的 UUID。最后update-grub

这似乎有效,一切都正确复制,具有正确的权限和所有权,grub 为新分区创建了新的菜单项,尝试启动它似乎也有效!问题是它仍然启动到旧分区。即使我在启动时选择了新的菜单项。

我也尝试了所有这些,但rsync用替换cp -a

编辑

这是fstab新旧分区的文件。

旧 fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID=11a64844-0379-4d5c-8e2a-e06ff3f79619 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=C040-6244  /boot/efi       vfat    umask=0077      0       1
/swapfile swap swap defaults 0 0
UUID=f4f71706-d44b-42a4-8617-50eed11c5650 /boot/recovery ext4 ro 0 0

新的 fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID=1b77a06a-efb7-4717-bfb7-9f725aa50f42 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=C040-6244  /boot/efi       vfat    umask=0077      0       1
/swapfile swap swap defaults 0 0
UUID=f4f71706-d44b-42a4-8617-50eed11c5650 /boot/recovery ext4 ro 0 0

这里/boot/recovery就是我之前提到的 iso 分区。

相关内容