What is a SYSLINUX disk ?

From Syslinux Wiki
Revision as of 08:53, 25 January 2014 by Scdbackup (talk | contribs) (New Article "What is a SYSLINUX disk ?")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What is a SYSLINUX disk ?

Throughout the SYSLINUX wiki, the term disk is used for a storage medium which can host a random-access read-write filesystem. Some variant of FAT, to be specific. E.g. FAT32 or FAT16. See also the articles about Preparing a normal disk and mkdiskimage.

Nevertheless there is one class of media, which a PC-BIOS will normally not operate as SYSLINUX disk, even if they could host a FAT filesystem. These are the optical disc families of CD, DVD, and BD (Blu-ray). PC-BIOS will look on them for an ISO 9660 filesystem with additional equipment as provided by ISOLINUX.

On the other hand, regular data files qualify as SYSLINUX disks if they get prepared with a partition table and a FAT filesystem. After the preparation, such a data file is called disk image. For booting it with real hardware, it usually has to be copied onto a real storage device. E.g. onto a USB pen drive attached to a Linux system as /dev/sdc. (Make sure you use the right device address and backup any valuable content of the pen drive.)

dd if=my_disk.img of=/dev/sdc conv=fdatasync

Nevertheless, there are occasions where disk images files are part of a boot process, without occupying a whole own storage device.

Populating disk images by program syslinux on Linux

For populating a disk image file by help of the Linux version of the syslinux command, you need to know the start address of the partition with the FAT filesystem. Let

/sbin/fdisk -lu my_disk.img

tell it by the number underneath "Start". E.g. here it is 32:

      Device Boot      Start         End      Blocks   Id  System
my_disk.img1   *          32      511999      255984    6  FAT16

Multiply it by 512. Use the result with mount option -o offset= and with syslinux option -t . In this example that would be:

mount -o loop,offset=16384 my_disk.img /mnt/my_disk_root


syslinux --directory /boot/syslinux/ -t 16384 --install my_disk.img

An example of disk image production is the Howto for hard disk images. It uses other means to apply the offset to mount, though. It lets losetup create a loop device for the image and another one for the partition. A run of syslinux would have to happen on the partition device.