Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Debian Lenny server and a client with Kubuntu 10.10. The server provides some iSCSI storage. One of the devices is the /home of the Kubuntu client.

I know how to add devices to /etc/crypttab and /etc/fstab but I have no clue how to make that wait until network init and iSCSI init have finished.

Any hints highly appreciated.

share|improve this question

In the meantime I found a solution on my own. One has to make the process wait for the iSCSI device to appear. By default this makes /etc/rc.local inappropriate but wait, there's process forking!

This is my complete /etc/rc.local and it works nice. When the graphical login manager appears it still takes 1-2 seconds for the filesystem to be mounted, so don't type in your password too fast.

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

(
        # wait for mount device to appear
        until [ -e /dev/mapper/iscsi_crypt ]
        do
                sleep 1s
        done

        # try to mount once and exit
        mount /home
        exit $?
)&

exit 0
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .