Fsck

From TheBestLinux.com
Revision as of 18:35, 29 July 2021 by Jamie (talk | contribs) (Created page with "FSCK stands for File System ChecK, and does exactly that, checks a filesystem! This is one of the many beauties of Linux, in that most of the time, you can figure out what a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

FSCK stands for File System ChecK, and does exactly that, checks a filesystem! This is one of the many beauties of Linux, in that most of the time, you can figure out what a command does by it's name, though that's definitely NOT always the case!

As there are many types of file systems on many operating systems, including Linux, there are many variations of fsck to support many different filesystems types, and a quick way to see which files systems are supported by the current Linux system you happen to be logged into right now, by typing this(note the DOT after "fsck."!) and then tapping the TAB key twice:

[jamie@fc33hw01.dawgland.com:~]$ fsck.
fsck.btrfs   fsck.ext2    fsck.ext4    fsck.hfs     fsck.msdos   fsck.vfat
fsck.cramfs  fsck.ext3    fsck.fat     fsck.minix   fsck.ntfs    fsck.xfs
[jamie@fc33hw01.dawgland.com:~]$ fsck.

As you can see, not only do my particular fsck packages installed support the most common and current Linux filesystems, EXT2, EXT3, EXT4, BTRFS and XFS.

Also, as you can see, Microsoft filesystems MSDOS, FAT, VFAT and NTFS are supported as well.

HFS is short for Hierarchical File System, and is used on MAC's.

CramFS is mostly used on embedded systems & Minix is used on the Minix operating system, and designed to be more UNIX-like.

Each fsck command has different switches and arguments. To see how to use a particular fsck tool, just type the entire fsck.xxx command by itself and hit the ENTER key, and it should give you the "Usage" page.

For instance, if you want to find out how to use the EXT4 filesystem, just type the command without any arguments or switches:

[jamie@fc33hw01.dawgland.com:~]$ fsck.ext4



This should produce the following usage output:

Usage: fsck.ext4 [-panyrcdfktvDFV] [-b superblock] [-B blocksize]
		[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
		[-E extended-options] [-z undo_file] device

Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list
 -z undo_file         Create an undo file
[jamie@fc33hw01.dawgland.com:~]$