[linux-lvm] cant find PV after boot sector rewrite

Miha Verlic miha at habulin.si
Sat Oct 2 19:51:51 UTC 2004

I have (or better yet - had) 3x200gb drives joint up together with LVM1. 
PV were created directly on /dev/hde, /dev/hdf, /dev/hdg, without any 
partitions made before. On top of the ~600gb VG I created ext3 partition 
and everything worked for a few months, but now I had to move disks to a 
new server. I exported drives with with "vgchange -an mix" and "vgexport 
mix" successfully, however LILO on new machine was complaining about 
duplicated volume IDs (although it still booted).
"lilo -T vol-ID" showed 00000002 volume IDs on all three drives, so I ran:
"lilo -z -M /dev/hde"
"lilo -z -M /dev/hdf"
"lilo -z -M /dev/hdg"
and a few second later, it occured to me, this *might* change 
bootsectors of all drives. Of course pvscan did not find any physical 
volumes anymore.
Lilo does create backup files every time you run it, however since I ran 
it 3 times, I only have backup of boot sector for one drive - hdg. I 
have successfully "imported" boot sector of /dev/hdg back with "dd 
if=/boot/boot.2140 of=/dev/hdg", however boot sectors from /dev/hde and 
/dev/hdf remains lost. After restoring boot sector, pvscan now finds 1 
inactive PV /dev/hdg in exported VG "mix".
Is there any way to get back/recreate the whole PV without loosing any 
data? All I'm actually missing is 2x512bytes in boot sectors :(

Oh yeah some useful (or not) info: PV is not root partition, lvm 1.0.8, 
linux is 2.4.27, glibc 2.3.2, system is slightly modified slackware 10.

More information about the linux-lvm mailing list