Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > fsck V Disk Utility

fsck V Disk Utility
Thread Tools
bkb
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Mar 25, 2004, 07:58 PM
 
Hello,
I am trying to make some sense of some Panther maintenance ideas that I got from
this article.

I've been trying to pick up the basics of UNIX over the last couple months. I don't know much about the fsck command. I've searched the forum for 'fsck' and there is a bunch of stuff, but here are some additional questions I would like answered:

1) How is fsck different from running Repair Disk in Disk Utility (by booting with the OS X CD 1)? Is there any difference?
2) Should I run fsck in single user mode or by typing >console at the login windows? What is the difference between running it these ways, if any?
3) What do the options -fy do? I have been told to add them to my fsck command.
4) Does the fsck command actually do anything for a Journaled HFS+ file system. If so, how often should I run it on my system?
5) Are there any other maintenance tasks - other than those in that article - that are recommended for maintenance conscious users?

Thanks,
BKB.
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Mar 25, 2004, 09:46 PM
 
Originally posted by bkb:
Hello,
I am trying to make some sense of some Panther maintenance ideas that I got from
this article.

I've been trying to pick up the basics of UNIX over the last couple months. I don't know much about the fsck command. I've searched the forum for 'fsck' and there is a bunch of stuff, but here are some additional questions I would like answered:

1) How is fsck different from running Repair Disk in Disk Utility (by booting with the OS X CD 1)? Is there any difference?
2) Should I run fsck in single user mode or by typing >console at the login windows? What is the difference between running it these ways, if any?
3) What do the options -fy do? I have been told to add them to my fsck command.
4) Does the fsck command actually do anything for a Journaled HFS+ file system. If so, how often should I run it on my system?
5) Are there any other maintenance tasks - other than those in that article - that are recommended for maintenance conscious users?

Thanks,
BKB.
1) Disk Utility runs fsck underneath, so they're the same.
2) Single user mode is the way to go. ">console" won't work, because you're still booted off the file system you're trying to repair.
3) From the fsck man page:

Code:
-f Force fsck to check `clean' filesystems when preening. -y Assume a yes response to all questions asked by fsck; this should be used with great caution as this is a free license to continue after essentially unlimited trouble has been encountered.
4) Without the "-f" option, fsck will not do anything on a Journaled file system.

5) Make sure your computer runs its weekly and monthly tasks. These are run via cron by the /etc/crontab at the times specified therein.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
bkb  (op)
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Mar 25, 2004, 11:44 PM
 
Originally posted by Arkham_c:
1) Disk Utility runs fsck underneath, so they're the same.
2) Single user mode is the way to go. ">console" won't work, because you're still booted off the file system you're trying to repair.
3) From the fsck man page:

Code:
-f Force fsck to check `clean' filesystems when preening. -y Assume a yes response to all questions asked by fsck; this should be used with great caution as this is a free license to continue after essentially unlimited trouble has been encountered.
4) Without the "-f" option, fsck will not do anything on a Journaled file system.

5) Make sure your computer runs its weekly and monthly tasks. These are run via cron by the /etc/crontab at the times specified therein.
Arkham,
Thanks for clearing that up. I'm also told that holding down SHIFT when my computer starts is effectively the same as running Disk Utility or fsck -fy. Is this correct?

And where can I read more about file systems? The concept of file systems/mounting drives is a little new to me (for example, the command df brings up a whole bunch of output I don't understand). I've only come across it when looking around in UNIX. What's the best way to learn more about this stuff, other than taking a course in it?

Thanks.
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Mar 26, 2004, 04:26 AM
 
Originally posted by bkb:
Arkham,
Thanks for clearing that up. I'm also told that holding down SHIFT when my computer starts is effectively the same as running Disk Utility or fsck -fy. Is this correct?
Nope. http://docs.info.apple.com/article.html?artnum=75459
     
bkb  (op)
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Mar 26, 2004, 12:07 PM
 
Originally posted by wataru:
Nope. http://docs.info.apple.com/article.html?artnum=75459
Wataru,
I've seen this page, but apparently holding down SHIFT also runs fsck before starting up. Is this true?

Thanks.
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Mar 26, 2004, 05:25 PM
 
Originally posted by bkb:
Wataru,
I've seen this page, but apparently holding down SHIFT also runs fsck before starting up. Is this true?

Thanks.
Well I can't tell you for sure, but I've never heard that. My guess is that it does not.
     
cdhostage
Mac Elite
Join Date: Jul 2001
Status: Offline
Reply With Quote
Mar 26, 2004, 09:33 PM
 
I'm dead sure that pressing shift doesn't run the check, because the time to boot all the way to the Desktop is slightly less rather than significantly more. Running fsck takes some time.
Actual conversation between UCLA and Stanford during a login on early Internet - U: I'm going to type an L! Did you get an L? S: I got one-one-four. L! U:Did you get the O? S: One-one-seven. U: <types G> S: The computer just crashed.
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Mar 27, 2004, 03:31 AM
 
Originally posted by bkb:
And where can I read more about file systems? The concept of file systems/mounting drives is a little new to me (for example, the command df brings up a whole bunch of output I don't understand). I've only come across it when looking around in UNIX. What's the best way to learn more about this stuff, other than taking a course in it?
In the terminal:

man mount
man fstab
man fsck
man df
man apropos

The O'Reilly Book: UNIX Power Tools is also helpful.

Regarding fsck on startup: It is run automatically if the filesystem is not marked as "clean" (e.g. when the computer has not been shut down correctly). If the filesystem is marked as clean, it isn't run. This is standard UNIX.

While fsck can be run in multi-user mode, often it cannot do as much as when running in single user mode. This is especially true if you have but a single HD (and/or partition), as is typical in many MacOS X installations.
     
bkb  (op)
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Mar 27, 2004, 03:18 PM
 
Thanks for the feedback. Very helpful.

The more I learn, the more I feel like a newbie.
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
     
oldfogey
Fresh-Faced Recruit
Join Date: Sep 2002
Location: London
Status: Offline
Reply With Quote
Mar 30, 2004, 06:53 PM
 
bkb

Some of the stuff posted in this topic is wrong. 'fsck' is run on a Safe boot. You might want to look at Apple's KB articles:

From Mac OS X: What is Safe Boot, Safe Mode?
" ... Safe Mode does three things ... It forces a directory check of the startup (boot) volume."

From Mac OS X: Safe Boot Takes Longer Than Normal Startup
"... It can be quite long (several minutes) depending on how long it takes to check and repair the directory (if needed) ..."

And if that doesn't convince you, read the code :
From "/etc/rc.boot"
Code:
# fsck always runs during SafeBoot if [ "${SafeBoot}" = "-x" ]; then fsck -fy else ...
Hope that clears up a few things!
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Mar 30, 2004, 07:50 PM
 
Originally posted by oldfogey:
'fsck' is run on a Safe boot.
Here's a more complete excerpt of /etc/rc.boot:
Code:
# Benignly clean up ("preen") any dirty filesystems. # fsck -p will skip disks which were properly unmounted during # a normal shutdown. # fsck always runs during SafeBoot if [ "${SafeBoot}" = "-x" ]; then fsck -fy else fsck -p fi
So not only is fsck run when you hold down the shift key on boot, but the -f option forces a check even if the filesystem is marked as clean!. This differs from a normal boot where the -p option omits checking disks marked as clean.

In summary: fsck is always run on boot up. However it will skip disks which are marked as clean on normal startups, but always checks disks when the shift key is held down (Safe Mode) or if they are not marked as clean.
     
bkb  (op)
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Mar 31, 2004, 01:37 PM
 
Oldfogey, Rainy Day,
Thanks for your feedback. I'm glad you straightened that out for me. Clearly I am not the only one who has a lot to learn.

BKB.
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
     
xtian
Fresh-Faced Recruit
Join Date: Jul 2003
Location: San Francisco Bay Area
Status: Offline
Reply With Quote
Jul 8, 2004, 03:08 PM
 
5) Make sure your computer runs its weekly and monthly tasks. These are run via cron by the /etc/crontab at the times specified therein.
Can someone answer if Panther Cache Cleaner runs the cron command under its GUI?
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Jul 8, 2004, 05:37 PM
 
Originally posted by xtian:
Can someone answer if Panther Cache Cleaner runs the cron command under its GUI?
That's an excellent question for these folks.

Btw, it's not very difficult to change the time of day a cron job runs. You can reschedule the housekeeping jobs to run during the day, when your computer is likely to be awake, rather than in the middle of the night, when everybody is safely tucked into bed (including the computer). See man cron for details.
     
wataru
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Jul 8, 2004, 05:43 PM
 
In my opinion, the best solution is to use anacron. In conjunction with cron it makes sure that things get done. It's available via fink (as well as from other sources, but you'd have to google for them).
     
xtian
Fresh-Faced Recruit
Join Date: Jul 2003
Location: San Francisco Bay Area
Status: Offline
Reply With Quote
Jul 10, 2004, 11:10 PM
 
I did email the folx at Northern and they were friendly enough to reply:

"PCC also includes the PCC engine which will
run many routines automaticaly and more reliably than cron does in
most home installations."
     
Rainy Day
Grizzled Veteran
Join Date: Nov 2001
Location: Oregon
Status: Offline
Reply With Quote
Jul 11, 2004, 12:55 PM
 
Originally posted by xtian:
"PCC also includes the PCC engine which will run many routines automaticaly and more reliably than cron does in most home installations."
Beware of cleverly worded language here! Since the system housekeeping cron jobs are set to run between 3-5am, and since most home computers are tucked into bed by that time, almost anything will run "more reliably"! Even the very same cron jobs reset to run during normal waking hours!

anacron, as suggested by wataru, is one solution, MacJanitor is another, or simply rescheduling the current system cron jobs to run at a time when the computer is likely to be on. I have opted for the latter because it's simple and effective (for me) and requires no additional software (just a simple edit to one file). YMMV.

But PCC may do things the cron jobs don't; i don't know. Whether those extra things are valuable is another question. I have my doubts. Once again, YMMV.
     
   
 
Forum Links
Forum 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 On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:04 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,