Check mount count

Aus crazylinux.de
Version vom 19. Mai 2008, 22:02 Uhr von Jonathan (Diskussion | Beiträge) (typo)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Wer kennt das nicht:

EXT3-fs warning: maximal mount count reached

es folgt ein checkforce, was nicht immer gewünscht ist.

Check current mount count

tune2fs -l /dev/md2|grep -i "mount count"


Script

#!/bin/bash
#
# 19.05.2008, J. Tietz
# prints max/current mount count of all filesystems (/dev/md*)

for part in `df -h|grep "/dev/md"|awk {'print $1'}`;do
        echo Partition: $part;
        tune2fs -l $part|grep -i "mount count";
        echo " ";
done;

Result:

servername:~# ./mount_count.sh
Partition: /dev/md3
Mount count:              5
Maximum mount count:      100

Partition: /dev/md1
Mount count:              5
Maximum mount count:      100

Partition: /dev/md2
Mount count:              5
Maximum mount count:      100

Partition: /dev/md4
Mount count:              5
Maximum mount count:      100


Hint

from man fstab:

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.