chenly,
If you enter into single user mode as suggested by buc99:
Run fsck -y
Be sure to do this one first, it will check the boot volume's file system, and repair if necessary. This probabaly may not be able to fix all problems in a single pass, so if it finds and fixes anything, it'll tell :
"***** FILE SYSTEM WAS MODIFIED *****"
Run it until it doesn't find any more errors.
Other commands to know if you are there:
mount -uw / Remount the boot volume, enabling write access.
SystemStarter Start up more of the system, basically running all of the StatupItems, including networking, NetInfo, NFS, and many background daemons. Doesn't start the Aqua interface; it leaves you with the single-user command line when it's done.
(After running SystemStarter, do not continue the boot with the 'exit' command.)
pico, vi, emacs are available to edit text in single-user mode, although with some minor problems.
nicl -raw /var/db/netinfo/local.nidb For editing the local Netinfo database. Quite handy if the system can't boot properly because of a Netinfo configuration problem.
exit Continue the boot process (go to multi-user mode). But, if you've made any significant changes it's much safer to 'reboot' instead.
reboot Reboot the computer.
shutdown -h now Shut the computer.
In single user mode, the default shell is zsh, while the normal default is tcsh, but you probably will not notice the difference.
Apple's default command aliases arent's set up.
The keyboard is not fully configured in single-user mode. So you get no arrow keys for command line editing or in text editors.
You can use instead, command characters :
^p - previous line, equivalent to up-arrow
^n - next line, equivalent to down-arrow
^b - back a character, equivalent to left-arrow
^f - forward a character, equivalent to right-arrow
(Hold down the control key+ the letter)
Added by a friend:
Also, in single-user mode, you can
% exec tcsh
and get the baseline functionality of the tcsh shell
Cheers...