• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

LVM ISCSI Physical Volume Not Available After Server Reboot

by admin

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

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. quotaon command examples in Linux
  2. UNIX / Linux : What Is a Shell? What are different Shells?
  3. chrt Command Examples in Linux
  4. How to Disable Ctrl+c or Ctrl+z Using the “trap” Command in Linux
  5. gs Command Examples in Linux
  6. lvextend: command not found
  7. qm snapshot Command Examples in Linux
  8. How to move /var on a separate disk as a separate mount point (Online)
  9. Linux Network File System (NFS) interview questions
  10. nixos-option: Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright