Booting distros from an external hard disk - a trial
Booting distros from an external hard disk
I know there are problems of booting distros from an USB hard disk so I thought I would wait and let others to sort out all the trouble before coming in to enjoy fruit of their success. Therefore I waited and waited but my patience ran out.
Last weekend I made my second serious attempt to boot some distros off an external hard disk with some degree of success. Here is the write-up on the attempt.
The USB disk is a 200Gb Pata known to Linux as sda. I have disconnected the internal disk temporarily to do the installations. I pre-partitioned the disk with 3 primaries sda1 (1Gb fat16), sda2 and sda3 (25Gb each, sda2 in partition type a5 for ufs filing system and sda3 not used), sda5 as a 1Gb swap, sda6 to sda10 in 10Gb each and the remainder from sda11 to sda15 20Gb each. sda6 to sda15 are partition type 83 for native Linux. I used cfdisk program for the partitioning work.
The installation is no different to the one for internal hard disk except the hard disk name will be the SCSI/Sata type for being a USB disk. The same disk was used internally as a hda before. I just put it into an external hard disk enclosure and hooked it to a PC via a USB cable.
The PC has a MSI KT8 Neo mobo, a AMD64 3000 CPU, 2GB ram, a Nvidia fx5200 video card and onboard Gigabyte nic and sound.
12 installed systems
A SCSI/Sata/USB hard disk can have a maximum of 15 partitions and I used them as follow:-
sda1 : FreeDOS, the only system not installed but ported directly from another disk
sda2 : PcBSD 1.0, the only BSD that works. FreeBSD and Solaris failed.
sda3 : not yet filled
sda4 : extended partition for sda5 to sda15
sda5 : swap partition for all the Linux
sda6 : Slax 4.1.8
sda7 : Mandriva 2007
sda8 : Suse 10.3 alpha1 (booted by FC6 kernel)
sda9 : Fedora Core 6
sda10 : Slackware 11 (booted by FC6 kernel)
sda11 : Ubuntu 7.04
sda12 : PCLinuxOS 2007 test 2
sda13 : Sabayon 3.0
sda14 : Raysx 1.5 (booted by Knoppix kernel)
sda15 : Knoppix 18.104.22.168
All the above 12 installed systems are working normally.
I made the attempt because only recently I discovered the USB legacy support had been disabled all the time and I couldn't get the USB hard disk to boot. When I corrected it I was surprised Mandriva boots without a hitch. Hence I decided to try the big names like Red Hat, Slackware, Suse, Ubuntu, Gentoo and Knoppix
The FreeDos was what left in the disk in a different partition when it was working as an internal disk before. I just migrated it to sda1. It was the first Dos I run from an USB drive.
I tries FeeBSD 6.2, DesktopBSD 1.0, Solaris 10 and PcBSD 1.0. Only the last one was successful. These Unix-like distros need to be installed in the primary partitions of sda2 or sda3. It was a surprise to me PcBSD boots as I wasn't expect any of them would work.
For Linux installation I just used a single partition for each distro and tell each installer to use the single partition to mount the root “/” of the Linux.
The common swap in sda5 was seized by every distro without any intervention from me.
The output of terminal command “fdisk -l” is show below
Linux systems that boot immediately after installation
root@saikee-desktop:~# fdisk -l
Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 122 979933+ 6 FAT16
/dev/sda2 123 3161 24410767+ a5 FreeBSD
/dev/sda3 3162 6200 24410767+ c W95 FAT32 (LBA)
/dev/sda4 6201 24792 149340240 5 Extended
/dev/sda5 6201 6322 979933+ 82 Linux swap / Solaris
/dev/sda6 6323 7538 9767488+ 83 Linux
/dev/sda7 7539 8754 9767488+ 83 Linux
/dev/sda8 8755 9970 9767488+ 83 Linux
/dev/sda9 9971 11186 9767488+ 83 Linux
/dev/sda10 11187 12402 9767488+ 83 Linux
/dev/sda11 12403 14834 19535008+ 83 Linux
/dev/sda12 14835 17266 19535008+ 83 Linux
/dev/sda13 17267 19698 19535008+ 83 Linux
/dev/sda14 19699 22130 19535008+ 83 Linux
/dev/sda15 22131 24792 21382483+ 83 Linux
I found all the distros have no resistance against being installed in a USB external hard disk and the following Linux boot straight way without hestiation:-
Slax 5.1.8, Fedora Core 6, Mandriva Free 2007, Ubuntu 7.04, PCLinuxOS 2007 Test 2, Sabayon 3.0 (representing Gentoo) and Knoppix 22.214.171.124.
Linux systems that failed to boot after installation
Three distros Suse 10.3 Alpha 1, Slackware 11 and Rayslx 1.5 didn't boot after installation with error like panic and not syncing etc.
I believe the proper way to make such distros bootable could require a different ram disk file and possibly a re-compilation of the kernal, all of which are foreign and a lot of work to me at this stage.
Being lazy by birth I thought if distro A can successfully boot from an external disk while distro B can't then what is stopping me from using the kernel and ram disk file from of distro A on distro B. So I tried and had some success.
Suse 9.3 doesn't boot by iteslf. Attempting to boot it with Mandriva and Knoppix kernel also failed but it boots happily with Fedora C6 kernel and initrd.
Slackware 11 doesn't boot by itself. It boots when I substituted the Fedora C6 kernel and initrd.
Rayslx 1.5 doesn't boot by itself too. Fedora and Mandriva sets of kernel and initrd failed to fire it up but those from Knoppix did the trick.
I can't offer any explanation except that a Linux user has enormous amount of choices of kernel and ram disk files at his/her disposal and trying a few ones out can bring an happy ending to the booting problems. I know it is a short term fix and even be regarded cheating but it is perfectly legal in Linux and I have seen some distros offer to multi-boot fellow Linux by this technique.
Boot loader consideration
When installing each system I only allow FC6 to take over the MBR and for the rest of the distros I require each installer to install the boot loader inside the root partition, thereby making each distro “chainloadable” by either Grub or Lilo.
The FC6 menu.lst is shown below
The red bits in the above indicate how I added the absolute partition reference in front of the kernel and initrd statements to “source” another kernels to boot the Linux. If I miss the red bits out Grub will search the vmlinuz and initrd files within the partition specified by the “root” statement.
title Fedora Core (2.6.18-1.2798.fc6) @ sda9
kernel /boot/vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet
title Freedos @ sda1
title PcDOS 1.0 @ sda2
title Slax 5.1.8 @ sda6
title Mandriva 2007 Free @ sda 7
title Suse 10.3 @ sda8
kernel (hd0,8)/boot/vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/sda8 rhgb quiet
title Slackware 11 @ sda10
kernel (hd0,8)/boot/vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/sda10 rhgb quiet
title Ubuntu 7.04 @ sda11
title PCLinuxOS 2007 Test 2 @ sda12
title Sabayon 3.0 @ sda13
title RaysLx @ sda14
kernel (hd0,14)/boot/vmlinuz-2.6.19 root=/dev/sda14 rw ramdisk_size=100000 apm=power-off nomce vga=791
title Knoppix 126.96.36.199 @ sda15
For comparison purpose I list out the relevant menu.lst of the three Linux that can't boot themselves from the USB external hard disk (they boot after kernel and initrd substitutions)
Suse 10.3 menu.lst
Slackware 11 lilo.conf
title openSUSE 10.3
kernel /boot/vmlinuz-2.6.20-2-default root=/dev/disk/by-id/usb-Maxtor_6_Y200P0_68-part8 vga=0x31a resume=/dev/sda5 splash=silent showopts
Rayslx 1.5 menu.lst
boot = /dev/sda
message = /boot/boot_message.txt
timeout = 1200
vga = 773
image = /boot/vmlinuz
root = /dev/sda10
label = Linux
title RAYS LX
kernel /boot/vmlinuz-2.6.15-1-486 root=/dev/sda14 ro vga=785 splash=silent
In attempting to install the 12 operating systems into an external hard disk the following 9 distros boot normally just as though they are in an internal hard disk.
FreeDOS, PcBSD 1.0, Slax 4.1.8, Mandriva Free 2007, Fedora Core 6, Ubuntu 7.04, PCLinuxOS 2007 test 2, Sabayon 3.0, and Knoppix 188.8.131.52
These 3 Linux did not boot initially but fire up if their kernels are replaced by those from other Linux
Suse 10.3 alpha1 (booted by FC6 kernel)
Slackware 11 (booted by FC6 kernel)
Raysx 1.5 which is a Chinese Debian (booted by Knoppix kernel)
I failed to install the following systems : FreeBSD 6.2, Desktop BSD 1.0 and Solaris 10.
The only Linux that I didn't manage to install was Gentoo which reported one of my partitions its installer “dislikes”.
It looks like Debians (Ubuntu and Knoppix), Red Hat (Fedora), Mandrake (Mandriva, PCLinuxOS), Gentoo (Sabayon) and Slax familes distros are USB-disk friendly.
Suse and Slackware are not bootable out of the box from a USB hard disk. They could be overcome by selectively substituting their kernel and initrd files with those from Linux that boot successfully from the same USB hard disk.
Last edited by saikee; 05-03-2007 at 09:26 AM.