Skip to contentSkip to conversation

Recovering LVM Volume

linux-lvm Jim Secan 2 participants 3 messages Jan 23, 2008

lore
Share & tools
lore

Jim Secan

author
#0 lore raw

The issue is trying to mount a drive that was the primary internal HD for a system with a failed motherboard. The disk was built using FC3, and has a a /boot partition and one under LVM control. When I try to mount this disk as a USB drive from a CentOS system, I can't mount the LVM-controlled partition because it has the same LVM volume/group name as the disk in the CentOS system.

I have seen several discussions of this, and I want to make sure that what I think needs to be done is indeed as complicated as it sounds. There appear to be two options: (1) rename the LVM volume on the CentOS primary drive (I'll call this the internal HD) or (2) rename the LVM volume on the now-USB drive. In a perfect world, one would be able to just rename the now-USB drive's LVM volume/group/whatever names so that it differs from those on the current system and move forward from there. It sounds like this simple approach is impossible, and that one of the following must be done.

1. Rename the volume on the internal HD. This can be done using vgrename, but then you have to make sure you catch all references to the original name in various system files such as fstab and grub.conf. I've also seen references to having to "expand, modify, and repackage" initrd. I have no idea how to do this, and it sounds like a "go there carefully" sort of thing. I also worry if there's other files I don't know about that must be changed or I've just "bricked" my CentOS system. Not going here.

2. Rename the volume on the USB HD. This requires me to power down the CentOS system, open the box, disconnect the internal HD, boot to the installation CD in rescue mode, use lvm commands to rename the USB HD, and then put everything back together again. This sounds overly complicated, but necessary.

So, have I understood all this correctly? Are these the only two ways in which this problem can be surmounted, and if so which is the safest. I'm thinking that I want to rename the internal HD to something other than the default setting anyway, but I really don't like the idea that I might miss changing the name in some important file or script that will bite me later.

#1 lore raw
Quoted 6 lines · Jim Secan

The issue is trying to mount a drive that was the primary internal HD for a system with a failed motherboard. The disk was built using FC3, and has a a /boot partition and one under LVM control. When I try to mount this disk as a USB drive from a CentOS system, I can't mount the LVM-controlled partition because it has the same LVM volume/group name as the disk in the CentOS system.

...

Quoted 6 lines

2. Rename the volume on the USB HD. This requires me to power down the CentOS system, open the box, disconnect the internal HD, boot to the installation CD in rescue mode, use lvm commands to rename the USB HD, and then put everything back together again. This sounds overly complicated, but necessary.

Quoted 6 lines

So, have I understood all this correctly? Are these the only two ways in which this problem can be surmounted, and if so which is the safest. I'm thinking that I want to rename the internal HD to something other than the default setting anyway, but I really don't like the idea that I might miss changing the name in some important file or script that will bite me later.

3. Plug the USB HD into any available system with a different/no internal VG name and rename. Stick a LiveCD into one of your LTSP thin clients for instance.

4. Rename the USB HD using the UUID:

   # vgrename -v [VGUUID] newvgname

From the man page:
"vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 VolGroup00_tmp" changes the name of the Volume Group with UUID Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to "VolGroup00_tmp".

Signature · 4 lines
	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
author
#2 lore raw

Many thanks, and I think this how-to list (corrected as necessary) would be a very good addition to the FAQ specifically for this situation. Lots of people find that they have disks under LVM by default and don't have a clue what they've got until their server goes belly up.

Turns out I do have a non-LVM system, and that has made the nut. Thanks again.

Jim

Quoted 57 lines · Stuart D. Gathman
Quoted 10 lines · Jim Secan

The issue is trying to mount a drive that was the primary internal HD for
a system with a failed motherboard. The disk was built using FC3, and has
a a /boot partition and one under LVM control. When I try to mount this disk as a USB drive from a CentOS system, I can't mount the LVM-controlled
partition because it has the same LVM volume/group name as the disk in the
CentOS system.

...

Quoted 8 lines

2. Rename the volume on the USB HD. This requires me to power down the CentOS system, open the box, disconnect the internal HD, boot to the installation CD in rescue mode, use lvm commands to rename the USB HD, and
then put everything back together again. This sounds overly complicated,
but necessary.

Quoted 10 lines

So, have I understood all this correctly? Are these the only two ways in
which this problem can be surmounted, and if so which is the safest. I'm
thinking that I want to rename the internal HD to something other than the
default setting anyway, but I really don't like the idea that I might miss
changing the name in some important file or script that will bite me later.

3. Plug the USB HD into any available system with a different/no internal VG name and rename. Stick a LiveCD into one of your LTSP thin clients for instance.

4. Rename the USB HD using the UUID:

   # vgrename -v [VGUUID] newvgname

From the man page:

   "vgrename Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 VolGroup00_tmp"
   changes the name of the Volume Group with UUID
   Zvlifi-Ep3t-e0Ng-U42h-o0ye-KHu1-nl7Ns4 to "VolGroup00_tmp".

--

	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703

591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/