When and how should this be run? Is it better to boot from a DVD-ROM and run fsck on each real hard drive? Or can this be done automatically after X number of mounts?
When and how should this be run? Is it better to boot from a DVD-ROM and run fsck on each real hard drive? Or can this be done automatically after X number of mounts?
The answer to when to run
fsck
on the underlying physical disks is very simple:Never
If you are using RAID-1 the
fsck
command might not notice you are using it incorrectly and perform an actual check. If that check results in any writes to the disk, you will end up with a RAID where the disks are out of sync.Having metadata out of sync between RAID replicas can potentially lead to data loss.
The correct way to check your RAID
Periodic checks of the file system metadata are to be performed on the logical layer above the RAID. This is done as part of the boot process, and there is a good chance this is already configured for you.
Periodic verification that the replicas are readable and in sync is also a good idea. This happens at a lower layer and doesn't check any integrity at the file system layers. On one of my servers I can see that these checks are happening by inspecting the output of
fsck stands for 'file system consistency check', it checks a filesystem, not the underlying disks - as such it should be used to testing the entire filesystem. As for periodic automatic fsck executions look at your /etc/fstab file, it's in that file that we can define automatic checks.