https://access.redhat.com/solutions/3889
How can I mount iSCSI devices in /etc/fstab at boot time in RHEL?
SOLUTION 已验证 - 已更新 2017年三月30日11:19 -
环境
- Red Hat Enterprise Linux 3
- Red Hat Enterprise Linux 4
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- iSCSI devices
问题
- How to mount iSCSI devices at boot time?
- Logical Volumes residing on my iSCSI devices are not activated after booting
- iSCSI volumes are not getting mounted after rebooting system
- After reboot iSCSI LVM volumes does not appear/visible and
lvs
status is offline. - SAN based FS not auto mounting after reboot.
决议
-
To mount iSCSI LUNs in
/etc/fstab
, add_netdev
to the mount options near the end of the line. 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
-
Note: If the file system being mounted exists directly on the device (i.e., does not use LVM), then the use of labels as in the example above is recommended. Device ordering may change each time the iSCSI devices are presented, and either LVM or labels can ensure that the correct device is mounted.
-
The netfs service also needs to be enabled at boot time, as it is responsible for mounting devices that use _netdev:
RHEL 4, 5, 6
# chkconfig netfs on
RHEL 7
# systemctl enable remote-fs.target
转帖者注:
1.从上面来看,RHEL4、5、6下的netfs服务都等于RHEL7下的remote-fs.target
2.remote-fs.target服务对应哪些文件系统呢?目前能确定的是NFS、iscsi(IP-SAN),存疑SAN的是FC-SAN。