Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.
Have you considered there might be a reason that other thread had lain unanswered for 8 years ?.
Just a bad plan IMHO. "dd" is totally insensitive to faults on the source - and will likely either copy those faults, or worse do something like inject zero bytes, or truncate depending on the options passed to it. And you'll never know.
Better to create new vg/lv's so you can mount them and then use a filesystem-aware tool to copy - say rsync. Can be done from the snap - an excellent idea, but you have to be sure all cached updates are flushed to disk prior to the snap being taken.
The backup (external) disk can be set up in advance with partitions/fstab/boot records to ensure it boots o.k (easy to test), and can still be mounted for a true backup. Don't try to use "dd" to do that - pointless and dangerous.
Being Linux, others will have different ideas about how to do this.