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.
Barry KaySystems EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
In /etc/fstab you find the mounted file systems.

6th column is about file system check, set the field from 0 to 1 to force a fscheck. The root file system should already have a 1 in that column.
Barry KaySystems EngineerAuthor Commented:
@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
Gerwin Jansen, EE MVETopic Advisor Commented:
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Barry KaySystems EngineerAuthor Commented:
@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?
Gerwin Jansen, EE MVETopic Advisor Commented:
I don't recognize /forcefsck but numbers 1 and 2 in fstab mean that file systems are checked.
Barry KaySystems EngineerAuthor Commented:
@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.
ThomasMcA2Commented:
The following came from http://www.cyberciti.biz/faq/linux-force-fsck-on-the-next-reboot-or-boot-sequence/

/forcefsck only works with the old SysVinit and early versions of Upstart. It won't work with systemd. systemd-fsck understands one kernel command line parameter:

   fsck.mode=
    One of "auto", "force", "skip". Controls the mode of operation. The default is "auto", and ensures that file system checks are done when the file system checker deems them necessary. "force" unconditionally results in full file system checks. "skip" skips any file system checks.

   fsck.repair=
    One of "preen", "yes", "no". Controls the mode of operation. The default is " preen", and will automatically repair problems that can be safely fixed. "yes " will answer yes to all questions by fsck and "no" will answer no to all questions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Barry KaySystems EngineerAuthor Commented:
@ThomasMcA2
So what full command can I type in, reboot and let it do the job?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.