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
vgcreate -s 16M vg_mysql /dev/sdb1
lvcreate -L 18G -n lv_mysql vg_mysql
Added the following line to /etc/fstab
/dev/vg_mysql/lv_mysql /var/lib/mysql ext4 defaults 0 0
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 ]
/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
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
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.