LVM partitions not getting mounted at boot time

Kernels & Hardware, configuring network, installing services

LVM partitions not getting mounted at boot time

Postby kladizkov » 2010-04-18 06:10

Hi,

I have two partitions in LVM. They are added in /etc/fstab to mount automatically. But, they are not working. The process to mount partitions seems to be happening before the service /etc/init.d/lvm2 is started. I can get it mounted using "mount -a" command, but not during the boot time.

What should I do get it automatically mounted on every boot? Please help!
User avatar
kladizkov
 
Posts: 35
Joined: 2007-07-21 04:39

Re: LVM partitions not getting mounted at boot time

Postby bugsbunny » 2010-04-18 15:39

try adding dm-mod to /etc/modules
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: LVM partitions not getting mounted at boot time

Postby kladizkov » 2010-04-20 04:25

Hi,

try adding dm-mod to /etc/modules


The module is getting loaded. But, the LVM logical volumes are not getting mounted automatically at boot time. Is it something related to udev issue?
User avatar
kladizkov
 
Posts: 35
Joined: 2007-07-21 04:39

Re: LVM partitions not getting mounted at boot time

Postby bugsbunny » 2010-04-20 10:53

OK - when fstab gets mounted the lvm daemon (/etc/init.d/lvm2) hasn't started yet. The easiest way to fix this would be to place a mount command (mount -a should do the trick) into /etc/local.

Are you running lenny or squeeze? I'm running squeeze and concurrent boot processing. lvm2 includes the following:
Code: Select all
### BEGIN INIT INFO
# Provides:          lvm2 lvm
# Required-Start:    mountdevsubfs udev
# Required-Stop:
# Should-Start:      mdadm-raid cryptdisks-early multipath-tools-boot
# Should-Stop:       umountroot mdadm-raid
# X-Start-Before:    checkfs mountall
# X-Stop-After:      umountfs
# Default-Start:     S
# Default-Stop:      0 6
### END INIT INFO
Note the "X-Start-Before:" line which ensures that lvm2 runs before mountall, which is where all the local file systems get mounted. All this assumes that you're using squeeze's default boot processing methods.

You can go and check (in /etc/rcS.d and see when lvm2 is being started in relation to mountall. On my system it's S11lvm2 and S14mountall.sh
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: LVM partitions not getting mounted at boot time

Postby kladizkov » 2010-04-20 18:06

Hi,

The workaround that you said will work for me.

I'm running lenny. This is how my lvm2 looks like.

Code: Select all
### BEGIN INIT INFO
# Provides:          lvm2 lvm
# Required-Start:    mountdevsubfs
# Required-Stop:
# Should-Start:      udev devfsd raid2 mdadm cryptdisks-early
# Should-Stop:       reboot halt umountroot
# X-Start-Before:    checkfs mountall
# X-Stop-after:      umountfs
# Default-Start:     S
# Default-Stop:      0 6
### END INIT INFO
User avatar
kladizkov
 
Posts: 35
Joined: 2007-07-21 04:39

Re: LVM partitions not getting mounted at boot time

Postby bugsbunny » 2010-04-20 23:10

place a mount command (mount -a should do the trick) into /etc/rc.local


oops - typo on my part. Correction in the above line
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04


Return to System configuration

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable