Previous Section  < Day Day Up >  Next Section

Recipe 13.9. Editing Configuration Files from Knoppix

13.9.1 Problem

Someone with more confidence than knowledge (maybe even you) "fixed" something in a configuration file and now the system won't boot. You need to fix it. But how do you edit a file on a machine that won't boot?

13.9.2 Solution

This is a perfect job for Knoppix. You can open and edit any file on a PC from Knoppix.

Boot up your Knoppix disk to KDE. Right-click the icon on the desktop for the filesystem you want to use, left-click "Mount," then left-click "Change read/write mode."

Open a root shell, then navigate to the file you want to edit and open it with the editor of your choice:

knoppix@ttyp0[knoppix]$ su

root@ttyp0[knoppix]# cd /mnt/hda3/etc

root@ttyp0[etc]# kate inittab &

Now you can edit the file, just as you normally would.

It's easy to become confused over whether you are in Knoppix or your PC's filesystem. Check with pwd:

root@ttyp0[etc]# pwd

/mnt/hda3/etc

Remember that the filesystems on your PC's hard drives are all mounted under /mnt in Knoppix.

13.9.3 Discussion

Knoppix comes with a variety of window managers: larswm, IceWM, XFce, Windowmaker, Fluxbox, and TWM. But only KDE comes with the Knoppix menu and desktop icons for all of your partitions.

Just like with any Linux, you can also do everything from the console. To mount a filesystem as readable/writable, use:

root@ttyp0[knoppix]# mount -o rw /mnt/hda3

To open a file for editing, use:

root@ttyp0[knoppix]# vim /mnt/hda3/etc/inittab

Knoppix autodetects your filesystems and partitions and creates an /etc/fstab file, so you can look in there to find mountpoints.

13.9.4 See Also

    Previous Section  < Day Day Up >  Next Section