Benutzer-Werkzeuge

Webseiten-Werkzeuge


linux:allgemein:automount_crypted_usb

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

linux:allgemein:automount_crypted_usb [03.02.2014 20:43]
marc angelegt
linux:allgemein:automount_crypted_usb [03.02.2014 23:05] (aktuell)
marc
Zeile 109: Zeile 109:
  
 Quelle: http://michael.stapelberg.de/Artikel/automount_cryptsetup_udev Quelle: http://michael.stapelberg.de/Artikel/automount_cryptsetup_udev
 +
 +
 +
 +
 +
 +#$ cat /etc/udev/rules.d/85-usb-backup-hdd.rules
 +
 +##################################################################################
 +# rule 1: decrypt the disk once it gets plugged in
 +##################################################################################
 +
 +# matches partitions (there is precisely one) of block devices with the serial
 +# number of my backup external hard disk
 +
 +ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="NA4JJ7H9", RUN+="/sbin/cryptsetup --key-file /root/safe/Filme luksOpen $env{DEVNAME} crypt-Video"
 +
 +#ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", ATTRS{serial}=="AA00000014CB", \
 +#ACTION=="add", ATTRS{serial}=="AA00000014CB", \
 +#RUN+="/sbin/cryptsetup --key-file /root/safe/Filme luksOpen %k crypt-Filme"
 +#RUN+="echo "hallo" > /root/udev"
 +
 +##################################################################################
 +# rule 2: as soon as the crypt container is opened, mount the filesystem inside it
 +##################################################################################
 +
 +# we (also) match on change because the device name is known only after some time
 +ACTION=="add|change", SUBSYSTEM=="block", ENV{DM_NAME}=="crypt-Video", RUN+="/bin/mount /dev/mapper/$env{DM_NAME}"
 +
 +#ACTION=="add|change", SUBSYSTEM=="block", ENV{DM_NAME}=="crypt-Filme", \
 +#RUN+="/bin/mount /dev/mapper/$env{DM_NAME}"
 +
 +
 +ACTION=="add", ENV{ID_FS_UUID}=="c0e7a9cf-1b26-4fe2-a6fc-088d8cb0231d", RUN+="/sbin/cryptsetup --key-file /root/safe/Filme luksOpen /dev/disk/by-uuid/$env{ID_FS_UUID} crypt-Filme"
 +
 +#RUN+="touch /root/udev"
 +
linux/allgemein/automount_crypted_usb.1391456580.txt.gz · Zuletzt geändert: 03.02.2014 20:43 von marc