Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Sometimes I see the Linux kernel being mentioned in the list of upgrades, when running pacman -Syu (updating my packages in Arch Linux). Whenever this happens, after installation of the packages, I can not mount USB drives anymore until I restart. I would just like to know if this is something that is common and expected (and if so, why, do I wonder), or if this is something not expected that I should investigate.

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

Probably, on that distribution, it is normal. It depends on how the package manager installs the new kernel.

I suppose that your package manager (when upgrading the kernel) deletes the old kernel-modules directory immediately. This way, when you try to mount a vfat-formatted usb stick, the kernel will fail to load the needed vfat kernel module.

To verify my supposition, next time you upgrade the kernel, you can check the existence of kernel module directory:

  • before the upgrade, you should find that it exists a directory named as the current (the old) kernel version.

    ~> ls -d /lib/modules/`uname -r`
    /lib/modules/3.0.0-1.2-desktop
    
  • after the upgrade but before the reboot, you should find that the directory does not exist any more (so you cannot manage new hardware).

    ~> ls -d /lib/modules/`uname -r`
    ls: cannot access /lib/modules/3.0.0-1.2-desktop: No such file or directory
    
  • after the reboot, you should find that it exist a new kernel module directory named as the current (the new) kernel version.

    ~> ls -d /lib/modules/`uname -r`
    /lib/modules/3.1.0-1.4
    

To avoid this problem, other distributions (like openSuSE) delay the directory deletion till you reboot.

share|improve this answer
add comment

Yes and no. Ideally a restart would not be required, but it can be a difficult to arrange in practice.

You should be able to continue using types of devices that you've already used in this session. Trouble will come if you try to use a new device type (or filesystem format, or networking protocol, etc.) that requires loading a module. The modules for the new kernel may not be compatible with the running one.

If it's a minor security upgrade that didn't change any binary interface, then new modules will still run. Your distribution must have arranged to compile the new kernel with an indication that binary compatibility was not affected (same uname -r output).

If it's a major upgrade that changed the kernel package version, you can keep both the old package and the new package around until your next reboot. That way modules will still be loaded from the old package.

The problem comes when an upgrade overwrites the existing kernel and modules but changes binary compatibility. Ideally distributions would not do that. If you feel lucky, you can force a module to be loaded with modprobe --force-vermagic --force-modversion; beware that this can and will cause crashes, data corruption and puppy killing if there are indeed binary incompatibilities: use at your own risk.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.