11. Maintenance

11.1. Filesystem inspection

It is a virtuous habit to inspect your ext2 filesystem on the flash memory regularly. To do this, the tool dumpe2fs may be used in the following way: #dumpe2fs -h /dev/sda1 (you must be root and the device should not be mounted). The result should be similar to the following:

When the ext2 filesystem is created, it is by default given maximal usage before it has to be checked. These can be seen Maximum mount count (35) and Check interval (expiry date).

The usage so far: Mount count and Last checked .

The existence of corrupted files (bad blocks): Filesystem state .

You might get warnings about these things when you mount the device or when you try the read files from the device.

11.2. And then?

When the usage allocation has been spent, or there is evidence of file corruption, the thing to do is to run #fsck.ext2 /dev/sda1 with the device unmounted. After that, usage parameters will be freshly allocated and bad blocks will be gone.

When dealing with the vfat system, the
dump does not seem to exist. The command #dumpe2fs -f /dev/sda1 for filesystems other than ext2 does not work for vfat. The tool
dosfsck exists (it is still Alpha), and may be risky to use on a device you have not formatted yourself.