Operating System - Linux
1752701 Members
6460 Online
108789 Solutions
New Discussion юеВ

right way of mounting the iSCSI LUNS automatically ?

 
SOLVED
Go to solution
Maaz
Valued Contributor

right way of mounting the iSCSI LUNS automatically ?

OS: SLES 10 SP2

ISSUE
-------
iSCSI LUNS are only available/accessible/visible to the system when system has entered in the runlevel(2/3/5), and when the "network", and "iSCSI initiator" services starts.

I found that iSCSI initiator service(/etc/init.d/open-iscsi) does not read the /etc/fstab file (smbfs and nfs both reads the /etc/fstab, to mount the shares), thats why I come to the point/conclusion that iSCSI LUNS cant be mounted by providing their information in /etc/fstab(as we use to do in case of local/smb/nfs storages/shares).

QUESTION
-----------
whats the right/proper way of mounting the iSCSI LUNS automatically ?

SOLUTION
----------
My own Dirty Solution.

1, put the iSCSI LUNS information in fstab
vi /etc/fstab
/dev/disk/by-path/ip-192.168.0.206:3260-iscsi-iqn.2009-03.com.test:0ad96cc0-32f7-4804-a73c-11505b43db90-lun-0-part1 /ap_logs reiserfs rw 0 0
/dev/disk/by-path/ip-192.168.0.206:3260-iscsi-iqn.2009-03.com.test:f3b18583-2e34-470d-8993-96a36217d711-lun-0-part1 /db_logs reiserfs rw 0 0
/dev/disk/by-path/ip-192.168.0.206:3260-iscsi-iqn.2009-03.com.test:cb6ca23d-0ca2-40df-bfb3-feccbe8bfd6b-lun-0-part1 /ora reiserfs rw 0 0


then append "mount -a" in the "iSCSI initiator Service" script(/etc/init.d/mountfs)

vi /etc/init.d/open-iscsi
.
.
.
case "$1" in
start)
.
.
.
.
mount -a ## this is the dirty trick
;;
case "$1" in
stop)
.
.
.


Help/Guide me
Thanks and Regards
2 REPLIES 2
smatador
Honored Contributor
Solution

Re: right way of mounting the iSCSI LUNS automatically ?

Maaz
Valued Contributor

Re: right way of mounting the iSCSI LUNS automatically ?

Hi smatador, thanks for such a excellent/superb/nice help ;)

if we mount the iSCSI LUNS via fstab(as describe in the url you post), then will they unmount properly ?

what happen is that, open-iscsi and network services stops first, then in very last system tries to unmount the storage devices(including the iSCSI LUNs).

so my question is during system shutdown when open-iscsi stops, does the luns available to unmount properly ?

I did a small test

while the iSCSI LUNs are mounted, I manually stops the open-iscsi
# /etc/init.d/open-iscsi stop
Closing all iSCSI connections: Logging out of session [sid: 1, target: iqn.2009-03.net.test:45f77e65-ce05-466b-a5d5-5457f6ed0398, portal: 192.168.0.6,3260]
Logging out of session [sid: 2, target: iqn.2009-03.net.test:3674d885-0b1e-4e30-a4bd-378e38fb1a93, portal: 192.168.0.6,3260]
Logout of [sid: 1, target: iqn.2009-03.net.test:45f77e65-ce05-466b-a5d5-5457f6ed0398, portal: 192.168.0.6,3260]: successful
Logout of [sid: 2, target:
done

Stopping iSCSI initiator service: FATAL: Module iscsi_tcp is in use.


"cat /proc/mounts" still shows LUNs are mounted

/data is the mount point

ls /data/
/bin/ls: reading directory /data/: Input/output error