This article is from the Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems. Maintained by David C. Merrill with numerous contributions by others. (v1.0).
A: You did create an emergency floppy (or floppies), right? Reboot from an emergency floppy or floppy pair. For example, the Slackware boot and root disk pair in the install subdirectory of the Slackware distribution.
A: There are also two, do-it-yourself rescue disk creation packages in ftp:// metalab.unc.edu/pub/Linux/system/recovery/. These are better because they have your own kernel on them, so you don't run the risk of missing devices and file systems.
Get to a shell prompt and mount your hard disk with something like
$ mount -t ext2 /dev/hda1 /mnt
Then your file system is available under the directory /mnt and you can fix the problem. Remember to unmount your hard disk before rebooting (cd somewhere else first, or it will say it's busy).