From 4124eb95711bbe1ef4c42bf5df561c22f1572422 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 5 Oct 2017 08:33:05 +0000 Subject: [PATCH] check : if the disk is in RO and can not be pushed in RW, umount, FSCK and remount git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3980 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- check | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/check b/check index 4d049fe..9c6858f 100755 --- a/check +++ b/check @@ -256,6 +256,16 @@ function testMount() checklog "Disque $PNT en RO : Passage en RW" mount -o remount,rw $PNT fi + # The drive is again in RO : umount, fsck, and remount + ST=`egrep -v "^{none|rootfs|binfmt_misc|gvfs-fuse-daemon} " /proc/mounts | cut -d " " -f 2,4| egrep "^$PNT " | cut -d " " -f 2 | cut -d "," -f 1` + TYPE=`egrep -v "^{none|rootfs|binfmt_misc|gvfs-fuse-daemon} " /proc/mounts | cut -d " " -f 2,3,4 | egrep "^$PNT " | cut -d " " -f 2` + DISK=`egrep -v "^{none|rootfs|binfmt_misc|gvfs-fuse-daemon} " /proc/mounts | cut -d " " -f 1,2 | egrep " $PNT\$" | cut -d " " -f 1` + if [ "$ST" == "ro" ]; then + checklog "Disque $PNT toujours en RO : Démonte, FSCK et remonte" + umount $DISK + fsck.$TYPE $DISK + mount $DISK + fi } function testRepertoireVide()