diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-11-18 13:43:16 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-11-18 13:43:16 -0200 |
commit | df51b9c44c30ea8a255fb7f93b4640c82fb36231 (patch) | |
tree | 20bb80f2385716b1cf6fc27b7a01a7139a5886cf | |
parent | 1c1ab7c6897562bf8af101a0c9802192088a9924 (diff) | |
download | puppet-backup-df51b9c44c30ea8a255fb7f93b4640c82fb36231.tar.gz puppet-backup-df51b9c44c30ea8a255fb7f93b4640c82fb36231.tar.bz2 |
Avoid sleep mode on volumes
-rwxr-xr-x | files/mount-media | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/files/mount-media b/files/mount-media index 28a7400..b450605 100755 --- a/files/mount-media +++ b/files/mount-media @@ -7,11 +7,12 @@ MEDIA="$1" VOLUME="$2" BASENAME="`basename $0`" +DISK="`echo ${MEDIA} | sed -e s/[0-9]\$//g`" # Check media config if [ -z "$MEDIA" ]; then echo "usage: $BASENAME <media> [volume]" - echo "example: $BASENAME magnetron sdb1" + echo "example: $BASENAME mymedia sdb1" exit 1 fi @@ -26,6 +27,7 @@ if [ "`whoami`" != 'root' ]; then fi if [ "$BASENAME" == "mount-media" ]; then + $sudo sdparm --clear STANDBY -6 /dev/$DISK $sudo cryptsetup luksOpen /dev/$VOLUME $MEDIA && \ $sudo fsck -v -y /dev/mapper/$MEDIA && \ $sudo mount /dev/mapper/$MEDIA /media/usb |