[SOLVED] LVM volume iSCSI not active on boot

Issues related to applications and software problems

[SOLVED] LVM volume iSCSI not active on boot

Postby bchand » 2012/01/22 23:48:05

All

I am having some trouble on getting a LVM volume that is hosted on a iSCSI target to mount on boot. Trying to figure out why that would be.

On the iSCSI initiator side, I took the block device that was created /dev/sdb and then created a partition /dev/sdb1

using /dev/sdb1 i did the following commands


pvcreate /dev/sdb1
vgcreate -s 16M vg_mysql /dev/sdb1
lvcreate -L 18G -n lv_mysql vg_mysql
mkfs.ext4 /dev/vg_mysql/lv_mysql
Added the following line to /etc/fstab
/dev/vg_mysql/lv_mysql /var/lib/mysql ext4 defaults 0 0
mount /var/lib/mysql/


Everything mounted correctly and I was able to read and write to the filesystem.

I went to reboot the server and the filesystem did not mount. Trying to figure out why that would be.

on reboot here is the output of vgscan on lvscan


[root@shard1db1 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_mysql" using metadata type lvm2
Found volume group "vg_shard1db1" using metadata type lvm2
[root@shard1db1 ~]# lvscan
inactive '/dev/vg_mysql/lv_mysql' [18.00 GiB] inherit
ACTIVE '/dev/vg_shard1db1/lv_root' [17.54 GiB] inherit
ACTIVE '/dev/vg_shard1db1/lv_swap' [1.97 GiB] inherit


I was able to get the LV active again by doing the following command.
lvm vgchange -a y vg_mysql

Then I was able to mount again with no issue. However, the exact same issue occurs again upon reboot.

Anyone have any suggestions on how to get this iSCSI LVM volume to mount on startup.

here is a dump of my boot.log.


Welcome to CentOS
Starting udev: [ OK ]
Setting hostname shard1db1: [ OK ]
Setting up Logical Volume Management: 2 logical volume(s) in volume group "vg_shard1db1" now active
[ OK ]
Checking filesystems
/dev/mapper/vg_shard1db1-lv_root: clean, 35334/1150560 files, 466003/4597760 blocks
/dev/sda1: clean, 44/128016 files, 68360/512000 blocks
[ OK ]
Remounting root filesystem in read-write mode: [ OK ]
Mounting local filesystems: mount: special device /dev/vg_mysql/lv_mysql does not exist
[FAILED]
Enabling /etc/fstab swaps: [ OK ]
Entering non-interactive startup
Starting monitoring for VG vg_shard1db1: 2 logical volume(s) in volume group "vg_shard1db1" monitored
[ OK ]
Starting iscsid: [ OK ]
ip6tables: Applying firewall rules: [ OK ]
iptables: Applying firewall rules: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Starting auditd: [ OK ]
Starting system logger: [ OK ]
Starting iscsi: [ OK ]
Starting system message bus: [ OK ]
Mounting other filesystems: mount: special device /dev/vg_mysql/lv_mysql does not exist
[FAILED]
Retrigger failed udev events [ OK ]
Starting sshd: [ OK ]
Starting rwho services: [ OK ]
Starting postfix: [ OK ]
Starting Qpid AMQP daemon: [ OK ]
Starting crond: [ OK ]


Any ideas are more than welcome.

Thanks
Brian
bchand
 
Posts: 16
Joined: 2012/01/02 18:55:39

Re: LVM volume iSCSI not active on boot

Postby bchand » 2012/01/24 01:17:23

Bumping

Fiddled with this issue off and on throughout the day.

I imagine i could sidestep the issue by not using /etc/fstab and place the appropriate commands in rc.local. However, that seems to go against the grain.

Please any thoughts on this matter would be most welcome.

Thanks
Brian
bchand
 
Posts: 16
Joined: 2012/01/02 18:55:39

Re: LVM volume iSCSI not active on boot

Postby bchand » 2012/01/24 02:53:33

Solved!

to overcome this you need to put _netdev option in /etc/fstab like thus


/dev/vg_mysql_data/lv_mysql_data /var/lib/mysql ext4 _netdev 0 0


then it survives a reboot ( assuming the SAN is operational of course )

Please mark this as resolved.
Brian
bchand
 
Posts: 16
Joined: 2012/01/02 18:55:39

[SOLVED] LVM volume iSCSI not active on boot

Postby pschaff » 2012/01/24 18:25:21

Done. Thanks for reporting back.
pschaff
Retired Moderator
 
Posts: 18277
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America


Return to CentOS 6 - Software Support

Who is online

Users browsing this forum: No registered users and 6 guests