Problem Mounting ISCSI on boot

I have an ext3 volume on a SAN and have it connected via ISCSI, and I can’t get the system to boot if I have it configured in my fstab. I’ve found suggestions to use the _netdev option or the hotplug option, but neither of those seem to work. I also tried the noauto option, and the system still tried to mount the ISCSI device. The only way I’ve been able to get the system to boot is to comment out the ISCSI device from the fstab, then manually mount the volume after the system boots up.

Any Ideas?

Hmm, I have configured a system with a fiber-channel disk and specified _netdev and it did not try to mount it until the network came up. In what order are you specifying the options on your fstab line? Remember that options after override options before. So if you write:

noauto,defaults

that cancels the noauto, since defaults implies auto. So you should write

defaults,noauto

I guess I didn’t provide all the info I had. First I’m running opensuse 11.1 (was 11.0 until last night when I upgraded to 11.1), and the rumors I’ve come across while searching say that the _netdev option doesn’t work in opensuse after version 10.3.

I removed the entry from the /etc/fstab, and then re-created it via yast, and ended up with

UUID=e12082c9-bb93-4f6a-ba2b-2b5a045bcc12 /var/log/rc-mars ext3 acl,_netdev 0 0

Now it doesn’t cause the system to hang on bootup, but it still doesn’t auto mount on bootup. arg

Have you looked in the log files to see if there are any messages when disks are mounted? /var/log/boot.msg and /var/log/messages.

It’s nofail, not _netdev.

And that’s even documented in the manpage.

I have the same problem described above and was trying _netdev. The ‘nofail’ option worked a treat to allow the machine to boot. However the luns still won’t mount on startup. Below is an extract of boot.msg. The 5 uuid lines are the luns I am trying to mount


Mounting root /dev/disk/by-id/scsi-36001c230d599f6000ee32d2e7cc1bbb3-part5

Activating device mapper…done
Waiting for /dev/disk/by-uuid/2a826ad8-69cb-4635-bc3b-5fd8d53fee8a
/dev/disk/by-uuid/92a94d32-eff0-4ec8-b51a-fa894737c61e
/dev/disk/by-uuid/79922f76-a3b4-4aed-89eb-813e1e73f8dd
/dev/disk/by-uuid/af35e456-5750-4e3a-8c49-b9fbe1c7efa4
/dev/disk/by-uuid/6ff783a1-407e-477e-bdc6-50f3a9758018 . no more events
Checking file systems…done
Mounting local file systems…

Activating remaining swap-devices in /etc/fstab…
Setting up loopback interface lo
lo IP address: 127.0.0.1/8 done
System Boot Control: The system has been set up
Skipped features: boot.open-iscsi boot.md boot.cycle

INIT: Entering runlevel: 3
Setting up (localfs) network interfaces:
lo IP address: 127.0.0.1/8
done eth0 device: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
eth0 IP address: 172.22.1.105/24
eth0
done eth1 device: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06)
eth1 IP address: 172.22.2.105/24
<notice>checkproc: /usr/sbin/nmbd 3468
bond0 enslaved interface: eth3
bond0 enslaved interface: eth2
bond0 IP address: 192.168.0.5/24 as bonding master
doneSetting up service (localfs) network . . . . . . . . . .done
Mount CIFS File Systems unused
Not starting NFS client services - no NFS found in /etc/fstab:unused
<notice>startproc: execve (/sbin/iscsid) /sbin/iscsid -c /etc/iscsi/iscsid.conf -n ], CONSOLE=/dev/console ROOTFS_FSTYPE=ext3 SHELL=/bin/sh TERM=linux ROOTFS_FSCK=0 LC_ALL=POSIX INIT_VERSION=sysvinit-2.86 REDIRECT=/dev/tty1 COLUMNS=124 PATH=/bin:/sbin:/usr/bin:/usr/sbin vga=0x317 DO_CONFIRM= RUNLEVEL=3 PWD=/ SPLASHCFG=/etc/bootsplash/themes/openSUSE/config/bootsplash-1024x768.cfg PREVLEVEL=N LINES=44 HOME=/ SHLVL=2 splash=silent SPLASH=yes ROOTFS_BLKDEV=/dev/disk/by-id/scsi-36001c230d599f6000ee32d2e7cc1bbb3-part5 _=/sbin/startproc DAEMON=/sbin/iscsid ]
Starting multipathd done
Starting iSCSI initiator service: done
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.a0, portal: 172.22.1.150,3260]
Logging in to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.b1, portal: 172.22.2.151,3260]
Logging in to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.b0, portal: 172.22.1.151,3260]
Logging in to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.a1, portal: 172.22.2.150,3260]
Login to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.a0, portal: 172.22.1.150,3260]: successful
Login to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.b1, portal: 172.22.2.151,3260]: successful
Login to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.b0, portal: 172.22.1.151,3260]: successful
Login to [iface: default, target: iqn.1992-04.com.emc:ax.fcnpr063600892.a1, portal: 172.22.2.150,3260]: successful
done
Setting up (remotefs) network interfaces:
Setting up service (remotefs) network . . . . . . . . . .done
Master Resource Control: runlevel 3 has been reached

I just need the mount to happen after the iscsi targets are logged into. The errors I get in /var/log/messages are:

Jun 16 11:47:11 ds0 kernel: end_request: I/O error, dev sdf, sector 0
Jun 16 11:47:11 ds0 kernel: scsi 6:0:0:3: Direct-Access DGC RAID 5 0220 PQ: 0 ANSI: 4
Jun 16 11:47:11 ds0 kernel: sd 8:0:0:3: [sdm] Write Protect is off
Jun 16 11:47:11 ds0 kernel: sd 8:0:0:3: [sdm] Mode Sense: 7d 00 00 08
Jun 16 11:47:11 ds0 kernel: sd 5:0:0:2: [sdn] Write Protect is off
Jun 16 11:47:11 ds0 kernel: sd 5:0:0:2: [sdn] Mode Sense: 7d 00 00 08
Jun 16 11:47:11 ds0 kernel: sd 8:0:0:0: [sdf] Device not ready: Sense Key : Not Ready [current]
Jun 16 11:47:12 ds0 kernel: sd 8:0:0:0: [sdf] Device not ready: Add. Sense: Logical unit not ready, manual intervention required

My understanding on opensuse 11.1 is that the _netdev doesn’t work (its supposed to make it wait until the network is up) but you also have to wait for open-iscsi to initiate and connect anyway.

There doesn’t appear to be a provided solution at the moment so I have created a new init script that checks the file system first and then mounts the drive(s).

Its a hack of the boot.localfs init script. Its ugly and the fsck target is hardcoded but it does what it is supposed to.

If you copy it to /etc/init.d and then do chkconfig sanload on it will work (or does for me).

I’ll append it and if anyone can make suggestions on how to improve - great.
#! /bin/sh

/etc/init.d/sanload

BEGIN INIT INFO

Provides: sanload

Required-Start: $network $open-iscsi

Required-Stop: $network $open-iscsi

Default-Start: 3 5

deafault-Stop: 0 1 2 6

Short-Description: check and mount san filesystems

Description: check and mount san filesystems

END INIT INFO

. /etc/rc.status

to get max number of parallel fsck processes

. /etc/sysconfig/boot
. /etc/sysconfig/kernel
. /etc/sysconfig/sysctl

test -z “$REDIRECT” && REDIRECT="$(showconsole 2>/dev/null)"
export REDIRECT
export FSCK_MAX_INST

Special file systems (memory and network based)

typeset -r nomnt=autofs,bdev,rootfs,sockfs,pipefs,anon_inodefs,inotifyfs,eventpollfs,futexfs
typeset -r tmpfs=tmpfs,ramfs,hugetlbfs,mqueue
typeset -r netfs=nfs,nfs4,smbfs,cifs,afs,ncpfs

tmp=""
while read tag name rest ; do
test “$tag” = “nodev” || continue
“$name” =~ ^(${nomnt//,/|})$ ]] && continue
“$name” =~ ^(${tmpfs//,/|})$ ]] && continue
“$name” =~ ^(${netfs//,/|})$ ]] && continue
tmp=${tmp:+$tmp,}$name
done < /proc/filesystems

typeset -r memfs=$tmp
typeset -r mntfs=$tmpfs,$memfs
typeset -r nofs=no${netfs//,/,no},no${memfs//,/,no}

unset tmp name rest

rc_reset

case “$1” in
start)
#
MAY_FSCK=1
FSCK_RETURN=0
echo “Starting sanload”
if test ! -f /fastboot -a -z “$DO_FASTBOOT” -a $MAY_FSCK -eq 1 ; then
# common options for file system check
FSCK_OPTS="-R -M -a"
# force file system check if forced
if test -f /forcefsck -o “$DO_FORCEFSCK” = “yes” ; then
FSCK_OPTS="$FSCK_OPTS -f"
fi
# If we use a serial console, don’t use the fsck progress bar
if test “$REDIRECT” = “/dev/tty1” ; then
FSCK_OPTS="$FSCK_OPTS -C"
else
FSCK_OPTS="$FSCK_OPTS -V"
fi
echo “Checking file systems…”
fsck $FSCK_OPTS /dev/disk/by-uuid/f350979f-e128-41b7-8689-ffebc3c44aa4
# A return code of 1 indicates that file system errors
# were corrected, but that the boot may proceed.
# A return code of 2 or larger indicates failure.
FSCK_RETURN=$?
test $FSCK_RETURN -lt 4
rc_status -v1 -r
if test $FSCK_RETURN -gt 1 -a $FSCK_RETURN -lt 4 ; then
# if appropriate, switch bootsplash to verbose
# mode to make text messages visible.
test -f /proc/splash && echo “verbose” > /proc/splash
echo
echo “fsck succeed, but no mount reboot is required.”
echo
# sleep 1
# sync
# reboot -f
elif test $FSCK_RETURN -gt 3; then
# if appropriate, switch bootsplash to verbose
# mode to make text messages visible.
test -f /proc/splash && echo “verbose” > /proc/splash
# Stop blogd since we reboot after sulogin
# test -x /sbin/blogd && killproc -QUIT /sbin/blogd
#if test -x /etc/init.d/kbd ; then
# /etc/init.d/kbd start
#fi
echo
echo “fsck failed for at least one filesystem (not /).”
echo “Please repair manually and reboot.”
echo “The root file system is is already mounted read-write.”
echo

    fi
    if test $FSCK_RETURN -gt 0; then
	sync
	&gt; /fsck_corrected_errors
    fi
fi

#
# clean up
#
rc_status -v -r

#
# Mount local filesystems in '/etc/fstab' (and create an entry
# for / and /proc).
#
mount -av -t $nofs -O no_netdev
rc_status -v1 -r
;;
stop)


echo "Unmounting file system"

	umount -t ext3 /dev/disk/by-uuid/f350979f-e128-41b7-8689-ffebc3c44aa4$mtab -t ext3  ;;
    esac

    rc_status -v1 -r
    rc_exit


restart)
rc_failed 3
rc_status -v
;;
status)
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;

esac

rc_exit

I forgot to mention that the drive is included in fstab with the nofail and auto options and also the dump and fsck options are both 0 i.e.

/dev/disk/by-uuid/f350979f-e128-41b7-8689-ffebc3c44aa4 /san1 ext3 nofail,auto,acl,user_xattr 0 0

Also note that fsck options are changed in the init script.