Code Sample |
# A return of 2 or higher means there were serious problems. if [ $RC -gt 1 ]; then echo "$STRING: Failed" echo "*** An error occurred during the file system check." echo "*** Dropping you to a shell; the system will reboot" echo "*** when you leave the shell." export PS1="(Repair filesystem) \# # " sulogin echo "Unmounting filesystems" umount -a mount -n -o remount,ro / echo "Automatic reboot in progress." reboot -f fi |
Code Sample |
# A return of 2 or higher means there were serious problems. if [ $RC -gt 1 ]; then export PS1="(Repair filesystem) \# # " if [ $RC -lt 4 ]; then echo "$STRING: Repaired." echo "*** Reboot required. The system will reboot in 30 seconds." sulogin -t 30 else echo "$STRING: Failed" echo "*** An error occurred during the file system check." echo "*** Dropping you to a shell; the system will reboot" echo "*** when you leave the shell." sulogin fi echo "Unmounting filesystems" umount -a mount -n -o remount,ro / echo "Automatic reboot in progress." reboot -f fi |
Quote |
Lastly, you could edit /etc/fstab to mount the root disk as readonly so that the system doesn't mind if the power is turned off at any time. I didn't do this since the ext3 filesystem seems pretty robust and I might want to update the pictures on the laptop occasionally. |