LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2010, 10:37 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Rep: Reputation: 48
Does shutdown -rF imply a -y on all the checks on reboot


I want to do a shutdown -rF 3:00 to reboot my RHEL server at 3am tomorrow and force an e2fsck on each volume. But I want the e2fsck to run with the -y switch so it automatically answers yes so it will fix any problems it find automatically.

I can't find anywhere where it says if it will do this or not. does anyone know or have proof?

Or is there a better way to do what I'm trying to accomplish?
 
Old 04-28-2010, 11:15 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Note that some distros (eg 'buntu 9.10) have removed the -F option for shutdown
[ Check with man shutdown on your server (because you want to know which version your server will be running) ]

In which case the "new way" of forcing a fsck at the next boot is (as root):
touch /forcefsck
reboot


The default action is to fix errors automatically.
 
Old 04-28-2010, 11:28 AM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
thanks tredegar. I checked and mine still has the -F option. Glad to know it will automatically fix the errors and not wait for me to press Y over and over.

Looks like I'm safe to run this then and accomplish what I want: shutdown -rF 3:00

Just another quick question, there's probably no way to run a fsck while a volume is online to fix some (but not all since the volume is mounted) errors, so when I do my shutdown -rF it could in theory take less time because some problems will already be fixed?
 
Old 04-28-2010, 12:10 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Looks like I'm safe to run this then and accomplish what I want: shutdown -rF 3:00
To be picky, the man page says time format should be hh:mm so I'd try shutdown -rF 03:00

NEVER run fsck on a mounted partition.
fsck is optimised to run as fast as it can: It will run partitions on different disks concurrently, on the same disk, sequentially. On big partitions, this can still take some time.

Be patient.
 
Old 04-28-2010, 12:35 PM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
I appreciate your picky-ness, good catch.

ok, wasn't sure if i could get a head start or not.
 
Old 04-28-2010, 01:36 PM   #6
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
I just looked through all the messages log files, and there haven't been any errors really at all this month. So maybe I dont even need to do the disk check? or would file system errors show up in a different log?
 
Old 04-28-2010, 04:22 PM   #7
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
I just looked through all the messages log files, and there haven't been any errors really at all this month.
"there haven't been any errors really at all" or "there haven't been any errors".?

There's a big difference.

Remember that the kernel will assume the file system [ext2, ext3, ext4, reiserfs, fat32, ntfs, ... the list goes on] is clean unless the filesystem reports an error.

Errors may not be reported by an unclean filesystem. Until they become unmanageable by the filesystem. In which case the kernel may be notified "Disk full", or similar, when it clearly isn't.

If you do a search of LQ for run fsck you'll find the sort of situations that lead to this advice.

So it's a good idea to run fsck from time to time.

And I remind you that you should NEVER run fsck on a mounted partition.

But what was the problem that prompted you to start this thread about running fsck at 03:00 ?

Quote:
ok, wasn't sure if i could get a head start or not.
??

Is a "head start" like a "jump start" for a car with a flat battery ?

[ And is your <SHIFT> key broken? Bad capitalisation tends to indicate .... (You probably guessed it already) ]
 
Old 04-28-2010, 04:34 PM   #8
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,697

Original Poster
Rep: Reputation: 48
There aren't any errors, just status messages, in the messages logs as far back as they go.

I started this thread because we had major file system problems on this server last year, which resulted in fsck's running for almost a whole day on the server and its terabytes of data throughout. It had been years since it last fsck'd before that event, so i'd like to do them regularly now to help avoid such drastic downtime. Sounded like a good idea to me.

Where I come from, a "head start" is doing some smaller tasks before really getting into the meat of a task. Which probably wont make sense either. Say you're going to clean your house on Saturday, you could get a "head start" by going to the store Friday and buying all your cleaning supplies, saving you time Saturday. "Jump starts" are the same here as they are to you :-)

Sorry I missed my shift key starting my last sentence, I will replace my keyboard in case its faulty, LOL ;-) I have no idea what bad capitalization tends to indicate, or capitalisation as you spelled it since we're from different regions of the world. I would think it indicates I forgot to hit shift before I typed my first letter.

Thanks for the help and entertaining comments tredegar, always appreciated.
 
Old 04-29-2010, 11:59 AM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Thanks for the follow-up, hope you get it fixed ( and that it doesn't need to run for hours! )
 
  


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
Unable to shutdown/reboot server, no shutdown process running dctw Linux - Server 5 03-31-2010 05:46 AM
[FYI] "last -f <old wtmp> -x reboot shutdown" incorrect for last reboot and shutdown catkin Linux - General 1 03-25-2010 11:52 PM
Why I can't reboot and shutdown ? windgates Linux - Newbie 8 11-04-2008 01:58 PM
Reboot on Shutdown david7812 Linux - Newbie 10 11-19-2004 04:14 PM
help with shutdown and reboot Paxmaster Fedora 2 09-26-2004 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration