DanRoche - Thank you *SO* much for posting this script! It has solved an irritating problem with OpenFiler that has plagued me.
As you suggest, it would be better to mount according to entries in /etc/fstab. I took your script and just replaced the mount/umount commands with: *mount -f $(cat fstab | grep _netdev | cut -d " " -f 2)* *umount -f $(cat fstab | grep _netdev | cut -d " " -f 2)* On Monday, April 3, 2006 11:36:14 AM UTC-5, DanRoche wrote: > > Hello, > > i am using open-iscsi-1.0-485 with fedora 4. > it works well, but i have problem if i want to mount > automatically iscsi volume at boot time, > and similarly to umount automatically at shutdown. > > the problem is that iscsi volume are seen as standard scsi > disk, and the system try to mount them before iscsid is started > and similarly to umount after iscsid is down. > > i solve the problem by creating a startup script to mount and umount > iscsi volume at the right time, for this if have set the noauto flag > in > fstab. > > I am sure man can find a better solution, but meanwhile > it is easy to setup and it works. > > here is the iscsi-volume script : > ------------------cut here ----------------------------- > #!/bin/sh > # > # chkconfig: - 99 01 > # description: Mount / Umount iSCSI volume > # > > # > # iSCSI volume are seen like standard scsi disk > # the rc scripts try to mount them early > # BEFORE iscsi is up, > # and more problematic, when shutdowning it try > # to umount after network is down -> crash > # > # one solution is to set the noauto flag for > # iSCSI volumes on fstab and call this script > # last on boot and early on shutdown > # > > # Source function library. > if [ -f /etc/init.d/functions ] ; then > . /etc/init.d/functions > elif [ -f /etc/rc.d/init.d/functions ] ; then > . /etc/rc.d/init.d/functions > else > exit 0 > fi > > start() > { > RETVAL=0 > echo -n "Mouting iSCSI volumes: " > mount /mnt/xxxx > mount /mnt/yyyy > return $RETVAL > } > > stop() > { > RETVAL=0 > echo -n "Unmounting iSCSI volumes: " > umount /mnt/xxxx > umount /mnt/yyyy > return $RETVAL > } > > > restart() > { > stop > start > } > > case "$1" in > start) > start > ;; > stop) > stop > ;; > restart) > restart > ;; > *) > echo $"Usage: $0 {start|stop|restart}" > exit 1 > esac > > exit 0 > ------------------cut here ----------------------------- > > just put this script in /etc/init.d/iscsi-volume > and do a chkconfig -add iscsi-volume; chkconfig iscsi-volume on > > TODO: it would be better to have a way to flag iscsi volumes in > /etc/fstab > and to loop automaticaly on this list. Any idea ? > > Best Regards. > > -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To view this discussion on the web visit https://groups.google.com/d/msg/open-iscsi/-/DpkKpCjFvssJ. To post to this group, send email to open-iscsi@googlegroups.com. To unsubscribe from this group, send email to open-iscsi+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.