home | codereading | contact | math | misc | patches | tech


Debian troubleshooting

Installing man pages in Debian

By default, debian doesn't come with many useful man pages for development. To install them, do:

# apt-get install manpages-dev

Making a kernel module be loaded before other

This kind of configuration must be done after using /etc/modprobe.d (see modprobe.d(5)) configuration files. However, if those files seem not to be read (even god don't know why), you can put the necessary instructions in the /etc/modules file.

See, for example, this workaround (like in this forum entry) to make elousb module be loaded before the usbhid module:

# We remove the usbhid module, add the elousb module and add the usbhid
# module at last.
-r usbhid
elousb
usbhid

Change default locale

To change default system locale, execute the following command, as root:

# dpkg-reconfigure locales

Problem mounting a partition from a busybox environment

I recently modified the Debian Lenny installer to automated some install tasks. I modified the init script on the initrd to make what I wanted. In this script, I have full access to the busybox binary in /bin (an all the symlinks that point to it).

I then tried to mount a ext3 partition, but got an error:

# mount /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: No such file or directory

I also tried to pass the -t ext3 flag:

# mount -t ext3 /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed: No such device

Weird errors, because /dev/sda1 did exist. After some time wondering why it didn't work, I'd checked lsmod output and discovered that I didn't have ext3 module enabled. modprobe ext3 didn't find the module, because it was not in the initrd. I should have to put it there.

Fortunatelly, installed Debian and its CD's initrd used the same kernel, so I imagined I could use the ext3 module available as a .deb or .udeb on the Debian CD.

After mounting the Debian ISO, I cd'ed the pool/main/l/linux-kernel-di-i386-2.6 directory where I found a file named ext3-modules-2.6.26-2-486-di_1.76lenny5_i386.udeb. Extracted it, and checked extracted files:

$ mkdir /tmp/tt
$ dpkg -x ext3-modules-2.6.26-2-486-di_1.76lenny5_i386.udeb /tmp/tt
$ find /tmp/tt
/tmp/tt
/tmp/tt/lib
/tmp/tt/lib/modules
/tmp/tt/lib/modules/2.6.26-2-486
/tmp/tt/lib/modules/2.6.26-2-486/kernel
/tmp/tt/lib/modules/2.6.26-2-486/kernel/fs
/tmp/tt/lib/modules/2.6.26-2-486/kernel/fs/ext3
/tmp/tt/lib/modules/2.6.26-2-486/kernel/fs/ext3/ext3.ko
/tmp/tt/lib/modules/2.6.26-2-486/kernel/fs/jbd
/tmp/tt/lib/modules/2.6.26-2-486/kernel/fs/jbd/jbd.ko

ext3 is there. There is also a jbd module that is something related to journalling, a dependency for ext3. I had to install both.

Just merge the /lib tree to the initrd's /lib and created a new initrd and a new CD (to create a new initrd, check the Debian Automated Install page.

After booting, it still couldn't find the kernel, even after an explicit modprobe ext3. By diff'ing initrd modules.dep and system's modules.dep, I discovered initrd's /lib/modules/2.6.26-2-486/modules.dep lacked a line that loaded ext3 module. So I added:

/lib/modules/2.6.26-2-486/kernel/fs/ext3/ext3.ko: /lib/modules/2.6.26-2-486/kernel/fs/jbd/jbd.ko /lib/modules/2.6.26-2-486/kernel/fs/mbcache.ko

And created a new initrd. The script, though, had to explicit call modprobe ext3 in order to make this module work. mount, therefore, worked fine.

Cannot run a 32-bit application in a 64-bit environment

If you are trying to run a 32-bit application in a 64-bit Debian or Ubuntu system, you may get errors like:

error while loading shared libraries: libXmu.so.6: cannot +open shared object file: No such file or directory

or like:

error while loading shared libraries: libXXX: wrong ELF class: ELFCLASS64

According to this page, you need to install the ia32-libs package in order to have 32-bit libraries to run your 32-bit programs.

Devices /dev/dsp, /dev/mixer and /dev/sequencer don't exist

You have no sound. Sound tools (like mixers) say that /dev/dsp, /dev/mixer and /dev/sequencer don't exist. Solution: according to Debian SoundFAQ, install the oss-compat package.