

Now, pass ext2 as the fslist value to -t option as shown below: # fsck -AR -t ext2 -y Note that fslist is a comma separated values. When you are using with option -A, the fsck will check only the filesystem mentioned with this option -t. Using fsck -t option, you can specify the list of filesystem to be checked. Check Only a Specific Filesystem Type using Option -t Note: Option -y is explained in one of the examples below. It is recommended that you exclude the root filesystem during this global check by adding -R option as shown below. Here, the filesystem with the same fs_passno are checked in parallel in your system. # /backup was on /dev/sda7 during installation # /mydata was on /dev/sda6 during installation The /etc/fstab contains the entries as listed below, # cat /etc/fstab Please note that the filesystem with a fs_passno value of 0 are skipped, and greater than 0 are checked in the order. This checks the file system in the order given by the fs_passno mentioned for each filesystem in /etc/fstab. You can check all the filesystems in a single run of fsck using this option. Check All Filesystems in One Run using Option -A # fsck /dev/sda2įsck: error 2 while executing fsck.ntfs for /dev/sda2 3. So, this gives the following error message. The following example show the various possible fsck checker commands (for example: fsck.ext2, fsck.ext3, fsck.ext4, etc.) # cd /sbinįsck fsck.cramfs fsck.ext2 fsck.ext3 fsck.ext4 fsck.ext4dev fsck.minix fsck.msdos fsck.nfs fsck.vfatįsck command will give you an error when it doesn’t find a filesystem checker for the filesystem that is being checked.įor example, if you execute fsck over a ntfs partition, you’ll get the following error message. These fsck checker commands are typically located under /sbin. Fsck Command Specific to a Filesystem Typeįsck internally uses the respective filesystem checker command for a filesystem check operation. The following are the possible exit codes for fsck command.Ģ. You can check a specific filesystem (for example: /dev/sda6) as shown below. Number Start End Size Type File system Flags Filesystem Check on a Disk Partitionįirst, view all the available partitions on your system using parted command as shown below.
#Extfs terminal commands how to
This article explains 10 practical examples on how to execute fsck command to troubleshoot and fix any filesystem errors. Make sure to execute the fsck on an unmounted file systems to avoid any data corruption issues. System administrator could also run it manually when there is a problem with the filesystems. Linux fsck utility is used to check and repair Linux filesystems ( ext2, ext3, ext4, etc.).ĭepending on when was the last time a file system was checked, the system runs the fsck during boot time to check whether the filesystem is in consistent state.
