Booting from External FireWire Disk [was: Re: Simple 'yes or no' question...]

Tim Seufert yellowdog-general@lists.terrasoftsolutions.com
Mon Jun 23 21:07:00 2003


On Monday, June 23, 2003, at 07:01  PM, Bill Fink wrote:

> Out of curiousity, maybe you know the one bit of magic that has eluded
> me so far about how this actually works.  I know that OpenFirmware has
> support for booting from FireWire, and that enables loading ofboot.b
> and yaboot from the FireWire disk bootstrap partition.  But what I 
> don't
> fully understand is how yaboot loads the Linux kernel and initrd from
> the FireWire disk's ext2|3 root file system.  I can't imagine that
> OpenFirmware knows anything about ext2|3 file systems, or that yaboot
> has a built-in FireWire driver, so I'm not sure exactly what magic is
> performed to bridge that gap.  But it obviously does work.

The e2fsprogs package (fsck.ext2, tune2fs, and all the other ext2 
utilities) has userspace library code for reading, writing, and 
otherwise manipulating ext2 filesystems, given access to the block 
device containing the file system.  yaboot links in that library, or at 
least the portions of it necessary to read files on an ext2 FS.  As for 
the low level access to the disk, yaboot probably just goes through OF 
(OF can remain resident in memory after loading a bootloader).

>> The one hole in this is that I don't think you can label swap
>> partitions.  I don't know what to do about that.
>
> That is a problem although I believe you don't actually require a
> swap partition to boot Linux.

You're right (I've booted without swap).  Nothing bad happens unless 
you run out of memory.

I suppose one somewhat ugly way to do it is to run a script during boot 
that figures out what drive the root partition is on, and activates 
swap on the relevant partition on that drive.  For example the script 
might parse the output of mount, note that / is sde7, and activate swap 
on sde8.

>   Hopefully the kernel does a sanity
> check on the partition before actually using it as swap.  Another
> possibility might be to use a file for swap.

Yes, that might make more sense.  BTW I did a little bit of 
experimentation just now.  swapon will not use a file that has not been 
initialized with mkswap; presumably this holds true for swap partitions 
as well.