LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-22-2008, 04:18 PM   #1
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Rep: Reputation: 31
Question mounting old disk on new system with duplicate LVMs


Trying to help a friend move contents from a disk from a RHEL4 system to a new RHEL5 system, both with LVM filesystems. The new box can read both disks and scans both LVMs, but because they both have the same logical volume group name (the default VolGroup00), the new one just overrides the old one, and the old one isn't visible.

I tried quickly booting into rescue mode with the intention of renaming the old volume group name, but it looked like I'd need to refer to a 30-or-so character UUID that flew across the screen, and I didn't want to screw up the disk or volume with a typo.

Here's all the info I could think of to get on the new disk (/dev/hda) and the old one (/dev/hdb). The old LVM we need to access is on /dev/hdb2. It also seems that something funky is going on with the partition in fdisk, so I'd like to get the data off before the disk completely dies.

Code:
[root]# /usr/sbin/pvdisplay
  --- Physical volume ---
  PV Name               /dev/hdb2
  VG Name               VolGroup00
  PV Size               9.43 GB / not usable 24.26 MB
  Allocatable           yes 
  PE Size (KByte)       32768
  Total PE              301
  Free PE               1
  Allocated PE          300
  PV UUID               P5f3LG-yk5J-MfR6-wY96-xK3X-lH2h-mWXflJ
   
  --- Physical volume ---
  PV Name               /dev/hda2
  VG Name               VolGroup00
  PV Size               111.69 GB / not usable 1018.00 KB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              3574
  Free PE               0
  Allocated PE          3574
  PV UUID               9ps9A3-TzSN-kf0c-t2YH-qx0C-UTLa-3jc2Rh
   
[root]# /usr/sbin/lvdisplay
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                AXomxC-xCQf-wDjs-N0Gt-cndJ-0iTj-yP2pIL
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                110.69 GB
  Current LE             3542
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:0
   
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                cUMyav-TYfm-2cSs-2TTT-VqXA-Zbeq-qBKg5j
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GB
  Current LE             32
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:1
   
[root]# /usr/sbin/vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               9.41 GB
  PE Size               32.00 MB
  Total PE              301
  Alloc PE / Size       300 / 9.38 GB
  Free  PE / Size       1 / 32.00 MB
  VG UUID               Lsx4EL-G921-t2Ij-STGX-tZVq-DI5k-jHgHHH
   
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               111.69 GB
  PE Size               32.00 MB
  Total PE              3574
  Alloc PE / Size       3574 / 111.69 GB
  Free  PE / Size       0 / 0   
  VG UUID               W7Ey2E-h4Hd-aABa-CK0S-YG7w-xGSz-B6MUI1
   
[root]# ll /dev/mapper/
control              VolGroup00-LogVol00  VolGroup00-LogVol01  
[root]# ll /dev/mapper/
total 0
crw------- 1 root root  10, 63 Oct 21 10:03 control
brw-rw---- 1 root disk 253,  0 Oct 21 10:03 VolGroup00-LogVol00
brw-rw---- 1 root disk 253,  1 Oct 21 10:03 VolGroup00-LogVol01
[root]# ll /dev/mapper/VolGroup00-LogVol00 
brw-rw---- 1 root disk 253, 0 Oct 21 10:03 /dev/mapper/VolGroup00-LogVol00
[root]# ll /dev/mapper/VolGroup00-LogVol01
brw-rw---- 1 root disk 253, 1 Oct 21 10:03 /dev/mapper/VolGroup00-LogVol01
[root]# ll /dev/hdb*
brw-r----- 1 root disk 3, 64 Oct 21 10:03 /dev/hdb
brw-r----- 1 root disk 3, 65 Oct 21 10:03 /dev/hdb1
brw-r----- 1 root disk 3, 66 Oct 21 10:03 /dev/hdb2
brw-r----- 1 root disk 3, 67 Oct 21 10:03 /dev/hdb3   
[root]# /usr/sbin/lvscan
  ACTIVE            '/dev/VolGroup00/LogVol00' [110.69 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [1.00 GB] inherit
[root]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root]# fdisk /dev/hdb

The number of cylinders for this disk is set to 232581.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hdb: 120.0 GB, 120034123776 bytes
16 heads, 63 sectors/track, 232581 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1         208      104391   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/hdb2             208       19827     9888007+  8e  Linux LVM
/dev/hdb3           19828      232580   107227512   83  Linux
Thanks for your help.
 
Old 10-22-2008, 05:55 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
There may be a more clever way to do this, but if I were in your shoes I think I'd put the second drive (hdb) in another box, boot with a live cd (Fedora 9 will do it), and vgrename VolGroup00 to VolGroup01.

Be sure you have a good backup of any data on the drive before attempting this.
 
Old 10-22-2008, 07:28 PM   #3
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
Hi anomie,

Quote:
Originally Posted by anomie View Post
There may be a more clever way to do this, but if I were in your shoes I think I'd put the second drive (hdb) in another box, boot with a live cd (Fedora 9 will do it), and vgrename VolGroup00 to VolGroup01.
I may end up doing that, but I'd rather leave things where they are if at all possible when it comes to hardware, since I think the move from one box to another is what triggered this old drive to start misbehaving in the first place. I'd rather not try and move it again until the data can be copied.
Quote:
Be sure you have a good backup of any data on the drive before attempting this.
Yeah ... unfortunately, if he had kept a good backup, I wouldn't need to do this in the first place.
 
  


Reply

Tags
disk, lvm, mount, rhel


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem mounting a file System over an USB key disk !!!! dante_3dsmax Linux - Embedded & Single-board computer 4 09-26-2008 02:39 AM
duplicate my hard disk alaios Linux - Hardware 2 04-10-2005 09:06 PM
Mounting duplicate Linux partitions rridler Linux - Newbie 9 05-03-2004 02:24 PM
I have one system, can I duplicate it? ForumKid Linux - General 3 10-13-2002 08:20 AM
Is there a way to duplicate my system to a CD so just in case i have to format the ma ForumKid Linux - General 3 12-28-2001 12:24 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration