Améliore le script pour afficher le pourcentage de blocs réservés
This commit is contained in:
parent
d585f16198
commit
c467872888
|
@ -127,7 +127,7 @@ Pour connaître le pourcentage de blocs réservés, il faut faire le calcul à l
|
|||
|
||||
~~~
|
||||
mount_point="/home"
|
||||
dev=$(findmnt | grep "$mount_point" | head -n1 | awk '{ print $2 }')
|
||||
dev=$(findmnt --noheadings "$mount_point" | head -n1 | awk '{ print $2 }')
|
||||
blocs=$(tune2fs -l "$dev" | grep "Block count" | cut -d':' -f2 | xargs)
|
||||
reserved_blocs=$(tune2fs -l "$dev" | grep "Reserved block count" | cut -d':' -f2 | xargs)
|
||||
LC_NUMERIC="en_US.UTF-8" printf "Reserved blocs: %.0f%%\n" $(echo "scale=2; 100 * $reserved_blocs / $blocs" | bc)
|
||||
|
|
Loading…
Reference in a new issue