[SOLVED, kind of] Re: Creating a bootable (non-UEFI) backup copy of a bootable (non-UEFI) Debian hard disk
Nov 4, 2018, 4:52 AM by email@example.com:
> You'll get UUID collisions. Whenever a partition is searched by UUID and both drives are connected, you may find (and use !) the partition on either the original or backup one. This applies specially at boot time.
>> 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?
> What do you mean by "working" ? While the system is running ?
Yes, by "working" I mean the HD that is used to do the work: running the system, keeping user data, etc.
>> "dd if=/dev/sdsource of=/dev/sdbackup" comes mind but it did not work for me.
> It won't work well if the source drive is "in use" (has mounted filesystems read-write).
Well, I did dd-ing from Debian Live CD with both HDs (source and target) unmounted and still it did not work for me. The target "/boot" partition came through all right but target "/" partition was all screwed up, would not mount, after fsck removed everything it did not like on it I was left with the empty "/" partition.
Not even sure why dd is failing to mirror the disks properly for me. Bad sectors on the target disk? But when the files are transferred to the target with rsync everything seems to be in order. e2fsck reports no issues and the system boots and works properly. The main good thing about using dd is that it solved the grub installation issue.
Anyway, with the help of rsync to transfer files and tune2fs to sync UUIDs I was able to mirror the disks and now have a bootable backup HD with all the system and user files. The UUID collisions are not really a problem for me as the backup HD is only present in the system during backups and is offline most of the time. During backups the backup HD works fine and the system boots from it when it's used as the system disk so that's pretty much all I want from it.
Thanks to everyone who responded.