Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

force fsck on reboot?

OK, with Leopard inheriting launchd/launchctl for everything (no more RC scripts!) I'm trying to figure out how to force an fsck of a journalled HFS root partition that I only have remote access to.

i.e. It's in another city.

I can see in the logs:
Feb 12 21:24:29 localhost com.apple.launchctl.System[2]: fsck_hfs: Volume is journaled. No checking performed.
Feb 12 21:24:29 localhost com.apple.launchctl.System[2]: fsck_hfs: Use the -f option to force checking.

But I can't find WHERE that fsck is being called from, so I can't really hack it to do an fsck_hfs -fy

Any suggestions?

Mac Pro, Mac OS X (10.5)

Posted on Feb 12, 2008 10:34 PM

Reply
2 replies

Feb 13, 2008 3:51 PM in response to jeamland

OK, this is actually more serious now.

As I understand it, in Tiger, if fsck noticed something (with many UNIX OS's it's like this) the boot would stop, single user mode would start, and an extended fsck would be required.

From Apple's fsck_hfs man page:
[quote]The second form of fsck_hfs preens the specified file systems. It is normally started by fsck(8) run from /etc/rc.boot during automatic reboot, when a HFS file system is detected. When preening file systems, fsck_hfs will fix common inconsistencies for file systems that were not unmounted cleanly. If more serious problems are found, fsck_hfs does not try to fix them, indicates that it was not successful, and exits.[/quote]

Well, I turned off journaling on the partition so that the fsck would be forced. After a MUCH longer boot, I can see this in the system.log:

Feb 12 23:45:47 localhost com.apple.launchctl.System[2]: Invalid directory item count
Feb 12 23:45:47 localhost com.apple.launchctl.System[2]: (It should be 36 instead of 35)
Feb 12 23:45:47 localhost com.apple.launchctl.System[2]: Incorrect folder count in a directory (id = 2)
Feb 12 23:45:47 localhost com.apple.launchctl.System[2]: (It should be 26 instead of 25)

Why is this more serious?

It means that launchd/launchctl, on boot, ran an fsck which produced an error code when checking the boot partition. It then continued booting. In Tiger, /etc/rc.boot would not have continued and would've displayed an appropriate error message, but in Leopard (with launchd/launchctl) this isn't happening!

What if this error resulted in major disk corruption? This sounds very very bad to me!

Any comments/suggestions? I guess what I'm looking for is insight into how the "com.apple.launchctl.System" procedure works and, importantly, how it can be modified.

force fsck on reboot?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.