I have an old debian system, which I always have been able to upgrade over the years. I had installed an old kernel, compiled by me from sources.

After my last dist-upgrade (using testing distribution), I had a kernel panic at boot. My old kernel and my new libc are not able to work together anymore (I presume).

Even device names are changed: with my latest working kernel, I had /dev/hda and /dev/hdb, now those devices are recognized as /dev/sda and /dev/sdb.

Additionaly, two partitions (/dev/hda2 and /dev/hdb2) were joined in a raid array, which name was /dev/md0 (mounted as root), and now is /dev/md127. Partition /dev/hda1 was mounted as /boot, and /dev/hdb1 was the swap partition.

I used lilo as boot manager.

Now that everything is broken, I tried to use debian rescue mode, without success. I removed lilo and installed grub2, still nothing works.

So I decided to install a new minimal debian system in the old swap partition (/dev/hdb1, now /dev/sdb1) and, from there, I tried to rescue the system.

Still nothing: I can't install a working kernel (this time a precompiled one) in the old partitions. I tried to rebuild my old raid array, mount my boot partition, chroot-ed ant apt-get installed a new kernel: grub is not able to see nothing.

I don't know what else I could try...

  • 1
    Wow, reading this I had to keep checking the date on the question several times! hda -> sda is an expected change, I'd guess about 5 years ago now. The array name change is weird, but not really a huge deal to fix (/etc/mdadm/mdadm.conf should do it, also on initramfs). But... what is the current problem you're trying to fix? I'm having a hard time finding the actual question here. – derobert Jul 25 '14 at 16:19
  • 1
    When you try to install a working kernel, what errors are you getting? What command are you using? Hard to troubleshoot without that... Also, if its a panic, please include the panic messages --- a photo of the screen taken with a smartphone (etc.) is fine. – derobert Jul 25 '14 at 16:37
  • 1
    Once you chroot, you need to mount /boot, /proc, and /sys (A bind mount is simple: mount --bind /sys /chroot/sys). Still need that error message. You run apt-get install linux-image-686 or whatever, and surely it gives some errors. – derobert Jul 25 '14 at 16:40
  • 1
    The bind mount is done from outside the chroot. Whether that's before you run chroot or in a different terminal doesn't matter. – derobert Jul 25 '14 at 16:59
  • 1
    Glad to hear that. Please take the mess of comments, edit them together into a coherent answer, and post it. Maybe it'll help someone who stumbles across it on Google. – derobert Jul 25 '14 at 21:35

the new ATA driver in the kernel use /dev/sda, the old drivers are still supported but you will have to edit your kernel by chrooting into you system using a livecd.

Device drivers --->
 <*> ATA/ATAPI/MFM/TLL support (deprecated)
 <*> Serial ATA and Parallel ATA drivers --->

For chrooting I always use the gentoo minimal installation cd and how to chroot into your system you can read in the gentoo handbook, it should also work with your system. Probably there is an other way for debian users, but this way should work for you two.

I hope this the solution for your problem.


As derobert pointed out, hda -> sda is an expected change since a long time.

The raid array name change was weird, but it resolved itself in the end.

I tried to boot from a live cd distribution, mount the raid array, mount the boot partition, then apt-get install the new kernel. This procedure produced an error because I didn't know that I should have mounted /boot, /proc and /sys.

So the exact procedure is:

  • boot from a live distribution (debian CD 1 in rescue mode is ok)

  • mount the root partition (in /chroot, for example) and, eventually, the boot partition, if different from root)

  • bind mount the special devices:

    • mount --bind /sys /chroot/sys
    • mount --bind /proc /chroot/proc
    • mount --bind /dev /chroot/dev
  • chroot to the root partition

  • install the new kernel

  • reboot

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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