happybunny
07-01-2006, 12:40 AM
We recently lost access to a SAN disk that had logical volume's on it. Although I reference EMC SAN disks, I'm sure this would work for any disk that you have lost access too, that had lvm's.
powermt display dev=allto find correct drive
(this would most likely be fdisk -l for non-SAN related disks)
pvcreate /dev/emcpowerXXX (or /dev/sda1, etc) to create a new pv.
This doesn't seem to make sense as the drive should have already had a pv on it, but I did it anyway and it worked!
pvscan -u to display current uuid
output looks like:
PV /dev/sdae1 with UUID fBJGLI-pVHM-rpyV-9kLL-k6g5-TPbi-y6ORVL VG vgapps1 lvm2 [30.00 GB / 96.00 MB free]
The uuid is the key....it is a reference to the disk itself. If you have the wrong one in the file below, then the vgcfgrestore cannot find the disk.
copy uuid of our drive to /etc/lvm/backup/vg-group-name to the section:
physical_volumes {
pv0 {
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
The file most likely have a different id = for you pv0. This is why the vgcfgrestore didn't work as it could no longer find the drive.
I am not exactly sure how a volume group with more than one physical drive would show up in this file, but I'm sure it would be pretty obvious. You will need to do this for every disk in the volume group.
vgcfgrestore vg-group-name to recover the config. The vg-group-name is also the name of the file in /etc/lvm/backup/
vgchange -ay to activate all the vg's on our system.
Since we are basically importing disks that seem foriegn to the system, you must activate them after importing them. The -ay switch just activates everything it finds.
mount -a should restore everything that was missing. You may choose to mount them elsewhere, but in my recovery, I just needed them back where they were.
powermt display dev=allto find correct drive
(this would most likely be fdisk -l for non-SAN related disks)
pvcreate /dev/emcpowerXXX (or /dev/sda1, etc) to create a new pv.
This doesn't seem to make sense as the drive should have already had a pv on it, but I did it anyway and it worked!
pvscan -u to display current uuid
output looks like:
PV /dev/sdae1 with UUID fBJGLI-pVHM-rpyV-9kLL-k6g5-TPbi-y6ORVL VG vgapps1 lvm2 [30.00 GB / 96.00 MB free]
The uuid is the key....it is a reference to the disk itself. If you have the wrong one in the file below, then the vgcfgrestore cannot find the disk.
copy uuid of our drive to /etc/lvm/backup/vg-group-name to the section:
physical_volumes {
pv0 {
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
The file most likely have a different id = for you pv0. This is why the vgcfgrestore didn't work as it could no longer find the drive.
I am not exactly sure how a volume group with more than one physical drive would show up in this file, but I'm sure it would be pretty obvious. You will need to do this for every disk in the volume group.
vgcfgrestore vg-group-name to recover the config. The vg-group-name is also the name of the file in /etc/lvm/backup/
vgchange -ay to activate all the vg's on our system.
Since we are basically importing disks that seem foriegn to the system, you must activate them after importing them. The -ay switch just activates everything it finds.
mount -a should restore everything that was missing. You may choose to mount them elsewhere, but in my recovery, I just needed them back where they were.