Created
May 17, 2023 09:24
-
-
Save growse/81dca689e44f2049a1e90a1b6c14a053 to your computer and use it in GitHub Desktop.
Keep hitting umount and fsck on a disk until it's clean.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
ext=100 | |
DEVICE=$1 | |
# Can get the devices / pvcs with this. | |
#thingies=$( mount | grep ro,|grep pvc| awk '{split($3,path,/\//); print $1 "|" path[9]}') | |
#for thingie in $thingies | |
#do | |
# IFS="|" read -r device pvc <<< $thingie | |
# echo $pvc | |
#done | |
echo $DEVICE | |
until [ $ext -lt 2 ] | |
do | |
umount $DEVICE ; fsck.ext4 -p $DEVICE | |
ext=$? | |
echo $ext | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment