Depmod and Linux love/hate

This is a reminder to myself. Rather simple, really.

If no USB devices show up with lsusb, then run depmod.

The story here is pretty simple. I wanted to scan something, but the scanner software couldn't see my scanner. I searched /dev for scanner devices, and found one. I did "lsusb", and found nothing. My next step, foolish me, was to install new drivers, using a package from Hewlett-Packard that looked fairly safe. The install proceeded cleanly, until it tried to probe for the scanner… it couldn't find it.

My next step? Reboot. And… kaboom. Graphics, ethernet, and even some of my disk partitions, gone. Panic time. My first thought was, what has HP done to my system? But apt said the package database was clean. I searched through the kernel modules, they were all unchanged. Nothing funny in /etc/init.d either. The HP drivers seemed to be completely in userspace. Well, that's nice, but why wasn’t my system working? I reinstalled the video drivers. Reboot. No change. Boot into safe mode, and see lots of odd stuff… ext2 driver is missing? That would explain the missing partitions. I try to manually load some modules with "modprobe", but none of them are found. Maybe the hard drive is corrupt. Finally (after losing over an hour) I thought to myself, maybe there is nothing wrong with my system, after all. I ran "depmod", rebooted, and… everything came up! I did my scan, life is good.

So, that is why I love and hate Linux. It can be easy to mess things up, but everything is open for viewing and, generally, whatever goes wrong can be fixed. I still have no idea why the module dependency database was erased. I know that the only reason my machine even stayed bootable afterwards was because the most important modules were in the initrd.

I cannot help but think, what if something similar were to happen to my MacBook? I would probably be up the creek with no paddle. Or maybe I would find out that fiddling with Mac internals is not so bad. I am not eager to find out.