Web lists-archives.com

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

Nov 3, 2018, 5:22 AM by pascal@xxxxxxxxxxxxxxx:

> Copying files is not enough.
> 1) You must properly install GRUB on the backup disk :
> grub-install --boot-directory=/backup-boot-partition-mount-point \
>  /dev/backup-disk
> 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.
The problem I have with grub is that there is a lot of contradictory information on the net as to how to use it. For example, here [1] it is said that just running grub-install is not enough. Fiddling with disk UUIDs in different files every time I do a backup also does not sound like fun. Is there a way to avoid this? What if the backup HD partition UUIDs are changed to be the same as the source HD UUIDs?

I guess my issue comes down to this: What is a (preferably easy) way to properly backup a working Debian HD to a backup drive, so the system would boot from the backup drive and function normally, including the user data and all installed packages?

"dd if=/dev/sdsource of=/dev/sdbackup" comes mind but it did not work for me. Though my HDs are the same model they are manufactured in different months so maybe they have different firmware or whatever.


[1] - https://unix.stackexchange.com/questions/108725/how-to-make-a-bootable-hdd-with-grub2 <https://unix.stackexchange.com/questions/108725/how-to-make-a-bootable-hdd-with-grub2>