LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   LVM not finding VG during boot (http://www.linuxquestions.org/questions/linux-software-2/lvm-not-finding-vg-during-boot-4175461700/)

Rearden888 05-13-2013 02:01 AM

LVM not finding VG during boot
 
I'll start out with some background. I have two external USB hard drives I'm using in an LVM span volume group. I recently moved it from one computer to another. I deactivated and exported the VG from the old machine (debian 6.0) and imported and reactivated it with no issues on the new machine (Crunchbang waldorf), was able to mount and access the drive normally.

However, when I reboot the new computer, during boot, it fails while trying to run fsck on the LVM VG, and drops me to a root command prompt. While booting, I see the normal messages for the kernel assuming write-through on the drive, but then lots of errors like this:

Code:

sd 12:0:0:0: [sdb] Unhandled error code
sd 12:0:0:0: [sdb] 
Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
sd 12:0:0:0: [sdb] CDB:
Read(10): 28 00 e8 e0 88 00 00 00 08 00
end_request: I/O error, dev sdb, sector 3907028992
Buffer I/O error on device sdb, logical block 3907028992
Buffer I/O error on device sdb, logical block 3907028993
Buffer I/O error on device sdb, logical block 3907028994
Buffer I/O error on device sdb, logical block 3907028995
Buffer I/O error on device sdb, logical block 3907028996
Buffer I/O error on device sdb, logical block 3907028997
Buffer I/O error on device sdb, logical block 3907028998
Buffer I/O error on device sdb, logical block 3907028999

After that, when LVM runs in the normal init process, it fails to find any volume groups, and consequently, fsck fails when trying to mount that VG. However, when it drops me to the prompt, I can run
vgscan -ay
and it finds and maps the VG correctly immediately. I'm then able to check it and mount it with no issues. I've run fsck on it multiple times and it always comes back clean.

Has anyone seen anything similar to this with USB drives and LVM before? I never saw any problem with this on the old machine it was attached to. Thanks for any help you can give me.

haertig 05-13-2013 10:16 PM

Is your root filesystem on these external LVM drives? I'm not sure if you are trying to explain a boot problem, or a mount problem after boot.

Rearden888 05-14-2013 02:07 AM

Sorry that wasn't clear. No, it's not my boot drive, that's stored on a regular SSD plugged in to the motherboard. The reason it's interrupting the boot process is because when the lvm start-up script fails to find the drives (because both are experiencing those read errors) fsck fails to check the drive because it's nonexistent.

On another note, I've found a workable solution. Every time the machine starts up, the drives seem to come online, fail and go offline from the read errors in the log snippet, and then come back up and work properly.

Since it just appears to be a short duration problem, I was able to put a "sleep 10" in the lvm startup script which gives the drives time to go through their apparently normal process of failing before coming online fully, after which the LVM initscript works normally. For now, it seems to be working, I'll just have to investigate if there is a problem with those particular drives models. Thanks.


All times are GMT -5. The time now is 04:42 PM.