Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 06-18-2008, 01:22 PM   #1
seqteq
Prospect
 
Join Date: Nov 2007
Posts: 4
automatic fsck on next boot

Hi, I have a G4 running 10.4.11 that is headless - no keyboard/mouse or monitor, which I'm using as a DVR. I manage it with remote desktop/ssh

Occasionally the power goes out, or I have to hard boot it if it won't come out of sleep (wake for ethernet network administrator access)

I want to run fsck on occasion but I can't boot into single user mode with no keyboard or monitor. Can I schedule an fsck -fy on the next reboot somehow? Kind of like chkdsk /f (schedule chkdsk on next boot y/n) in windows.

Thanks
seqteq is offline   Reply With Quote
Old 06-20-2008, 02:17 AM   #2
seqteq
Prospect
 
Join Date: Nov 2007
Posts: 4
No ideas? Anyone?
seqteq is offline   Reply With Quote
Old 06-20-2008, 05:25 AM   #3
Sherman Homan
All Star
 
Join Date: Oct 2006
Location: Norwell, MA
Posts: 546
I think the problem is that by the time the OS boots far enough to run a script there are so many active, open files that fsck can only verify and not repair. How about a small UPS to protect against power problems? And unless the drive is about to completely fail, you shouldn't need to run fsck that often.
__________________
http://macintoshsolutions.com
Sherman Homan is offline   Reply With Quote
Old 06-30-2008, 09:34 AM   #4
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
Try running the command as a cron task. The crontab is is the /etc/ folder.

@reboot root fsck -fy
kaptagat is offline   Reply With Quote
Old 06-30-2008, 10:22 AM   #5
tlarkin
League Commissioner
 
Join Date: Mar 2003
Location: Kansas City
Posts: 11,347
Well the boot strap goes like this

Power > POST > Firmware > launchd > loginwindow > GUI

Posting a job in /etc will probably get parsed before the OS actually runs. I have never personally tried this. I would also research it since I think running fsck or a journaled HFS+ is not always recommended. You may need to run the fsck_hfs command instead.
tlarkin is offline   Reply With Quote
Old 06-30-2008, 11:03 AM   #6
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
I run the software update command as a cronjob from all our staff machines as root and @reboot and it works fine.

This is for 10.3 & 10.4 machines. For 10.5 I use launchd to call the command on a reboot.

Last edited by kaptagat; 07-01-2008 at 03:04 AM.
kaptagat is offline   Reply With Quote
Old 06-30-2008, 11:10 AM   #7
yellow
Moderator
 
Join Date: Jan 2002
Posts: 10,677
IIRC, during the boot sequence there IS an fsck run automatically at boot, a quick and dirty one called a "preen"?
Happening during the spinning spoked wheel gray apple startup screen?

Maybe this was pre-leopard, where /etc/rc actually existed.

Last edited by yellow; 06-30-2008 at 11:12 AM.
yellow is offline   Reply With Quote
Old 06-30-2008, 12:28 PM   #8
tlarkin
League Commissioner
 
Join Date: Mar 2003
Location: Kansas City
Posts: 11,347
Yeah in 10.5 everything should technically be controlled by launchd
tlarkin is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.