Link to home
Start Free TrialLog in
Avatar of Barry Kay
Barry KayFlag for South Africa

asked on

OpenSUSE Linux - Force System File Check on Reboot

We are running OpenSUSE 12.2 and seem to be experiencing some problems with files not opening. If I move these files to a different folder they work, so it seems to be a filesystem issue.
I would like to force a system file check to run when on reboot.

Shutdown -rF is not longer supported.

I came across the following" If you want to force fsck on the next boot, just create a file called /forcefsck . If this file is present, then during next boot - the fsck is forced.   # touch /forcefsck "
Does this work well?
Does it require user intervention or will it run and auto fix as I would like to do this remotely and will not be able to see the terminal while the server is restarting?

Any other suggestions welcome.

Thank you.
SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Barry Kay

ASKER

@Gerwin Jansen

The below show the mounted files systems on our server as you mentioned.
If  1 means force system check? What does the 2 mean?  

How can I force a once off system check on all volumes on reboot, with no user intervention?

(some text removed just to shorted the lines below for easy reading)

/dev/disk/by-id/raid-part2 swap                   swap       defaults               0 0
/dev/disk/by-id/raid--part3 /                          ext4       acl,user_xattr        1 1
/dev/disk/by-id/raid--part1 /DataStorage    ext4       acl,user_xattr        1 2
/dev/disk/by-id/raid--part1 /boot                 ext4       acl,user_xattr        1 2
/dev/disk/by-id/raid--part4 /home                ext4       acl,user_xattr        1 2
It's like a sequence, 0 is not checked, 1 checked at boot time, 2 is checked after 1

http://linux.die.net/man/5/fstab
@Gerwin Jansen, ok so if I am understanding correctly, the FS marked 2 will still run the file system check on reboot but after the FS marked 1.
And this will all occur without user intervention is I run # touch /forcefsck    before rebooting?
I don't recognize /forcefsck but numbers 1 and 2 in fstab mean that file systems are checked.
@Gerwin Jansen. So even on a normal reboot the filesystems are check and will repair any damaged files, etc?

I need to run something that will work the same on reboot as chsdsk /f on Windows.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ThomasMcA2
So what full command can I type in, reboot and let it do the job?