To run the fsck command, use the name of the file system as the argument. You must ensure that the file system you want to check is unmounted by using the umount command. If you want to fsck the file system at /dev/hdc, for example, do this:
# fsck /dev/hdc
If you are logged on as a regular user and su to root using su, you do not inherit root's environment and path, meaning that the preceding command does not work unless you use the full path: /usr/sbin/fsck.
Either type the full path each time, or become root with su -, which causes you to inherit root's environment and path; you have less to type.
The file system state is tracked in the ext3 file systems. A special field in the superblock tells the kernel that, after the file system is mounted read/write, it is marked as not clean; when it is properly unmounted, it is marked as clean. If a file system is not unmounted properly, it could contain corrupt data because all the file data might not have been written to it. (This is what the journaling file systems such as ext3 strive to eliminate.) When the system is booted, this flag is checked and if it is not clean, the program fsck is run. Internally, fsck is actually a wrapper program that runs the appropriate version of fsck for the file system in use: fsck.minix, fsck.ext2, fsck.ext3, fsck.reiserfs, fsck.msdos, or fsck.vfat. If the kernel detects an inconsistency in the superblock field, the file system is marked erroneous, and the file system check is forced even if other indicators suggest that fsck does not need to be run.
By default, the system runs fsck on a file system after a periodic number of reboots, regardless of the status of the clean flag. This behavior is triggered by a mount counter kept in the superblock or after a predetermined amount of time has elapsed since the last reboot (information also kept in the superblock). These parameters can be adjusted through the tune2fs command; this command can also be used to modify how the kernel handles the erroneous flag and, interestingly, the number of blocks reserved for the super-user, also known as root. This latter option is useful on very large or very small disks to make more disk space available to the user.
Other File Systems Available to Fedora
Although ext3 is certainly an acceptable root file system, there are other alternatives. No operating systems can support as many root file systems as Linux, but you should be aware that every file system has its strengths and weaknesses. Some are better with small files, some are better with large files; some are better at writing data, and some better at reading data. Unfortunately, there is no one perfect file system. The following sections discuss some of the other common file systems available for use with Fedora.
The Reiser File System (reiserfs)
The other popular journaling file system for Linux is the written-from-scratch Reiser file system, reiserfs. For a long time it was used by the SUSE distribution, but SUSE now uses ext3. reiserfs offers similar features to ext3, but there is no easy migration path from an already existing ext2 partition. In the past, reiserfs didn't work well over NFS mounts, but recent versions of the nfsd daemon have fixed those problems. Fedora does offer reiserfs, but does not offer support for booting from it as the root partition file system, nor does it offer the choice to format non-root partitions as reiserfs during the installation process.
reiserfs is offered primarily for compatibility with existing reiserfs partitions you might want to access. Although the Reiser file system can be used as a root file system (meaning that Linux can be booted from a Reiser file system), Fedora has chosen not to support that option. The main problem is that reiserfs does not, at the time of writing, play nicely with SELinux and is therefore not recommended either by Red Hat or the NSA (SELinux's developers).
Namesys, the company behind reiserfs, has struggled since its founder (Hans Reiser) was arrested as part of the police investigation into the murder of his wife. Few distros now recommend using reiserfs, so we would recommend avoiding it for the foreseeable future.
JFS and XFS File Systems
Two commercial Unix file systems have been ported (rewritten) to allow them to be used in Linux. IBM has provided its Journaled File System (JFS) that is used with its commercial Unix named AIX. Silicon Graphics, Inc. (SGI) has provided its XFS file system used by its commercial Unix named IRIX. Because these file systems are generally suited for enterprise systems rather than home or small office systems, it seems likely that they are offered in Fedora to ease the transition of IRIX and AIX users to Linux by eliminating the need for these users to reformat their very large file systems.
Beginning with kernel 2.6, XFS is fully supported in the kernel.
DOS File Systems
The extent of DOS file system support in Linux is often surprising to newcomers, but the DOS file system proved to be a viable option in the early years of Linux. Because Microsoft has been the dominant operating system on Intel computers, Linux has always worked toward coexistence with DOS.
Microsoft DOS and the consumer-oriented Windows operating systems use a file system known as FAT (File Allocation Table). FAT32 is the typical system used today. The number following the FAT name indicates the size of the space for naming address pointers; the more space, the larger a section of contiguous space can be identified and accessed. FAT32 is the most recent version of FAT, and it is backward compatible with other versions of FAT. Older versions are not forward compatible.
The Fedora kernel can access all versions of FAT-formatted partitions (including floppy disks), using the vfat kernel module.
CD-ROM File Systems
If you use CD-ROM or DVD-ROM media, you need to understand a little bit about the file system and how it works with Linux. To the average user, the file system of a CD-ROM looks just like a native Linux file system. It is not the native file system, but the features of the Virtual File System make it possible for it to appear that way. The CD-ROM file system standards continue to evolve to accommodate new technology.
The file system typically used on a CD-ROM is known as iso9660, the name of the standard that defines the format. Each operating system translates the iso9660 file system into the native file system of the operating system (with some restrictions). Several extensions have been created to address certain special needs. The Rock Ridge extension allows long filenames and Unix-like symbolic links. The Joliet extension allows Unicode characters and long filenames, useful when dealing with non-English languages. El Torito CDs contain a bootable image and, with a suitable BIOS, can boot an operating system from the CD.