Sunday, December 19, 2010

Target filesystem doesn't have /sbin/init on Debian Lenny after Upgrade

Apparently this "target filesystem doesn't have /sbin/init" is a common issue with Debian and derivatives such as Ubuntu.  The issue manifested its self after I performed a round of security updates on my server, which included a kernel update.  I think that perhaps what lead me to this particular error was that I use a LVM based Linux software RAID1 for my boot partition.


After trying various fixes, most of which were intended for Ubuntu, here's what worked for me:
  1. I booted the system off the Debian installer CD I originally used and selected "Rescue Mode" in the boot options.
  2. Proceeded through the options, selecting the defaults (network config, time zone, etc)
  3. Selected the option to open a shell at /dev/boot/root (your path might be different)
  4. Ran "lilo" to update the boot sectors on both /dev/sda and /dev/sdb (my RAID drives - LILO detected them automatically).
  5. Rebooted
That's all it took.  I've had issues before during kernel upgrades where I'd get various boot-time error messages.  Again, I think it is due to LVM on software RAID.  Regardless, I'm publishing my fix in the hope this helps someone else out!