2 Replies Latest reply: Mar 19, 2008 11:15 AM by lowside
jeamland Level 1 Level 1 (0 points)
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)
  • jeamland Level 1 Level 1 (0 points)
    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.
  • lowside Level 1 Level 1 (0 points)
    I also need the answer to this. For the many of us who are making OSX work in the enterprise, we can't physically go to each computer and hold down shift on reboot. We need to be able to script a safe boot/fsck -y, then reboot back to normal.