[linux-lvm] Pvmove Cannot Be Aborted
james.schatzman at futurelabusa.com
Fri Jul 6 00:12:49 UTC 2007
At 10:53 AM 7/5/2007, you wrote:
>Jim Schatzman wrote:
>> So... I have learned my lesson - never use pvmove on a bad drive.
>Your VG and LVs are not in worse shape now (after the stuck pvmove) than
>they would have been if you did not attempt the pvmove, right? I guess
>you did not use use raid on top of or under lvm?
>Richard van den Berg
Thanks for your question.
The problem is more complicated than I explained. The drive (a late model SATA device) apparently tries to automatically relocate bad sectors. The relocate invariably fails. What happens after a while is that the system log gets filled with thousands of error messages and Linux eventually disables the drive. The drive then disables itself somehow (I have not figured this out) so that if I reboot then Linux reports "soft reset failed" and disables the drive again.
When the drive is offline, Linux LVM refuses to activate the LVs on the VG (obviously) unless I use dmsetup to error out the bad drive. If I do that, the LV ends up in a "d" state ("device present without tables"). I am not sure what "tables" are meant. I am certain that there are many EXT2 superblocks on the good drives, including the first one, so that isn't it. If I had to guess, I would think that what is meant is the LVM tables.
I can power cycle the drive and computer about 20 times to get the drive to come back online (it would be helpful if I could get SATA hot-swap to work so I wouldn't have to reboot the computer but no joy even though the controller supposedly supports hot swap - maybe "hot swap" is different from "hot initial plug in"?). Then I can copy off a bit of data until the drive goes haywire again and Linux disables it. After a few days, I was able to retrieve all the good data I was going to get.
What would have saved me a lot of time is to have been able to mount the LV filesystems without the bad drive via the dmsetup mechanism. That did not work. My guess is that this is due to my executing "pvmove" in a vain attempt to replace the bad drive without having to rebuild the VG from scratch. Once the pvmove failed, I was hosed, apparently. No going forward and no going back.
More information about the linux-lvm