[linux-lvm] lvm- problem after pvcreate -ff

d.g.lawyer at medisin.uio.no d.g.lawyer at medisin.uio.no
Wed May 31 20:28:15 UTC 2006


Hello,

I’m afraid I have over-written something important while using LVM
(pvcreate), and need help restoring the system, or at least getting the
data off of it.

In short, while installing a new hard-disk to an existing FC4 system, I
ran pvcreate twice on the new disk. The second time I used the –ff option
(it asked for it), after which LVM was no longer able to find the device
with a certain uuid.

The long story:
I am responsible for a small computer lab, 5 machines running FC4 with a
default install, including the default LVM setup. I needed to install a
new 250GB hard drive in one of the machines.

Put harddisk in case, connected cables, powered on. No smoke, bios detects
the drive.

The new hard disk shows up as /dev/sdb

fdisk /dev/sdb   to create a partition table, forget to set type.

pvcreate /dev/sdb1

vgextend VolGroup00 /dev/sdb1

When preparing to lvextend I realized I’d forgotten to set the type with
fdisk.

fdisk again, this time also setting the type

pvcreate /dev/sdb1
  Gives error “Cannot create physical volume without –ff option”

pvcreate –ff /dev/sdb1

pvscan (just to check)

Get the message “couldn't find the device with uuid ‘xxxxx-x-x-xx-x-x’” (no,
it wasn’t x’s, but I don't want to copy the whole string by hand here)

And of course now the computer doesn’t boot as it cannot read all of
VolGroup00.

The how-to suggests
Use pvcreate to restore the metadata: pvcreate --uuid "<some_long_string>"
--restorefile /etc/lvm/archive/VolumeGroupName_XXXXX.vg <PhysicalVolume>

but I can't read /etc/lvm/archive since LVM can't load the volume group
which contains /etc.

Any help appreciated.







More information about the linux-lvm mailing list