Some times it is good to do file system checks for FS related errors before it is too late to recover a HDD. We have some inbuilt commands like fsck command to check for errors manually. But the issue is you can not check your primary mount point where your OS resides. In order to check file system errors on OS related mount point we have to enable fsck to run at boot time. This post is to check if that setting is enabled or not.

To check these details use any of the below commands which will give you whether your system is checked for file system errors at the time of boot or not. These commands will show enabled option “next check after” info

tune2fs -l /dev/sda1

or

dumpe2fs -h /dev/sda1

Output without fsck next boot disabled

 

Filesystem volume name: boot
  Last mounted on: /
  Filesystem UUID: f28a2533-438b-453e-b18a-8f8ba44ef999
  Filesystem magic number: 0xEF53
  Filesystem revision #: 1 (dynamic)
  Filesystem features: ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
  Filesystem flags: signed_directory_hash
  Default mount options: user_xattr acl
  Filesystem state: not clean
  Errors behavior: Continue
  Filesystem OS type: Linux
  Inode count: 126208
  Block count: 504064
  Reserved block count: 25203
  Free blocks: 145154
  Free inodes: 55449
  First block: 0
  Block size: 4096
  Fragment size: 4096
  Reserved GDT blocks: 123
  Blocks per group: 32768
  Fragments per group: 32768
  Inodes per group: 7888
  Inode blocks per group: 493
  Flex block group size: 16
  Filesystem created: Wed Jun 10 15:12:42 2015
  Last mount time: Tue Oct 20 17:07:45 2015
  Last write time: Tue Oct 20 17:05:10 2015
  Mount count: 1
  Maximum mount count: -1
  Last checked: Tue Oct 20 17:05:10 2015
  Check interval: 0 (<none>)
  Lifetime writes: 35 GB
  Reserved blocks uid: 0 (user root)
  Reserved blocks gid: 0 (group root)
  First inode: 11
  Inode size: 256
  Required extra isize: 28
  Desired extra isize: 28
  Default directory hash: half_md4
  Directory Hash Seed: 82f81935-b25b-40a3-9928-4a46842e591d
  Journal backup: inode blocks

Output with fsck next boot enabled

root@taggle-062:/home/taggle# dumpe2fs -h /dev/sda1
 dumpe2fs 1.41.11 (14-Mar-2010)
 Filesystem volume name: boot
 Last mounted on: /
 Filesystem UUID: 3a7c5863-e00c-49e2-a838-1742de53ebce
 Filesystem magic number: 0xEF53
 Filesystem revision #: 1 (dynamic)
 Filesystem features: ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
 Filesystem flags: signed_directory_hash
 Default mount options: journal_data_writeback
 Filesystem state: not clean
 Errors behavior: Continue
 Filesystem OS type: Linux
 Inode count: 122160
 Block count: 487936
 Reserved block count: 24396
 Free blocks: 206546
 Free inodes: 65869
 First block: 0
 Block size: 4096
 Fragment size: 4096
 Reserved GDT blocks: 119
 Blocks per group: 32768
 Fragments per group: 32768
 Inodes per group: 8144
 Inode blocks per group: 509
 Flex block group size: 16
 Filesystem created: Wed Dec 29 09:36:59 2010
 Last mount time: Fri Oct 16 16:37:51 2015
 Last write time: Wed Oct 21 11:30:47 2015
 Mount count: 3
 Maximum mount count: 23
 Last checked: Fri Oct 16 09:52:33 2015
 Check interval: 15552000 (6 months)
 Next check after: Tue Feb 23 11:52:33 2016
 Lifetime writes: 493 GB
 Reserved blocks uid: 0 (user root)
 Reserved blocks gid: 0 (group root)
 First inode: 11
 Inode size: 256
 Required extra isize: 28
 Desired extra isize: 28
 Default directory hash: half_md4
 Directory Hash Seed: ea221eae-0fc0-4154-b587-374e033882b1
 Journal backup: inode blocks

Hope this helps some one to check this after they enable fsck to run after reboot.

The following two tabs change content below.
Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.