[syslinux] installing syslinux on a fresh system (SATA)

Mattias Schlenker ms at mattiasschlenker.de
Mon Jan 13 00:09:01 PST 2014


Am 12.01.2014 21:29, schrieb Mau Z:
> Hi!
>
> It's funny, but I was unable to find an answer to my question.
>
> I am building an embedded system (x86).
> I want to install syslinux on a fresh system.
>
> So, I am booting from a USB LINUX CD (Ubuntu 12.04 in this case).
> 1) I must have an ext2 partition (This is my application).
> 2) I understand that I must have a FAT partition (to install
> syslinux). Correct ?
>
> So, basically I understand that I must create 2 partitions.
> My disk is 4 GB of data, So I am thinking that the following
> partitioning is best :
> 1) 10 MB for syslinux + syslinux.config + bzImage
> 2) 3.99 GB for ext2
>
> Now, remember that I am working on a fresh system (not even formatted maybe).
> Is there a recipe for what I should do ?
>

OK, quick guide for using syslinux/extlinux as bootloader for a fresh 
installed Debian or Ubuntu system:

 1. Partition the hard disk, on drives with 2TB or smaller you might
    want to go with a PC/DOS/MBR partition table. On larger drives a
    GUID partition table. The latter requires some MBR compatibility
    boot partition which is not covered here. The boot partition should
    be large enough to hold two kernels plus to initramfs plus
    configuration files. For Debian/Ubuntu usually 64MB or larger is a
    good size depending on the expected size of the initramfs.
 2. Make the boot partition of type Linux, mark it as bootable or active!
 3. Format the boot partition ext2 or ext3/4 (ext2 suffices), you do not
    need journaling on a boot partition that will just be written onto
    when a kernel gets updated
 4. Copy the BIOS MBR to the hard disks MBR:
    dd if=/path/to/mbr.bin of=/dev/sdx
 5. Now install Debian or Ubuntu using debootstrap, select either to not
    install GRUB or install GRUB to the partition MBR (sdx2) - this way
    you'll get a usable GRUB configuration as a template
 6. Mount the boot partition and make it bootable with extlinux:
    mount /dev/sdx1 /tmp/boot
    mkdir -p /tmp/boot/extlinux
    ./path/to/extlinux --install /tmp/boot/extlinux
 7. Copy the needed com32 files (I usually take "menu.c32",
    "vesamenu.c32", "isolinux.bin", "ifcpu.c32", "ifcpu64.c32",
    "reboot.c32", "chain.c32", "ldlinux.c32", "libutil.c32",
    "libmenu.c32", "libcom32.c32", "liblua.c32", "libgpl.c32") to
    /tmp/boot/extlinux
 8. Copy kernel and initramfs to /tmp/boot/
 9. Write a config /tmp/boot/extlinux/extlinux.conf

Reboot and be happy.

I usually use this method to install servers from a minimal rescue 
system that just good enough to run debootstrap. I prefer using extlinux 
in this case because sometimes BIOS disks are swapped after PXE booting 
the rescue system which would force me anyway to write a boot sector on 
the other hard disk. And I prefer extlinux since it's serial console 
seems to be more robust and easier to configure than GRUB's.

BTW: syslinux is for FAT boot partitions. Use extlinux on ext2/3/4 
anywhere where those filesystems are natively supported!

Regards,
Mattias

-- 
Mattias Schlenker - Redaktion + EDV-Beratung + Linux-CD/DVD-Konzepte
August-Bebel-Str. 74 - 04275 LEIPZIG - GERMANY
  
Bitte fuer geschaeftliche Telefonate vorzugsweise die VoIP-Telefonnummer
+49 341 39290767 verwenden, da ich diese aufs Mobiltelefon routen kann!



More information about the Syslinux mailing list