Broken hard disk
Hi,
I had a standard Fedora Core 4 installation with the root fs and swap on LVM. I upgraded to Core 5. Everything worked fine. No need to be an LVM guru so far.
Then I added a new hard disk to the computer and a partition of this new disk to the root volume. The "new" hard disk then broke down so that I am unable to access the data on the root volume.
Now I installed the old, hopefully still working disk in a different computer and booted with Knoppix 5.0.1 to get some of my data back but vgscan -v comes back with nothing at all.
fdisk says
Disk /dev/hda: 20.5 GB, 20525137920 bytes
255 heads, 63 sectors/track, 2495 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 2495 19936665 8e Linux LVM
Any suggestions how to recover that volume?
Thanks
Martin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 3 lines · Martin Wilmes
Now I installed the old, hopefully still working disk in a different computer and booted with Knoppix 5.0.1 to get some of my data back but vgscan -v comes back with nothing at all.
It's a bit strange that it outputs nothing at all. I'd expect to see something like:
$ sudo vgscan -v
Wiping cache of LVM-capable devices
Wiping internal VG cache
Reading all physical volumes. This may take a while...
Finding all volume groups
Finding volume group "scratch0"
Couldn't find device with uuid 'ZpQI30-qpx3-Cm54-YcSR-5Ho4-rlUx-uCxGBi'.
Couldn't find all physical volumes for volume group scratch0.
Couldn't find device with uuid 'ZpQI30-qpx3-Cm54-YcSR-5Ho4-rlUx-uCxGBi'.
Couldn't find all physical volumes for volume group scratch0.
Volume group "scratch0" not foundIf there's a PV missing from the volume group.
You can add move 'v's to increase the verbosity of vgscan to see what it's scanning - do you have any device filters configured in /etc/lvm.conf?
It'd also be good to see what pvscan shows, for e.g.:
$ sudo pvscan Couldn't find device with uuid 'ZpQI30-qpx3-Cm54-YcSR-5Ho4-rlUx-uCxGBi'. PV /dev/hda2 VG d800_vg0 lvm2 [34.18 GB / 760.00 MB free] PV unknown device VG scratch0 lvm2 [60.00 MB / 0 free] PV /dev/loop1 VG scratch0 lvm2 [60.00 MB / 52.00 MB free] Total: 3 [34.30 GB] / in use: 3 [34.30 GB] / in no VG: 0 [0 ]
Once you find the volume group, activate it without the missing PV using the --patial option, e.g:
vgchange -ay --partial <vgname>
Cheers,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFFLsdU6YSQoMYUY94RAuddAJ4rVU9uHR9njfB/WuYqRg/6bVJkNACgsfpi vgFdYK7lqpgZ6mJ3bo5VccQ=
=D/8l
-----END PGP SIGNATURE-----
Quoted 2 lines · Bryn M. Reeves
You can add move 'v's to increase the verbosity of vgscan to see what it's scanning - do you have any device filters configured in
/etc/lvm.conf?
No filters, everything is commented out (unchanged).
vgscan -vvv now generates ouput for hda:
...
/dev/hda1: size is 208782 sectors
Closed /dev/hda1
/dev/hda1: size is 208782 sectors
Opened /dev/hda1 RO O_DIRECT
/dev/hda1: block size is 1024 bytes
Closed /dev/hda1
Using /dev/hda1
Opened /dev/hda1 RO O_DIRECT
/dev/hda1: block size is 1024 bytes
/dev/hda1: No label detected
Closed /dev/hda1
/dev/loop1: Skipping (sysfs)
/dev/cloop1: Skipping: Unrecognised LVM device type 240
...
Quoted 1 line
It'd also be good to see what pvscan shows, for e.g.:
pvscan -vvv outputs:
...
/dev/hda1: size is 208782 sectors
Closed /dev/hda1
/dev/hda1: size is 208782 sectors
Opened /dev/hda1 RO O_DIRECT
/dev/hda1: block size is 1024 bytes
Closed /dev/hda1
Using /dev/hda1
Opened /dev/hda1 RO O_DIRECT
/dev/hda1: block size is 1024 bytes
/dev/hda1: No label detected
Closed /dev/hda1
/dev/loop1: Skipping (sysfs)
/dev/cloop1: Skipping: Unrecognised LVM device type 240
...
Thanks
Martin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 8 lines · Martin Wilmes
Quoted 2 lines · Bryn M. Reeves
You can add move 'v's to increase the verbosity of vgscan to see what it's scanning - do you have any device filters configured in
/etc/lvm.conf?No filters, everything is commented out (unchanged).
vgscan -vvv now generates ouput for hda:
Quoted 15 lines
...
/dev/hda1: size is 208782 sectors
Closed/dev/hda1
/dev/hda1: size is 208782 sectors
Opened/dev/hda1ROO_DIRECT
/dev/hda1: block size is 1024 bytes
Closed/dev/hda1
Using/dev/hda1
Opened/dev/hda1ROO_DIRECT
/dev/hda1: block size is 1024 bytes
/dev/hda1: No label detected
Closed/dev/hda1
/dev/loop1: Skipping (sysfs)
/dev/cloop1: Skipping: Unrecognised LVM device type 240
...
What about hda2? According to your fdisk output, that's the PV on this disk.
Does hda2 appear in /proc/partitions?
Quoted 4 lines
Quoted 1 line
It'd also be good to see what pvscan shows, for e.g.:
pvscan -vvv outputs:
Likewise - all I can see here is hda1 - that's a type 0x83 (Linux) partition, rather than the 0x8e (Linux LVM) partition that we're interested in here.
Can you put the complete output of vgscan -vvv and pvscan -vvv somewhere on the web and post the links here?
You can use a pastedump service like http://p.opsat.net/new if you don't have access to somewhere to host this.
Cheers,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFFL7/O6YSQoMYUY94RAmxzAJkBGN5IDouPjSKCk44l8MCuN0XNjQCg2SB5 J7s5pP0VJTRzpLtgRJ5Ylxs=
=MwUj
-----END PGP SIGNATURE-----
Quoted 5 lines · Bryn M. Reeves
Quoted 3 lines · Martin Wilmes
On Friday, 13. October 2006 00:53, Bryn M. Reeves wrote:
...
Quoted 7 lines
Quoted 4 lines
Closed
/dev/hda1
/dev/loop1: Skipping (sysfs)
/dev/cloop1: Skipping: Unrecognised LVM device type 240
...What about hda2? According to your fdisk output, that's the PV on this disk.
Sorry, that was really silly.
Quoted 1 line
Does hda2 appear in
/proc/partitions?
Yes, it does.
Quoted 10 lines
Quoted 3 lines
Quoted 1 line
It'd also be good to see what pvscan shows, for e.g.:
pvscan -vvv outputs:
Likewise - all I can see here is hda1 - that's a type
0x83(Linux) partition, rather than the0x8e(Linux LVM) partition that we're interested in here.Can you put the complete output of vgscan -vvv and pvscan -vvv somewhere on the web and post the links here?
Here are the links:
http://java-cup.de/~wilmes/lvm/pvscan.txt
http://java-cup.de/~wilmes/lvm/vgscan.txt
Thanks again for your patience.
Martin