[SLUG] Re: Bootable Linux Floppy -- copying is easy, booting in another matter ...

From: Bryan J. Smith (b.j.smith@ieee.org)
Date: Tue Sep 28 2004 - 05:25:49 EDT


On Mon, 2004-09-27 at 23:00, Chuck Hast wrote:
> Folks,
> I thought I had sent a note to the list about this but do not see it in my sent
> mail.
> Anyhow, just in case I have a bootable linux floopy that has some apps
> on it, I want to move it to a HD or preferably a CF card so I can add more
> "stuff" to it. I am trying to figure out how to do it but this is out
> of the areas
> I am really familiar with.
> The floppy uses syslinux to boot it. All I want to do is replicate it on a
> larger disk in order to work with it and then move it to a CF card so I can
> use it as a specialized router. I have CF cards of 64, 128 and 256M in
> size so I am not too worried about not having enough space to run the
> stuff on it.

Taking the boot sector out of the equation, it is straight-forward to
replicate any device/filesystem from one device to another. Just mount
the two devices:
  # cd /mnt/floppy; find . -mount | cpio -pmdv /mnt/(newdev)

This should be your _last_ step in any process. I.e., you may need to
create any disk labels (partition tables) and format any filesystems
(partitions) first.

Now if you want it to be bootable, you'll need to address any filesystem
and/or bootstrap constraints. That's a bit more involved, and varies
between hard drives and most solid state devices.

- SYSLINUX requires a FAT12 or FAT16 filesystem

For a hard drive, this is as easy as slicing (partitioning) a FAT16
(type 04h if under 32MB, type 06h if under 2GB, type 0Eh if 255/63
heads/sectors geometry is used). Then format that slice (partition)
with the FAT16 filesystem. E.g., assuming the first slice (partition)
on the primary/master:
  # mkfs.vfat -F 16 /dev/hda1
                            ^ Slice (partition)

For solid state media, it may be even more simple, as there is typically
no disk label (partition table), just like a floppy. Although the
device may come pre-formatted with FAT32 and you'll need to format
otherwise. E.g., assuming SPB to mount the solid state storage device
as a SCSI medium:
  # mkfs.vfat -F 16 /dev/sda
                            ^ No slice (partition)

FYI, the solid state device _may_ use the new usbdevfs (/dev/usb/*)
instead, depending on your kernel, device, etc... The "old way" for USB
was to leverage the same SPB storage approach of FireWire, mapping into
a SCSI disk device.

- Copying the SYSLINUX bootstrap

Now this may be an issue. Normally you should use the SYSLINUX** suite
to create the bootstrap on any device:
  http://syslinux.zytor.com/faq.php

Why? Because different devices vary in the size of their sector size.
Hard drives are always 512 bytes. Some floppies are 1KB, others are
2KB, a few are 512 bytes. Solid state devices vary as well.

If you don't want to use SYSLINUX, you can try copying the bootstrap
"raw" and see what happens.

For hard drives, assuming the first slice on the primary/master:
  # dd if=/dev/floppy of=/dev/hda1 bs=512 count=1 conv=notrunc

For solid state media, assuming SPB to mount:
  # dd if=/dev/floppy of=/dev/sda bs=512 count=1 conv=notrunc

- SPB-Linux Project

Another project you may want to check out is SPB-Linux, which is a
minimal distribution designed for USB/FireWire attached storage.
  http://www.8ung.at/spblinux/

I'm sure it's not the only project out there, but it uses SYSLINUX
because most solid state devices are formatted FAT16.

-- 
Bryan J. Smith                                  b.j.smith@ieee.org 
------------------------------------------------------------------ 
"Communities don't have rights. Only individuals in the community
 have rights. ... That idea of community rights is firmly rooted
 in the 'Communist Manifesto.'" -- Michael Badnarik

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:11:41 EDT