Tips, Tricks, and Troubleshooting


The following sections contain a collection of tips and tricks that you can use to troubleshoot the boot process or to customize your Knoppix environment.

Blank Screen: Now What?

Remember the scenario described in the opening paragraph of this appendix? Your CD worked just fine on a friend's computer, yet when you put the same CD in your machine all you see is a blank screen. What's going on?

There could be a number of reasons why you're getting a blank screen, but they depend on where in the process you get it. To determine that, boot with this command:

 knoppix vga=0 debug -b 3 

Do you get to the bootloader phase? If not, you may want to explore some of the options mentioned in the section "Examining the Bootloader Phase," earlier in the appendix. If you get past the bootloader phase, how far do you get into the text phase? If you do not get to stage 1, the most common problems seem to be issues with VGA settings, power settings, and PNP BIOS, as mentioned earlier. Reboot your machine and try booting with this command:

 knoppix vga=normal noapic noacpi pnpbios=off acpi=off noapm image from book    debug -b 3 

If that doesn't work, then, as mentioned before, you can turn off several more options using

 failsafe debug -b 3 

Once you get to a shell prompt, enter cat /proc/cmdline to see the text of the successful boot command line. You can optimize your boot command by methodically removing the cheatcodes that failsafe uses:

atapicd

nosound

noapic

noacpi

pnpbios=off

acpi=off

nofstab

noscsi

nodma

noapm

nousb

nopcmcia

nofirewire

noagp

nomce

and nodhcp.

  

Once you get into textmode, try getting into graphics mode by changing the runlevel using this command:

 init 5 

Are you able to get into graphics mode? If not, there are a couple of things to try. First, get back into text mode by pressing Ctrl+Alt+F1 to get to virtual console 1 and then enter init 3. You may have to press Enter once or twice before the prompt appears. The most common problem seems to be that Knoppix guesses the wrong video driver. You can tell what driver Knoppix will try by entering the following:

 grep -i ^x /etc/sysconfig/knoppix 

If for some reason the driver specified by the XMODULE= line does not allow the xserver to start, Knoppix tries the vesa driver followed by the fbdev driver before giving up. If you don't want Knoppix to guess, you can explicitly tell Knoppix to use a different driver. To do that, simply reboot and specify the driver at the boot prompt, like this:

 boot: knoppix xmodule=fbdev 

In addition to the xmodule= cheatcode, you may want to try out other cheatcodes that take effect in the graphics phase.

If you still have trouble booting Knoppix, you might have very new hardware, very old hardware, or very esoteric hardware. If so, post your question as well as a description of your hardware (using a command such as lspci) to the Knoppix forums, which can be accessed at http://www.knoppix.net/forum/.

Testing Various xmodule= Cheatcodes Quickly

You don't have to reboot to try out different xmodules. You can simply change runlevels and make adjustments to /etc/sysconfig/knoppix. To try this out, press Enter at the boot prompt to boot Knoppix using the defaults. When Knoppix finishes booting, change to VC 1 with Ctrl+Alt+F1 and enter runlevel 3 with init 3. To see what driver Knoppix used, type:

 grep -i driver /etc/X11/XF86Config-4 

Let's say that Knoppix chose "savage" as the driver, but you want Knoppix to use the fbdev driver. To do so, type these commands:

 echo 'XMODULE="fbdev"' >> /etc/sysconfig/knoppix rm /etc/X11/XF86Config-4 mkxf86config init 5 

Knoppix will now try the fbdev driver. To try another driver, change to VC 1 with Ctrl+Alt+F1, and repeat the steps. Once you find one that works better than what Knoppix guessed, you can use it at the boot prompt like so:

 knoppix xmodule=fbdev 

Rebooting Quickly Very Quickly

Want Knoppix to reboot quickly? Just press Alt+SysRq+B (SysRq is the same key as the PrintScr key). This key combination is effectively the same as pressing the reset button on the machine. That is, your system reboots immediately without flushing the cache or unmounting the disks. Unless you tell Knoppix otherwise, it doesn't try to mount any drives until after stage 4 in the text phase. Until then, using Alt+SysRq+B is quite safe. After that stage, however, you need to be sure that you don't have any disks mounted. If you are not sure, do not use Atl+SysRq+B.

Testing Various vga= Cheatcodes Quickly

While vga=0 or vga=normal always works, your video card may be able to do more. You can test these extended video modes fairly quickly with the vga= and debug cheatcodes shown in the following table:

Colors

640x480

800x600

1024x768

1280x1024

256

769

771

773

775

32k

784

787

790

793

60k

785

788

791

794

16M

786

789

792

795

For example, to test out 800 × 600 with 256 colors, boot with

        failsafe debug vga=771 

If the screen goes black, press Alt+SysRq+B to quickly reboot the machine and try another value for vga=. Conversely, if you get to stage 1 of the text phase and like what you see, simply enter exit to continue the boot process. If you want to try other vga= codes, just press Alt+SysRq+B to reboot the machine (but remember not to use that command if your machine has mounted disks).

Quickly Changing Desktop Managers

If you've already booted into a desktop such as KDE, you can change desktops by changing to a text virtual console (such as Ctrl+Alt+F1) and issuing these commands:

       init 3       echo 'DESKTOP="icewm"' >> /etc/sysconfig/desktop       init 5 

This example changes your desktop to the Ice Window Manager.

Using Multiple Persistent Disk Images

Suppose you have two persistent disk images (which you learned to make in the Introduction to this book) on /dev/hda2knoppix.java.img and knoppix.lamp.img, and you want to boot using the Java image. Here's what to do:

 knoppix -b 

When Knoppix enters stage 4 (emergency mode) in the text phase, enter the following:

 rebuildfstab mount /mnt/hda2 ln /mnt/hda2/knoppix.java.img /mnt/hda2/knoppix.img umount /mnt/hda2 exit 

When booting continues, confirm that you want to activate the image at /dev/hda2/ knoppix.img by selecting OK.

If you want to use the lamp image when you reboot, repeat the same steps as before, but substitute the lamp image for the Java image:

 ln /mnt/hda2/knoppix.lamp.img /mnt/hda2/knoppix.img 

If /dev/hda2 happens to be a vfat partition or some other filesystem that does not support linking, substitute the cp command for the ln command.

Playing DVDs or Audio CDs with Only One CD/DVD-ROM Drive

It's hard having only one CD/DVD drive if you want to play a DVD or audio CD while you're working with Knoppix. Here's a great workaround if you have Windows on /dev/ hda1: Boot into Windows and download a copy of the Knoppix ISO to your C:\ drive, name it C:\knx.iso, and reboot with the Knoppix CD generated from that same ISO. At the boot prompt, enter

 knoppix bootfrom=/dev/hda1/knx.iso 

Once Knoppix boots, you can remove the CD from the CD/DVD-ROM drive and happily insert your CD/DVD.

If you have more than one gigabyte of RAM, you could use toram:

 knoppix toram 

This copies the ISO into RAM and then continues the boot process from the image that's in RAM, enabling you to eject the CD.

This tip works as long as /dev/hda1 contains a supported filesystem: ext2, ext3, reiserfs, vfat, or ntfs. If you have a vfat or ext2 partition, you also can use the tohd= cheatcode:

 knoppix tohd=/dev/hda1/ 

It does a "poor-man's install" by copying all the files in the compressed image to the hard drive. After you've done this once, you can boot with this command:

 knoppix fromhd=/dev/hda1/ 

Finding Undocumented Cheatcodes

There are basically three files that process cheatcodes:

  • /linuxrc

  • /etc/init.d/knoppix-autoconfig

  • /etc/init.d/xsession

In each, grep for cmdline:

 grep -i cmdline /etc/sysconfig/knoppix-autoconfig 

or view the script with less:

 less -iXS# 10 +/cmdline /etc/sysconfig/knoppix-autoconfig 

If you want to explore the script /linuxrc, you have to copy it to /tmp/ before Knoppix leaves stage 3 of textmode. When Knoppix leaves stage 3, /linuxrc is deleted and less is not very functional until after stage 4. Alternatively, you can extract the script from the initial compressed ramdisk:

 cd /tmp mkdir /tmp/minirt zcat /cdrom/boot/isolinux/minirt.gzminirt.img mount -o loop minirt.img minirt cp minirt/linuxrc . umount minirt 



Hacking Knoppix
Hacking Knoppix (ExtremeTech)
ISBN: 0764597841
EAN: 2147483647
Year: 2007
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net