Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I run ubuntu server and use SSH to work on it. I've noticed that once in a while after a reboot, the server will ask for a disk check. I have to manually tell the system to run or ignore it. However, I have no monitor attached to my server, and I won't be able to connect with SSH as long as the disk check didn't completed or was ignored.

Is there a way to: - automatically do the disk checks without the need of my permission? - start the SSH server before the disk check (I doubt this) - don't do any disk checks (but this seems to me kind of a cheap way, because the checks are useful)

Kind regards, Brendt

share|improve this question

1 Answer 1

If a regular file system check is performed, user input should not bee needed. However, if something unexpected happened, user input may be required. To tell fsck to Perform the check and fix errors without user intervention, add

FSCKFIX=yes

into

/etc/default/rcS

as stated in e.g. http://stackoverflow.com/questions/9932250/how-to-auto-respond-to-fsck-prompt-at-boot. In general, be careful when performing automatic file system repairs.

Just to double check that file system checks on a regular basis are performed without user intervention, do a

sudo touch /forcefsck

and reboot your system. Now yor file system gets checked as it would regularly.

For the record: To change or disable regular file system checks, use tune2fs, e.g.

tune2fs -c 0 -i 0 /dev/sda1

to disable checking /dev/sda1 after x mounts as well as time-dependent checking. It's also possible to edit /etc/fstab and set the last digit after a fs entry to 0, e.g.

/dev/sda1 /home ext4 defaults 1 2

to

/dev/sda1 /home ext4 defaults 1 0
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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