Hi,
ich habe da ein kleines problem,
wenn ich eine datei mittels cryptsetup mounte, also
losetup /dev/loop0 datei
cryptsetup luksOpen /dev/loop0 xy
mount /dev/mapper/xy /mnt/crypt
in diesem falle kann ich keinen direkten shutdown machen, bzw ich kann es doch, die letzte meldung ist
/ bussy
halt
und beim nächsten neustart wird das root datei system überprüft, da es nicht richtig ausgehangen wurde.
Das selbe problem, scheint auch ab und an aufzutrteten wenn man einfach, mittels losetup etwas gemountet hat, wobei das stark vom dateisystem abhängt, und auch wenn man den swap speicher, mittels losetup mal vergrößert hat.
Meine Idee war jetzt dieses script zu verwenden und automatisch mit in den shutdown prozess einzubeziehen, prinzipiel scheint es auch zu funktionieren, nur gibt es halt ne menge fehlermeldungen aus, da es nicht überprüft ob die dinge wirklich gemountet sind oder ob ein loop device wirklich benutzt wird.
So jetzt zu meiner frage kann dieses script irgendwie schädlich sein, oder kann ich es einfach mit als praktisch letztes laufen lassen (S49)
System ist ein aktuelles ubuntu 64bit.
gruß
robinx99
und hier noch das script
--------------------------
#!/bin/bash
for f in /dev/mapper/* ;
do
umount $f;
done;
for f in /dev/loop* ;
do
umount $f;
done;
swapoff -a
for f in /dev/mapper/* ;
do
cryptsetup luksClose $f;
done;
for f in /dev/loop* ;
do
losetup -d $f;
done;
------------------------
Linux 15.009 Themen, 106.826 Beiträge
Ich habe bei Debian etch noch mal in den Paketquellen gesucht und auch die Pakete cryptsetup und cryptmount gefunden.
Kann es sein das du das Paket cryptmount nicht installiert hast ?
cryptmount
Management and user-mode mounting of encrypted file systems
cryptmount is a utility for creating encrypted filesystems & swap partitions
and which allows an ordinary user to mount/unmount filing systems
without requiring superuser privileges.
It offers the following features (for 2.6-series linux kernels):
* easy and safe on-demand access to filesystems without su/sudo;
* access passwords can be changed easily without involving the sys-admin;
* filesystems can reside on raw disk partitions or ordinary files;
* multiple filesystems can be stored in a single disk partition;
* includes support for encrypted swap partitions;
* temporary filesystems can be setup via command-line,
for use in shell-scripts;
* encrypted filesystems can be initialized at boot-up or on demand;
* transparent configuration of dm-crypt & loopback devices during mounting;
* encrypted access keys are compatible with OpenSSL and can be
stored separately on removable media (e.g. USB flash disks).
cryptsetup
configures encrypted block devices
Since kernel 2.6.4, encrypted filesystem support is provided by the device
mapper target dm-crypt. This utility provides a command-line interface for
configuring this facility. It has integrated support for LUKS.
cryptsetup is backwards compatible with the on-disk format of cryptoloop,
but also supports more secure formats. This package also includes support
for automatically configuring encrypted devices at boot time via the config
file /etc/crypttab. When combined with newer versions of the debian
initrd-tools and standard debian kernels, cryptoroot is also supported.
For information on how to convert your system to use encrypted filesystems
please read /usr/share/doc/cryptsetup/CryptoRoot.HowTo.
Selbst bei Debian mußt du keine Scripte schreiben um Dateisysteme automatisch zu unmounten.
Wahrscheinlich mußt du an Stelle der normalen /etc/fstab Datei die Datei /etc/crypttab editieren.
Ich habe cryptsetup noch gar nicht unter Debian installiert.
Wenn du cryptmount installiert hast, dann schau doch mal in das Verzeichnis /etc/init.d rein, ob da ein neues Shellscript installiert worden ist, um diese verschlüsselten Dateisysteme automatisch beim Herunterfahren zu unmounten.
Wahrscheinlich heißt es wie umount???.
