Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-09-2006, 12:40 PM
|
#1
|
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430
Rep:
|
How can I reboot with a forced fsck upon rebooting?
How can I reboot with a forced fsck upon rebooting?
|
|
|
01-09-2006, 01:54 PM
|
#2
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Why? You can always boot in level 3, mount the file system read-only, and run fsck by hand.
Looking at my /etc/rc.d/rc.sysinit suggests that a touch /forcefsck will cause a full fsck run next time you restart, since rc.sysinit checks for the presence of the forcefsck file in / before it runs fsck, and adds the -f option if it's found.
|
|
|
01-09-2006, 03:33 PM
|
#3
|
Senior Member
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054
Rep:
|
/sbin/reboot -f
will force fsck on next reboot.
|
|
|
01-09-2006, 08:47 PM
|
#4
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Quote:
Originally Posted by megaspaz
/sbin/reboot -f
will force fsck on next reboot.
|
Acording to man reboot,
Quote:
OPTIONS
-n Don’t sync before reboot or halt.
-w Don’t actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
-d Don’t write the wtmp record. The -n flag implies -d.
-f Force halt or reboot, don’t call shutdown(8).
-i Shut down all network interfaces just before halt or reboot.
-h Put all harddrives on the system in standby mode just before halt or poweroff.
-p When halting the system, do a poweroff. This is the default when halt is called as poweroff.
|
So, if I read that correctly, -f just reboots simulating a power failure. And, yes, pulling the plug on you system and then restarting will force fsck, but skipping the shutdown processing seems just a little drastic if you can get by with running a normal reboot.
It's your choice, Abe, but let us know how you make out.
And megaspaz, thanks for the reboot suggestion -- I hadn't realized that reboot had any options.
|
|
|
01-09-2006, 09:24 PM
|
#5
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
Slackware 10.2 checks for /etc/forcefsck in /etc/rc.d/rc.M which is called during startup - so if you're using Slackware just touch that file and reboot...
|
|
|
All times are GMT -5. The time now is 07:31 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|