grub2 (grub-pc) intermittent problems mounting LVM partitions on bootup
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
grub2 (grub-pc) intermittent problems mounting LVM partitions on bootup
Background:
I am in the process of migrating from grub-legacy to grub2, and have been customizing to the appropriate config files (in the /etc directory). I seem to have an intermittent problem with grub-pc on system boot.
Symptoms:
*: *sometimes* I get errors when the boot process attempts to mount my LVM partitions:
fsck.ext3: ... no such file or directory while trying to open /dev/mapper/blahblahblah ... the superblock could not be read or does not describe a correct ext2 filesystem
*: These errors only show for *all* LVM partitions on my external USB drives, and nothing in the /etc/fstab file is mounted other than the "/" directory.
*: Hence, I am left with the root of my system directory tree, and not much else.
*: This set of errors occurs intermittently when chainloading through grub2 (grub-pc), and never when booting via grub-legacy.
*: When this does occur, I can reboot immediately via grub2 or grub-legacy and not have any errors on reboot.
*: The filesystems in question are not, as the error suggests, corrupted, hosed, or otherwise borked.
WTF???
Further Info:
In grub, root is set at (hd0,1)
The error messages, as I've said, only refer to the logical volumes on the external drives, not on any of the internal drives.
Problem:
Since my /var filesystem is on an LVM logical volume that doesn't get mounted when this error occurs, I don't have anything in /var/log concerning this error.
I recently upgraded to grub2, but haven't completed the transition from grub-legacy to grub2. So, until I execute "upgrade-from-grub-legacy", grub2 chainloads from grub-legacy. And I am not going to complete the upgrade until I know why this intermittent error occurs.
Concerning item #4:
I've got 23 logical volumes in two logical groups spanning 6 physical disk drives (2 of which are the external USB drives that seem to be connected to the error). /var just happens to be one of these volumes/partitions.
Concerning item #3:
I've noticed that I do not have a insmod lvm line in there.
However, since I don't get this error all the time, I would imagine that the error is not inherent in my grub2 config files, else I would get the error all the time.
I would guess that it has something to do with the lag due to the spin-up of the external drives.
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set default=0
insmod lvm
insmod ext2
set root=(LVM-group-usr)
search --no-floppy --fs-uuid --set 7103ee36-0157-4192-be6d-70e23f96ece5
if loadfont /share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 1ec43e3d-1338-4176-a901-2ca438e11c53
insmod png
if background_image /grub/moreblue-orbit-grub.png ; then
set color_normal=black/black
set color_highlight=magenta/black
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, Linux 2.6.30-k8-20091009" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 1ec43e3d-1338-4176-a901-2ca438e11c53
linux /vmlinuz-2.6.30-k8-20091009 root=UUID=44b15f72-38f5-4f2b-9890-57709b0c7a87 ro vga=773
initrd /initrd.img-2.6.30-k8-20091009
}
menuentry "Debian GNU/Linux, Linux 2.6.30-k8-20091009 (recovery mode)" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 1ec43e3d-1338-4176-a901-2ca438e11c53
linux /vmlinuz-2.6.30-k8-20091009 root=UUID=44b15f72-38f5-4f2b-9890-57709b0c7a87 ro single vga=773
initrd /initrd.img-2.6.30-k8-20091009
}
menuentry "Debian GNU/Linux, Linux 2.6.30-2-686" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 1ec43e3d-1338-4176-a901-2ca438e11c53
linux /vmlinuz-2.6.30-2-686 root=UUID=44b15f72-38f5-4f2b-9890-57709b0c7a87 ro vga=773
initrd /initrd.img-2.6.30-2-686
}
menuentry "Debian GNU/Linux, Linux 2.6.30-2-686 (recovery mode)" {
insmod ext2
set root=(hd0,1)
search --no-floppy --fs-uuid --set 1ec43e3d-1338-4176-a901-2ca438e11c53
linux /vmlinuz-2.6.30-2-686 root=UUID=44b15f72-38f5-4f2b-9890-57709b0c7a87 ro single vga=773
initrd /initrd.img-2.6.30-2-686
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
I've been rebooting frequently in order to tweak the grub2 configuration, and the error appears about 5% of the time.
It's the intermittent nature of the error that bothers me.
Rebooting and having it "just work" is soooo.... MiCrOsOfT....
If the error were present all the time, I'd be... well... less concerned.
I'll keep an eye out for someone else with this error, and maybe I'll bite the bullet and finish the transition to grub2 and deal with it. I *do* run some packages from the unstable branch, so this sort of thing is, of course, something I'm willing to deal with.
My updated kludge has the /etc/fstab set up as normal (no commented lines) and I have entered a script in /etc/rcS.d/ that runs first (named 00kludge) the script starts the udev and lvm2 services before anything else happens. I've tested it successfully with 5 reboots and it seems to be working as it should.
Given this, I would think that it's an init script problem.
I have to consider which of the following options I'm going to try:
*: Keep the kludge, as it seems to be working fine.
*: Rename the appropriate init scripts to make certain that udev and lvm2 are started earlier in the boot sequence.
*: Use an init system other than sysV.
Last edited by kevinbenko; 11-03-2009 at 11:06 PM.
Reason: fixed a typo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.