Wie man ein LUKS-verschlüsseltes iSCSI-Gerät beim Booten automatisch einbindet

1781
daniel

Ich habe einen Debian-Lenny-Server und einen Client mit Kubuntu 10.10. Der Server bietet einen gewissen iSCSI-Speicher. Eines der Geräte ist das /homedes Kubuntu-Clients.

Ich weiß, wie Geräte hinzugefügt werden, /etc/crypttabund /etc/fstabich habe keine Ahnung, wie ich warten soll, bis Netzwerk-Init und iSCSI-Init abgeschlossen sind.

Irgendwelche Hinweise sehr geschätzt.

1

1 Antwort auf die Frage

1
Daniel

Inzwischen habe ich selbst eine Lösung gefunden. Der Prozess muss warten, bis das iSCSI-Gerät angezeigt wird. Standardmäßig ist dies /etc/rc.localunangemessen, aber warten Sie, da ist der Prozess forking!

Dies ist meine komplette /etc/rc.localund es funktioniert gut. Wenn der grafische Anmeldungsmanager angezeigt wird, dauert es noch 1-2 Sekunden, bis das Dateisystem eingehängt ist. Geben Sie das Kennwort daher nicht zu schnell ein.

#!/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