open-iscsi debian Iomega StorCenter ix4-200d

Written by Peter Davies on .

We use an office NAS device (Iomega StorCenter ix4-200d) as an iSCSI volume for a number of internal Debian development boxes. Sometimes we notice that the connection between the machines is lost (or disrupted in some manner) and it causes Apache to lose the associated virtualhosts.

The complication is telling the Debian O/S that the volume is no longer in use as quite often there are a number of files still open. First step is to stop all running services that might prevent the re-mapping of the open-iscsi service:

/etc/init.d/apache2 stop
/etc/init.d/samba stop
/etc/init.d/open-iscsi stop

Then you can use the linux command lsof (list of open files) to see any home related open files (the home folder in this case is the mapped iSCSI volume):

lsof | grep "home"

If nothing is open you can quite reliabily start the services again in the reverse order:

/etc/init.d/open-iscsi start
/etc/init.d/samba start
/etc/init.d/apache2 start