Klaus Knopper answers your Linux questions

Ask Klaus!


Klaus Knopper is the creator of Knoppix and co-founder of LinuxTag expo. He currently works as a teacher, programmer, and consultant. If you have a configuration problem, or if you just want to learn more about how Linux works, send your questions to: klaus@linux-magazine.com

Eee PC SD Card Failure

Question:

I installed Knoppix 6.2 to a 4GB SD card for booting on an Asus Eee PC 701, but booting fails with this error message:

insmod: can't open '/mnt-sytem/KNOPPIX/modules/cloop.ko', no such file or directory

I'm quite sure the file is there. Why can't it be read?

Answer:

The compressed loopback device module is one of the first files read from the medium containing the KNOPPIX directory. If you can see the file KNOPPIX/modules/cloop.ko on the system where you did the flash installation, the problem might be different from what the error message suggests: Some Eee PC 701 models (and probably other notebooks, too) cannot handle SDHC cards of some manufacturers.

Reading the directory contents usually works, but as soon as writing a file is attempted - or even in random cases, reading successive files - data transfer becomes unreliable and the usb-storage driver starts printing "read/write" errors or even "device resets." Because the cardreader cannot be exchanged easily, you might succeed with an SD card from a different brand. Unfortunately, no general rule can tell you which ones are compatible.

A workaround could be using the SD card with a USB-attached, instead of the built-in, cardreader.

Knoppix Keyboard Catch

Question:

Klaus: The new Knoppix 6.3 is quite something! My most advanced machine runs Windows 2000 very nicely, but until now, I haven't found a Linux that is stable on it (most will not even install, only Slackware and Fedora 12, both of which are very fragile). Knoppix 6.3 is quite stable, I would love to be able to use it.

Why not? Because the DVD lists "cheat codes" for 14 languages, but not English! In Table 1 of your descriptive article is listed 'lang=en' but although the actual language defaults to English, it doesn't give me a UK keyboard. Even the distros that don't work on this system give me a UK keyboard on my other machines where they do work. When can we have a patch? Roger Giles

Answer:

I wonder why you are using the German version and switching to English manually, because there is an English version in the English-language Linux Magazine. However, you can set the system language AND the keyboard - for the graphical desktop as well as the console - with the following cheatcode:

knoppix lang=en xkeyboard=us keyboard=us

(uk may work as well).

If you create a flash disk installation, you can add this cheatcode to the APPEND lines in the boot/syslinux/syslinux.cfg file.

In theory, lang=en alone should also set the keyboard. I'm trying to find out for the next release why this ceased to work. It could be related to the new Xorg version installed on Knoppix 6.3, which does the keyboard handling via HAL instead of the old xorg.conf static configuration.

Partition Access of File Dump

Question:

I just rescued my data from a partly defective hard disk by creating a dump of the entire disk like this:

dd_rescue -A /dev/sda sda.img

Now, instead of copying the image sda.img to a new disk, I would like to mount a partition contained in the file. But how can I access partitions within a disk dump file?

Answer:

It's easy: by using the loopback device loop together with mount. To begin, you have to do some math to find out where the actual partition starts (Listing 1).

Listing 1: Calculate Start of Partition
01 knopper@eeepc:~$ fdisk -u -l sda.img
02 You must set cylinders.
03 You can do this from the extra functions menu.
04
05 Disk sda.img: 0 MB, 0 bytes
06 49 heads, 48 sectors/track, 0 cylinders, total 0 sectors
07 Units = sectors of 1 * 512 = 512 bytes
08 Disk identifier: 0x20f398ec
09
10   Device Boot      Start         End      Blocks   Id  System
11 sda.img1   *        8192     7744511     3868160    c  W95 FAT32 (LBA)
12 Partition 1 has different physical/logical beginnings (non-Linux?):
13      phys=(1, 2, 3) logical=(3, 23, 33)
14 Partition 1 has different physical/logical endings:
15      phys=(960, 48, 48) logical=(3292, 35, 48)

Just ignore for a moment the message that says you should set cylinders (which makes no sense on a file). The essential information here is the start of the first partition, which is given in sectors (as opposed to cylinders) - 512-byte sectors - because of fdisk`s -u option. So here, the start of partition 1 would be

8,192 x 512 = 4,194,304

bytes from the file's beginning; thus:

mkdir sda1
sudo mount -o loop,offset=4194304,ro sda.img sda1

Usually, you don't explicitly need to tell the filesystem to mount (which would be -t vfat in this example, guessing from the partition type shown).

The content of the first partition will now be shown (read-only because of mount option ro) in the newly created directory sda1.

If you would like to umount the partition later, use:

sudo umount -d sda1

The -d option tells umount to detach the file from the loopback device as well; otherwise, you will have to use:

sudo losetup -d /dev/loop1

Find the appropriate loopback block device instead of /dev/loop1 to free all references to the image file.

DHCP Server in SUSE

Question:

Hi Klaus: I wonder if you could perhaps indicate a quick fix. I installed SUSE 11.2 from the DVD that came with Linux Magazine Feb 2010. But for some reason under YaST | Network Services, the DHCP Server icon doesn't show up. How can I add a DHCP server icon under YaST? DHCP is essential on the servers I am setting up here. Regards, Neil

Answer:

First, you have to install the DHCP server packages, which are not needed if you just run your computer with automatic network configuration as a DHCP client.

To do this inside YaST's Software Manager, select the dhcp-server and yast2-dhcp-server packages (you need both). After package installation, restart YaST, and you should find the DHCP Server icon in the Network Services section.

New NTLDR Masks Linux OSes

Question:

Hello Klaus: I have installed four operating systems on my PC in the following order:

  1. Fedora Core 4
  1. SUSE Linux 10
  1. Windows XP
  1. Xandros

When the system starts, it loads the Xandros LILO, which gives me an option to select Windows or Xandros from Windows NTLDR. I will navigate to SUSE and Windows. From SUSE's LILO I was able to navigate to Fedora and Windows.

Unfortunately, my Windows system crashed because of a virus, and the computer engineer has installed Windows again, which has installed the new NTLDR without detecting other operating systems. Now I am not able to use any Linux system since NTLDR was replaced. Is there any chance for me to retrieve the way to other operating systems without causing any damage to my data in Windows? Regards, Sathish C

Answer:

I think the safest and easiest method is installing GRUB as a master boot record bootloader for different operating systems, rather than modifying the Windows bootloader. You have to choose a partition holding the files for GRUB, including the boot menu, though. Whenever you format this partition, you will have to reinstall the bootloader (which is not a big deal).

You can boot one of your installed Linux versions, maybe using the "Rescue mode" of your installation DVD and then switching to a rescue console at the right time. Or use a Live CD. The method I'll use here should work either way.

From the booted Linux system, check the name of the primary hard disk device. In most cases, this will be /dev/sda, or /dev/hda for IDE hard disks using the older IDE driver. I will use /dev/sda as an example.

  1. Mount the Linux partition where you want to install GRUB's boot files first, writable.
  1. The command for installing the GRUB bootloader as root is now
    grub-install --root-directory=/path/to/mounted/linux/partition/dev/sda
    where the root-directory parameter refers to the mountpoint you used in step 1. The grub-install command copies some files to directory boot/grub in that directory.
  1. Finally, you need to add the menu entries into the menu file (menu.lst) autogenerated for GRUB, containing the names and locations of all the desired operating systems in the same directory. It should look like Listing 2.

After modifying menu.lst, don't forget to unmount the boot partition so your changes are written to disk.

If you forgot something, menu.lst is quite easy to modify.

Listing 2: Menu Entries in menu.lst
01 title         Windows 95/98/NT/2000
02 root          (hd0,0)
03 makeactive
04 chainloader   +1
05
06 title         Fedora Core 4
07 root          (hd0,1)
08 kernel        /boot/vmlinuz-2.6.33 root=/dev/sda2 quiet ro
09 initrd        /boot/initrd-2.6.33.img.gz
10
11 title         Xandros
12 root          (hd0,2)
13 kernel        /boot/vmlinuz-2.6.32 root=/dev/sda3 quiet ro
14 initrd        /boot/initrd-2.6.32.img.gz
15
16 ?

Mouse Button Doesn't Click

Question:

I have an HP Mini 210 notebook, which has a touchpad that has an integrated mouse button function, no real buttons. Mouse clicks do not seem to work on Linux. Is there a workaround?

Answer:

This touchpad uses a special protocol ("extended ps2") that generates mouse clicks by fingertips on pad areas. If the psmouse module is statically compiled into the kernel, you can activate the pad-click feature by boot option: psmouse.proto=exps (placed into the APPEND or KERNEL line of your bootloader's config file). If your distribution loads the psmouse driver as a module, use this command as root to add a module option file for the psmouse module:

echo "options psmouse proto=exps" > /etc/modprobe.d/psmouse.conf

To activate this option immediately (all programs that use the mouse device need to end first), you could use

rmmod psmouse
modprobe psmouse proto=exps

and then restart the Xorg Server.