Add new comment
|
This is exactly what I wanted (my USB drives are crypted in case they are stolen but as long they are on the server, I don't care), but I had an issue on Fedora with USB drives. At boot time /etc/rc.d/rd.sysinit should use fstab and crypttab to issue a luksOpen. The issue is that at that time the usb drive is not yet detected in /dev/disk/by-uuid. The only solution I found here so far, is to add a delay before using cryptsetup. For that I have created a module (/etc/sysconfig/modules/waitForExtraDrives.modules) that wait for extra disk(s) with a timeout of 10s. This module will be run automatically by /etc/rc.d/rd.sysinit before trying to mount crypted drives (TBD: We should find an other solution !): /etc/sysconfig/modules/waitForExtraDrives.modules: #!/bin/sh
timeout=10
nbInternalDrives=1
echo -n "Waiting for extra disk(s) to be detected: "
count=0
while [ $(ls /dev/disk/by-uuid/ 2>/dev/null | wc -l) -le ${nbInternalDrives} -a ${count} -lt ${timeout} ]
do
count=$(( $count + 1 ))
echo -n "."
sleep 1
done
if [ $(ls /dev/disk/by-uuid/ 2>/dev/null | wc -l) -gt ${nbInternalDrives} ]
then
echo " Done"
else
echo " TimeOut"
fi
Reply |





Recent comments
3 hours 4 min ago
4 hours 47 min ago
7 hours 13 min ago
7 hours 19 min ago
11 hours 53 min ago
13 hours 53 min ago
17 hours 17 min ago
19 hours 24 min ago
19 hours 35 min ago
22 hours 1 min ago