LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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.

Notices


Reply
  Search this Thread
Old 03-10-2013, 07:56 PM   #1
CamilliLa
LQ Newbie
 
Registered: Aug 2006
Posts: 1

Rep: Reputation: 0
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.
 
Old 03-12-2013, 03:43 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot access my System HDD with cfdisk, during System is running from this disk an0r0c Debian 7 03-21-2009 05:46 AM
Disk cloning Diggy Linux - Software 12 01-28-2009 03:44 PM
disk/system cloning Sharaz Linux - General 2 12-28-2005 03:11 PM
cloning disk using cp - no special devices for target disk vulture99 Linux - General 6 05-08-2005 05:36 PM
Disk Cloning sts_cat Linux - General 1 03-24-2003 11:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration