Ubuntu: External ATA, IDE, or SATA Controllers

  • warning: include(/tmp/fortune.txt): failed to open stream: No such file or directory in /home/mohawksoft/org/www/htdocs/includes/common.inc(1696) : eval()'d code on line 1.
  • warning: include(): Failed opening '/tmp/fortune.txt' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/mohawksoft/org/www/htdocs/includes/common.inc(1696) : eval()'d code on line 1.

If you have extra hard disk controllers like a Promise card, Silicon Image, or Adaptec you may find yourself unable to boot your system after installing the card or upgrading to a new version of Ubuntu or Kubuntu. This is because of the way the Linux kernel finds new hard disks at boot time. It has to enumerate the hard disks and assign them device names like /dev/hda, /dev/hdb, /dev/hdc, etc.

The Ubuntu or Kubuntu guys have really mucked this process up, and across the last three distributions I have tried, from breezy to dapper to edgy I have found it almost random as to if a system will boot after upgrade or installation of additional IDE, ATA, or SATA controllers.

The solution to this problem is a bit tedious, but serviceable, by using disk labels. By labeling a disk, you can tell Linux to use specific disks regardless of how they are enumerated. Oddly enough, “Edgy Eft” almost does this, but not quite, by using UID strings in the /etc/fstab file, but does not use this in the kernel boot string in /boot/grub/menu.lst.

Step one: Remove all additional hard disk controllers or boot off a liveCD or something to get to a working system.

Step two: Label the disk partitions you want to use. e2label for ext2 and ext3, jfs_tune for jfs file systems, xfs_admin for xfs file systems, you'll need to recreate the swap partition to add a label using mkswap. use “man PROGRAM” for specifics. Using the program needed, label the partitions you have to have to boot, like root and swap, like this:
e2label /dev/hda1 root0
mkswap -L swap0 /dev/hda5
Remember your device names may be different, just make sure you choose the right ones.

Step three: Edit /etc/fstab to remove any variable names, mine looks like this:
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
LABEL=root0 / ext3 defaults,errors=remount-ro 0 1
LABEL=media0 /vol01 jfs defaults 0 1
LABEL=swap0 none swap sw 0 0
/dev/hdg /media/cdrom0 udf,iso9660 user,noauto 0 0

Step four: Edit /boot/grub/menu.lst to make sure that the ROOT parameter on the kernel load line is set to the disk label and not a hard device name. Mine looks like this:
kernel /boot/vmlinuz-2.6.17-10-generic root=LABEL=root0 ro quiet splash

Step five: Reboot and it should work fine.