Is there a correct way to reboot a server to avoid FSCK and just avoid getting FSCK in general? I have been using the reboot command to reboot servers.
-
1You want to have fsck. You want to have your filesystems checked.. believe me. – Bonsi Scott Nov 13 '12 at 22:02
-
Sounds to me that the question is whether the OP is restarting her server the correct way. Not about preventing fsck - but inadvertently causing it to run. – uSlackr Nov 14 '12 at 04:25
3 Answers
The reboot
command may reboot the system without shutting down system services or unmounting filesystems cleanly. It's supposed to shutdown the system normally, but apparently this doesn't always happen.
To avoid this problem, use the shutdown
command with the appropriate options to have it reboot the system.
An example:
shutdown -r now
So long as the system shuts down cleanly, it will not normally attempt to fsck
the drives on next restart (unless the filesystem mount/time count is exceeded, but that's another story).

- 244,070
- 43
- 506
- 972
-
1
-
It also asks `Is there a correct way to reboot a server to avoid FSCK`. There is. do not use reboot since its effects vary between OS's. Some do precisely what Michael said and thus cause problems. – Hennes Nov 13 '12 at 18:20
-
1
-
Under linux `reboot` calls `shutdown -r` unless you call `reboot -f`, so this advice doesn't help at all – Dennis Kaarsemaker Nov 13 '12 at 18:26
-
The fsck after reboot happens for one of three reasons: when a system shuts down uncleanly (like a crash), when a filesystem hasn't been checked for N mounts, or when a filesystem hasn't been checked in M days. For an ext2/3/4 filesystem you can see the current counters and set the value of N and M with the tune2fs
command.

- 19,277
- 2
- 44
- 70
-
This answer is correct as far as it goes, but it doesn't address the question. – Michael Hampton Nov 13 '12 at 18:31
-
First fsck is your friend! If you have crashed a system, you WANT it to run automagically and this action should never be disabled in this case.
Now, during the course of normal reboots where everything gets sync'd fine, the periodic invokation of fsck can be annoying and not very timely. Generally, what I do in this case is to inhibit this type of periodic fsck invokation, using tune2fs (as the root user):
tune2fs -i 0 -c 0 /dev/sda1 ;; change /dev/sda1 with whatever your raw disk is
This operation can be performed at any time during the systems operation, even with the disk being mounted.
After you do this you can then reboot the server and avoid the fsck operation (unless the server has crashed).

- 11,856
- 28
- 53
- 67