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
This commit is contained in:
2017-10-05 08:33:05 +00:00
parent e965b51c83
commit 4124eb9571

10
check
View File

@@ -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()