Problem 1
After a reboot the LVM volumes located on iscsi disks are not activated. Manually activating with “lvchange -ay” works fine.
Using the _netdev option in /etc/fstab
LVM is started before network initialisation is complete, thus the iscsi disks are not detected by the OS. Use the “_netdev” mount option to instruct the system to delay the mount attempt until network initialisation is complete. Properly formatted /etc/fstab lines for two different iSCSI mount points are shown below:
#device mount point FS Options Backup fsck LABEL=data1 /mnt/data1 ext3 _netdev 0 0 LABEL=data2 /mnt/data2 ext3 _netdev 0 0
Problem 2
ISCSI volumes cannott be mounted automatically after reboot in CentOS/RHEL. As you can see below, even the _netdev mounting option has been set on /etc/fstab:
# vi /etc/fstab LABEL=data /data ext4 _netdev 1 2
FIlesystem fails to get mounted booting by default. Manually mount the device failed with error below:
# mount /dev/mapper/vg_datavg-lv_data /data mount: you must specify the filesystem type
Enabling “netfs” service
The netfs service is responsible for mounting the network-related file systems listed in /etc/fstab (NFS, iSCSI, SMBFS/CIFS, NCP, or any line with “_netdev” option) AFTER the system starts the network. If this service is not started at boot time, the network-related file systems are not mounted. The netfs service is disabled be default for the normal runlevels 3 and 5:
$ chkconfig --list netfs netfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Without the netfs service running, ‘_netdev’ in /etc/fstab is ignored. Thus to make iscsi volume to use the “_netdev” option, Set the netfs service to be started automatically on the next boot:
For RHEL/CentOS 4,5,6
# chkconfig netfs on
For RHEL/CentOS 7
# systemctl enable remote-fs.target