Backups by cloning the running system disk?
I, too, am trying to set up a process of doing "backups" by cloning the running system disk.
I'm running CentOS (5.something) on a small system with room for one IDE/SATA disk. (I plan to go with 1TB drives.) For each backup, I want to clone the system disk, live, to an outboard disk that is identical to the inboard one, connected via a USB-to-SATA adapter. When the inboard disk dies, I just replace it with the most recent backup and reboot. [It would be nice to be able to mount a backup disk to retrieve a file, too, but, because of the UUID problem, I'll hold that for another time...]
I think I've figured out how to duplicate the partition table, MBR, non-LVM partition (boot), etc., on the destination drive and set up a snapshot on the source logical volume, so, now, I'm working on the copy-the-snapshot part.
Some of the replies here are the best I've seen on how to copy the LVM. But, I don't see how it can possibly work, for the following reasons:
. You can't have two volume groups with the same name on the same running system. So, you have to create the destination volume group with a different name from the source volume group.
. /etc/fstab, at least the way CentOS/RedHat created the one on my disk (using the default installation) references the logical volumes (one that has most of the file system and one for swap space) via the name of the volume group and the name of the logical volume ("dev/VolGroup00/LogVol00").
. So, when you try to boot (solely) from the destination disk, won't there be a problem with the O/S not being able to find a volume group with the name it's expecting?
. And, because of the UUID conflict, you can't (easily) actually do anything such as mount the filesystem that's on the logical volume in the destination disk's volume group. So, you can't easily change the /etc/fstab on the destination disk to match the volume group name on the destination disk. (I vaguely recall reading somewhere about being able to change the UUIDs of disks/partitions/LVMs, but I don't remember if it requires something impractical, such as a second system - with disks with different UUID's - to do it on.)
. I understand that it's possible to use labels instead of device names in fstab to find non-LVM partitions. (It's recommended for the /boot partition.) Is something comparable possible with LVM's? -Some kind of label that can be the same on two logical volumes in different volume groups on the running system that is enough for the file-system mount process during boot to be able to find the logical volume, regardless of the volume group's name?
Sorry if it sounds pedantic; I'm trying to be precise to avoid a lot of back-and-forth clarifying things.