Is there a way to find out if a filesystem check is scheduled for the next boot?

Maybe it's similar to a forced check, which gets triggered by the existence of the file /forcefsck?

link|improve this question

2  
Besides command-line tools like dumpe2fs and tune2fs, are there any GUI tools for finding this out? It would seem like a good feature for Gnome Disk Utility (palimpsest) but I don't see it there, or in Gparted.... – nealmcb Sep 23 '11 at 17:01
feedback

3 Answers

up vote 10 down vote accepted

It depends on your filesystem, in addition to /forcefsck .

With ext2, ext3 and ext4 you can use

dumpe2fs -h /dev/diskname 

Where diskname is for example sda1. You can determine name of your disk partition by running command

mount

Example output (only partly):

/dev/xvda1 on / type ext3 (rw,noatime,usrquota,errors=remount-ro)

Where xvda1 is name of root disk partition.

For dumpe2fs three interesting items are

Mount count:              9
Maximum mount count:      36
Next check after:         Mon Feb 14 09:31:33 2011

Ubuntu will run fsck if mount count is equal or greater than maximum mount count, or if "next check after" is passed.

link|improve this answer
Works fine with my ext4 partition, thanks! – htorque Feb 13 '11 at 16:53
feedback

Starting in Ubuntu 11.04, this information will be shown in your /etc/motd file, using the tool /usr/lib/update-notifier/update-motd-fsck-at-reboot, which checks ext2/3/4 partitions for both date-based and count-based auto-fsck events. You can run it manually like this:

sudo /usr/lib/update-notifier/update-motd-fsck-at-reboot --force

and it will report any partitions that will be checked on the next reboot.

link|improve this answer
That's nice, thanks! – htorque Feb 16 '11 at 18:08
1  
Also, cat /var/lib/update-notifier/fsck-at-reboot to see the status from the last run without requiring elevated privileges. – ændrük Mar 8 at 16:25
feedback

There's a utility called showfsck that will tell you how many mounts are left until the next scheduled fsck.

link|improve this answer
2  
showfsck do not show timed fsck's: ext2/ext3/ext4 is checked on every nth mount or after x days since last fsck, whichever comes first. – Olli Feb 13 '11 at 16:15
@Olli: good point - I'm primarily a laptop user so I boot very often and forgot about the timed fsck's – goric Feb 13 '11 at 18:52
of course that is much better with for example scripts (actually showfsck is just script that uses tune2fs), maybe you should mention it. – Olli Feb 13 '11 at 19:39
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.