I'm working with a system where we want to allow users to play around with the date and time if they want, and where reboots may happen arbitrarily. This is fine, except for one thing: if there's a large time jump backwards, the following error appears on reboot:
Checking filesystems
IMAGE2: Superblock last mount time (Tue Mar 1 17:32:48 2011,
now = Thu Feb 24 17:34:29 2011) is in the future.
IMAGE2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
*** An error occurred during the file system check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
…and then the boot hangs waiting for user console input, and even once console access is gained, requires a root password to continue.
This is decidedly less than ideal. Is there any way to either skip the check or force the check to happen automatically on reboot?
Google has only provided help that requires running fsck manually if/when this is hit, which is not what I'm after. Running fsck manually after setting the time doesn't work as the filesystem is still mounted at that point, and just disabling fsck entirely is less than ideal.
I'm using RedHat 6.
Update: The solution I'm currently going with is to hack fstab to disable fsck checking on reboot. I'd tried editing the last mount time on the disks using debugfs
, which works fine for ext3 drives, but appears to fail inconsistently on ext4.
Best Answer
I was going to suggest hacking
e2fsck
to disable the specific checks for a last mount time or last write times in the future. These are defined in problem.c / problem.h, and used in super.c. But in looking, I discovered that E2fsprogs 1.41.10 adds a new option to/etc/e2fsck.conf
called broken_system_clock. This seems to be exactly what you need, and since you're using Red Hat Enterprise Linux 6, you should have 1.41.12, which includes this option. From the man page:Yes, the man page can't spell "heuristics". Oops. But presumably the code works anyway. :)