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
8 hours 57 min ago
14 hours 45 min ago
16 hours 37 min ago
18 hours 22 min ago
22 hours 12 min ago
1 day 3 hours ago
1 day 4 hours ago
1 day 8 hours ago
1 day 14 hours ago
1 day 19 hours ago