Web lists-archives.com

Re: Creating a bootable (non-UEFI) backup copy of a bootable (non-UEFI) Debian hard disk

Le 03/11/2018 à 09:45, local10 a écrit :

Am looking for an (easy) way to create a backup copy of working bootable Debian Buster HD. The idea here is to have a second bootable fully-functional HD which is normally offline but updated from time to time, including all user data and installed packages.

So for that purpose I have two HDs (working and backup), both are the same model, the same size, both are partitioned exactly the same way (three partitions: /boot, /, swap). Rsync-ing "/" partitions is not a problem and coping boot partition files from "working /boot" to "backup /boot" could be easily done too. However, I'm having issues making the backup HD bootable. Either I'm doing something wrong with grub-install and/or perhaps just coping files from "working /boot" to "backup /boot" isn't a good idea?

Copying files is not enough.
1) You must properly install GRUB on the backup disk :

grub-install --boot-directory=/backup-boot-partition-mount-point \

2) The partitions on the backup disk have different UUIDs but config files such as /etc/fstab, /etc/initramfs-tools/conf.d/resume and /boot/grub/grub.cfg reference UUIDs of the original disk partitions and must be adjusted.