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 > Mac OS X > fsck when logged in

fsck when logged in
Thread Tools
Registered User
Join Date: Mar 2002
Location: Europe
Status: Offline
Reply With Quote
Jan 26, 2003, 03:02 AM
 
is it possible to run fsck when you are logged in (in other words: not in single user mode) ?
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Jan 26, 2003, 03:56 AM
 
As long as it is not the root partition, it is possible. So you won't be able to check your MacOS X partition unless booting in single user mode or booting from a CD.

Background fsck that also works for mounted partitions is implemented in FreeBSD 5.0 (which is available in its final version now).
I don't suffer from insanity, I enjoy every minute of it.
     
Registered User
Join Date: Mar 2002
Location: Europe
Status: Offline
Reply With Quote
Jan 26, 2003, 04:49 AM
 
So I guess I'll have to wait for OSX 10.2.x or 10.3, when apple implements freeBSD5 ?
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Jan 26, 2003, 07:41 AM
 
Well, the FreeBSD team hasn't released a 5.x stable which means that it isn't thoroughly tested yet. I would imagine that Apple will implement and release it as soon as a stable release is posted.

This background fsck works with BSD's FFS (Fast File System), so I don't know whether or not this is possible with HFS+.
I don't suffer from insanity, I enjoy every minute of it.
     
Dedicated MacNNer
Join Date: Mar 2001
Location: not far from my GSM phone
Status: Offline
Reply With Quote
Jan 28, 2003, 02:54 AM
 
Originally posted by OreoCookie:
Well, the FreeBSD team hasn't released a 5.x stable which means that it isn't thoroughly tested yet. I would imagine that Apple will implement and release it as soon as a stable release is posted.

This background fsck works with BSD's FFS (Fast File System), so I don't know whether or not this is possible with HFS+.
So how do I fsck a volume such as /Volumes/MyHardDisk ?
Can I CRON it?
Lao_Tseu
     
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
Jan 28, 2003, 07:53 AM
 
Originally posted by lapinos:
So how do I fsck a volume such as /Volumes/MyHardDisk ?
Can I CRON it?
You would use:

sudo fsck_hfs -f <device id>

where <device id> is the volume's device id as listed in df, e.g. /dev/disk0s9. So let's say you have a disk mounted at /Volumes/blah, whose device id is /dev/disk0s10. The proper command would be:

sudo fsck_hfs -f /dev/disk0s10

Note: this can also be used in single user mode to check disks other than the boot disk. It can also be used on journaled filesystems.

Note: this may also be used on a boot disk, but is not recommended, and if the filesystem is modified, you must reboot immediately.
     
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Jan 28, 2003, 08:47 AM
 
Originally posted by piracy:
You would use:

sudo fsck_hfs -f <device id>

where <device id> is the volume's device id as listed in df, e.g. /dev/disk0s9. So let's say you have a disk mounted at /Volumes/blah, whose device id is /dev/disk0s10. The proper command would be:

sudo fsck_hfs -f /dev/disk0s10

Note: this can also be used in single user mode to check disks other than the boot disk. It can also be used on journaled filesystems.

Note: this may also be used on a boot disk, but is not recommended, and if the filesystem is modified, you must reboot immediately.
This sounds very good. Thanks for the info!

It may be a stupid question, but is this what DiskUtility does when you tell it to repair a disk? Is it the same command or should I apply both (i.e. fsck and DiskUtility) to a disk when I need to repair it?
     
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jan 28, 2003, 09:33 AM
 
Originally posted by piracy:
You would use:

sudo fsck_hfs -f <device id>

where <device id> is the volume's device id as listed in df, e.g. /dev/disk0s9. So let's say you have a disk mounted at /Volumes/blah, whose device id is /dev/disk0s10. The proper command would be:

sudo fsck_hfs -f /dev/disk0s10

Note: this can also be used in single user mode to check disks other than the boot disk. It can also be used on journaled filesystems.

Note: this may also be used on a boot disk, but is not recommended, and if the filesystem is modified, you must reboot immediately.
I made three partitions of my built in drive. As far as the system goes, I understadn that it sees them as three separate disks. The first partition has OSX on it. The second has all my Applications, and the third one has my files. Can I run fsck on my second partition, even though some applications might be running in the background?

t
     
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
Jan 28, 2003, 10:36 AM
 
Originally posted by Simon:
It may be a stupid question, but is this what DiskUtility does when you tell it to repair a disk? Is it the same command or should I apply both (i.e. fsck and DiskUtility) to a disk when I need to repair it?
Disk Utility invokes fsck, so no, you don't need to use both. And 'fsck', when invoked, uses the proper tool (i.e., 'fsck_hfs') to perform its repair. It's no coincidence that Disk Utility's log looks similar to fsck's output.

Originally posted by t_hah:
I made three partitions of my built in drive. As far as the system goes, I understadn that it sees them as three separate disks. The first partition has OSX on it. The second has all my Applications, and the third one has my files. Can I run fsck on my second partition, even though some applications might be running in the background?
Yes, the system sees them all as separate disks. You can indeed run it on volumes with open files (like open applications), but it's not recommended. If problems are found and filesystem changes are made, you will receive a message to the effect of:

FILE SYSTEM WAS MODIFIED.

YOU ***MUST*** REBOOT IMMEDIATELY.

The bottom line is that it's always safer to run fsck from single user, or while booted from other media (such as a CD). If you're really concerned about filesystem integrity, just enable journaling - even on client, this is the best insurance you can give yourself...and running fsck and disk utilities become a thing of the past.
     
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jan 28, 2003, 09:20 PM
 
One more question. I ran fsck on my volumes, then I enabled Journaling. If I run fsck_hfs -f on the volume again, what will happen? WOuld that cause any problems? I tried it just to see, and it said that it was reparing something, but from some post in other threads it seemed like it was not supposed to repair anything if Journaling is enabled. Can someone enlighten me please.

Thank you,


t
     
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Jan 29, 2003, 09:24 AM
 
Does nayone know why sometimes if you reply to a thread it will not get bumped, and the posters name will not change next to the main topic title? This happens here sometimes at Macnn...anyhow...I am still interested as my post is above, if there can be any problems running fsck_hfs on a Journaled volume. Thank you,


t
     
   
Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2