LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 01-09-2006, 12:40 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
How can I reboot with a forced fsck upon rebooting?


How can I reboot with a forced fsck upon rebooting?
 
Old 01-09-2006, 01:54 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 01-09-2006, 03:33 PM   #3
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
/sbin/reboot -f

will force fsck on next reboot.
 
Old 01-09-2006, 08:47 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 01-09-2006, 09:24 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fsck and reboot on FC4! lecedre Fedora 2 09-18-2005 08:11 AM
fsck on root filesystem without reboot? Barx Linux - General 3 03-29-2005 03:55 AM
Cant reboot. Inode, fsck? fedoraguy Linux - Newbie 1 08-13-2004 03:20 PM
KDE (DCOP) problem starting root after forced reboot powadha Linux - Software 2 05-30-2004 05:14 PM
problems when rebooting (fsck used) plisken Linux - General 3 03-23-2003 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration