mount LVM duplication drives | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

mount LVM duplication drives

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-01-2007
onthetopo onthetopo is offline
Registered User
 
Join Date: May 2007
Last Activity: 10 May 2009, 3:58 PM EDT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Power How to mount duplicated LVM harddrives resulted from cloning

Hi, I'm stuck in an awkward situation please help

I have two identical Seagate 80GB harddrives.
My objective is a bit strange.
1.I want to have a cloned disk as bootable backup
2.When booting using the master drive, I also want to mount the cloned backup disk so I can do incremental backup of certain files . and use the clone disk as free disk space.

I used "dd if=/dev/hda of=/dev/hdb" to clone the harddrive and the cloning worked fine.
Now fdisk lists partition as the following:

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 9729 78043770 8e Linux LVM

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 13 104391 83 Linux
/dev/hdb2 14 9729 78043770 8e Linux LVM

The clone works fine but I cannot mount both harddrives at the same time. LVM pvdisplay gives:
Found duplicate PV EKctcS4RyHWiw1JlI3FwWdTe8H0iLbxx: using /dev/hdb2 not /dev/hda2

Suppose hda is the master copy and hdb is the clone. Is there anyway to change the LVM fingerprint of hdb so:
1.hdb2 is mountable, say mount hdb2's home directory as /backup/home when booting using hda2
2.hdb is bootable on its own when hda is physically dead.


I'm using Fedroca Core 3. Thanks a lot!!

Last edited by onthetopo; 06-01-2007 at 10:01 PM..
Sponsored Links
    #2  
Old 06-03-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
AFK
 
Join Date: Dec 2004
Last Activity: 28 July 2014, 9:39 AM EDT
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
I have never used Linux LVM, but the error message makes sense. You have used dd to clone your disk. dd actually copies everything from the input to the output. In the case of your disk, that includes things like PV information that pvcreate would store on the disk (disk id, maybe host id and such). So you are getting a conflict.

Instead of using dd to clone your disk, use dump or tar or something similar. This will just copy the files and nothing else. If you are determined to use dd, then you cannot mount the disk to for any incremental backups. Just use dd to do a clone once a week or so. Incremental backups during the week can be taken on another hdd or a CD/DVD.

--EDIT
Otherwise, you can look towards mirroring the disk if it is supported.
Sponsored Links
    #3  
Old 06-04-2007
onthetopo onthetopo is offline
Registered User
 
Join Date: May 2007
Last Activity: 10 May 2009, 3:58 PM EDT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
how to mirror a disk? You mean like setup a software RAID-1. That sounds ok. I hope it's not too complicated to do so. Please tell me instructions.
I think specifically I would need to create RAID-1 over a existing LVM volume in this case.

My current setup is following:
lvm,lvdisplay:
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID KBIoRf-RjpU-tJ1O-ZMdz-32ZT-iNnw-JE0YRE
LV Write Access read/write
LV Status available
# open 1
LV Size 73.41 GB
Current LE 2349
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID dUGkAw-Z0PV-9ZF4-ao0w-N0GG-z6oL-LljKDt
LV Write Access read/write
LV Status available
# open 1
LV Size 992.00 MB
Current LE 31
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1

Last edited by onthetopo; 06-04-2007 at 02:56 PM..
    #4  
Old 06-08-2007
craigp84 craigp84 is offline
Registered User
 
Join Date: May 2007
Last Activity: 1 October 2013, 7:10 PM EDT
Location: Glasgow, Scotland
Posts: 72
Thanks: 1
Thanked 3 Times in 3 Posts
Quote:
Originally Posted by onthetopo
1.I want to have a cloned disk as bootable backup
2.When booting using the master drive, I also want to mount the cloned backup disk so I can do incremental backup of certain files . and use the clone disk as free disk space.
I think you're looking at this the wrong way.

You have 2 disks, one is larger (backup disk) than the other (primary disk) from what i understand.

In that case, you will partition the primary disk as you wish, but will make them Software RAID volumes. On disk 2 - the backup - you'll create the exact same partitions of the same size, with partition type = Software Raid.

At this point you have one disk fully allocated - the primary, and one which is an exact copy (man sfdisk for the easy way to make an exact copy) plus some free space at the end. Go ahead and create an extra partition for the free space, this will be your backup area.

Configure the software raid (there's thousands of docs on this so i wont repeat), configure your boot loader to boot disk 2 if disk 1 fails, then setup your backup process (rsnapshot?) to backup to the "spare" partition at the end of disk 2.

Hope this helps you see the concept & a more workable way to achieve.

-c
Sponsored Links
    #5  
Old 06-25-2007
onthetopo onthetopo is offline
Registered User
 
Join Date: May 2007
Last Activity: 10 May 2009, 3:58 PM EDT
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
thanks that's a good way to start if you are installing a brand new system.
But i can't afford a system reinstalltion of my primary hd.

If my primary didn't have LVM partition I would just create a RAID1 image on the backup hd. However, since the LVM partition already exists on my primary hd and since I don't want to fdisk my primary hd, I could only clone it to my backup hd and hope to mount it. The problem is simply that the cloned hd couldn't be mounted when booting from primary hd since both hd have identical volume ID fingerprint. I hope there is someway to change the id of one hd.
Sponsored Links
    #6  
Old 08-23-2008
builder88 builder88 is offline
Registered User
 
Join Date: Aug 2008
Last Activity: 30 April 2010, 6:52 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Like the OP, I also used dd to clone my boot drive. Worked great. Although the effort and knowledge is appreciated, can anyone answer the original question or not? Is it possible to mount the cloned drive when also booting off the drive that was the source (was cloned)?

If impossible, then I suppose the only way to use dd for ongoing backups is to make a full backup every time. I thought other people used dd in combination with incrementals, but apparently not (unless the above question can be answered in affirmative)?
Sponsored Links
    #7  
Old 08-30-2008
chrisprocter chrisprocter is offline
Registered User
 
Join Date: Aug 2008
Last Activity: 2 August 2009, 7:57 AM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
You can change the PVUUID of hdb with
pvchange -u /dev/hdb

I dont know why the -u isn't in the man pages but it works.

You may also need to change the VG UUID and names with
vgchange -u VolGroup00

then
vgrename VolGroup00 NewVolGroup00

then a vgscan should show up the two volume groups and you can mount them both
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mount Points vs Physical Drives ab52 Shell Programming and Scripting 3 02-23-2011 10:44 AM
Mount Extended NTFS Hard drives aluthgedara Filesystems, Disks and Memory 0 11-15-2010 04:58 AM
Unable to mount/find new drives shamrocks Filesystems, Disks and Memory 5 03-12-2009 11:49 AM
how floppy disks, CDs and flash drives (pen drives) are accessed in UNIX nokia1100 Shell Programming and Scripting 0 04-06-2007 09:10 PM
File Duplication raguramtgr Windows & DOS: Issues & Discussions 3 09-19-2004 04:32 AM



All times are GMT -4. The time now is 09:05 AM.