Difference between revisions of "What is a SYSLINUX disk ?"

From Syslinux Wiki
Jump to: navigation, search
(Revoked promotion of section title (looks better as level 2))
m (Minor additions and improvements.)
Line 1: Line 1:
Throughout the SYSLINUX wiki, the term '''disk''' is used for
+
Throughout the SYSLINUX wiki, the term '''disk'''  
a storage medium which can host a random-access read-write
+
is used for a storage medium which can host a random-access  
filesystem. Some variant of FAT, to be specific. E.g. FAT32 or FAT16.
+
read-write filesystem.
See also the articles about
+
[[User:Scdbackup#Preparing_a_normal_disk|Preparing a normal disk]]
+
and [[User:Scdbackup#mkdiskimage|mkdiskimage]].
+
  
Nevertheless there is one class of media, which a PC-BIOS will
+
For SYSLINUX, frequently the filesystem is  
normally not operate as SYSLINUX disk, even if they could host
+
some variant of FAT, e.g. FAT32/16/12.
a FAT filesystem. These are the optical disc families of CD, DVD,
+
SYSLINUX can also be installed on NTFS, and
and BD (Blu-ray). PC-BIOS will look on them for an ISO 9660
+
EXTLINUX supports some additional filesystems,
filesystem with additional equipment as provided by [[ISOLINUX]].
+
such as ext2/3/4 and btrfs.
 +
 
 +
There are optical disc (not "disk") families of CD, DVD, and  
 +
BD (Blu-ray). Optical media uses the ISO9660 filesystem, and can
 +
boot by means of "The El Torito" specification, which includes 3
 +
alternative boot modes:
 +
* floppy emulation (using SYSLINUX)
 +
* hard disk emulation (using SYSLINUX)
 +
* no emulation (using ISOLINUX)
 +
 
 +
In addition to real media, regular data files qualify as SYSLINUX
 +
disks if they get prepared with a supported filesystem, typically
 +
FAT. It can include MBR, or GPT, or otherwise be a "partitionless"
 +
media (e.g. floppy).
 +
 
 +
After its preparation, such a data file is called '''disk image'''.
 +
For booting it with real hardware, it usually has to be written onto
 +
a real storage device. e.g. onto a USB pen drive attached to a
 +
Linux system as /dev/sd''X''. (Make sure to use the right device
 +
address and to backup any valuable content of the pen drive before
 +
proceeding.)
 +
 
 +
One possible method to write "my_disk.img" to the "sdc" device is:
  
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.)
 
 
<pre>
 
<pre>
 
dd if=my_disk.img of=/dev/sdc conv=fdatasync
 
dd if=my_disk.img of=/dev/sdc conv=fdatasync
 
</pre>
 
</pre>
  
Nevertheless, there are occasions where disk images files are
+
Nevertheless, there are occasions where disk image files are part  
part of a boot process, without occupying a whole own storage
+
of a boot process, without occupying a whole own storage device.
device.
+
Such case is out of the scope of this article.
  
== Populating disk images by program syslinux on Linux ==
+
== Installing SYSLINUX on disk images under Linux ==
 +
 
 +
The following procedures refer to a disk image with MBR.
 +
 
 +
We need to know the ''start'' address of the partition with the FAT
 +
filesystem:
  
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
 
 
<pre>
 
<pre>
 
/sbin/fdisk -lu my_disk.img
 
/sbin/fdisk -lu my_disk.img
 
</pre>
 
</pre>
tell it by the number underneath "Start". E.g. here it is 32:
+
 
 +
which displays a result similar to:
 +
 
 
<pre>
 
<pre>
 +
Units = sectors of 1 * 512 = 512 bytes
 +
Sector size (logical/physical): 512 bytes / 512 bytes
 +
I/O size (minimum/optimal): 512 bytes / 512 bytes
 +
 
       Device Boot      Start        End      Blocks  Id  System
 
       Device Boot      Start        End      Blocks  Id  System
 
my_disk.img1  *          32      511999      255984    6  FAT16
 
my_disk.img1  *          32      511999      255984    6  FAT16
 
</pre>
 
</pre>
Multiply it by 512. Use the result with mount option -o offset= and with
+
 
syslinux option -t . In this example that would be:
+
In the above result, note the ''start'' address by the number
 +
underneath "<tt>Start</tt>". E.g. 32 sectors.
 +
 
 +
Multiply it by 512 bytes. The result can be used with mount option  
 +
<tt>-o offset=</tt>
 +
and with the <tt>-t</tt> option of the SYSLINUX installer.
 +
 
 +
In this example the respective commands would be:
 +
 
 
<pre>
 
<pre>
 
mount -o loop,offset=16384 my_disk.img /mnt/my_disk_root
 
mount -o loop,offset=16384 my_disk.img /mnt/my_disk_root
Line 50: Line 77:
 
syslinux --directory /boot/syslinux/ -t 16384 --install my_disk.img
 
syslinux --directory /boot/syslinux/ -t 16384 --install my_disk.img
 
</pre>
 
</pre>
An example of disk image production is the
+
 
[[Hard_disk_images|Howto for hard disk images]]. It uses other means
+
== See Also ==
to apply the offset to mount, though. It lets losetup create
+
 
a loop device for the image and another one for the partition.
+
An example of disk image production is the  
A run of syslinux would have to happen on the partition device.
+
[[Hard_disk_images|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 in it.  
 +
As always, the SYSLINUX installer operates on the partition device.
 +
 
 +
See also the articles about
 +
[[User:Scdbackup#Preparing_a_normal_disk|Preparing a normal disk]]
 +
and [[User:Scdbackup#mkdiskimage|mkdiskimage]].

Revision as of 16:13, 29 January 2014

Throughout the SYSLINUX wiki, the term disk is used for a storage medium which can host a random-access read-write filesystem.

For SYSLINUX, frequently the filesystem is some variant of FAT, e.g. FAT32/16/12. SYSLINUX can also be installed on NTFS, and EXTLINUX supports some additional filesystems, such as ext2/3/4 and btrfs.

There are optical disc (not "disk") families of CD, DVD, and BD (Blu-ray). Optical media uses the ISO9660 filesystem, and can boot by means of "The El Torito" specification, which includes 3 alternative boot modes:

  • floppy emulation (using SYSLINUX)
  • hard disk emulation (using SYSLINUX)
  • no emulation (using ISOLINUX)

In addition to real media, regular data files qualify as SYSLINUX disks if they get prepared with a supported filesystem, typically FAT. It can include MBR, or GPT, or otherwise be a "partitionless" media (e.g. floppy).

After its preparation, such a data file is called disk image. For booting it with real hardware, it usually has to be written onto a real storage device. e.g. onto a USB pen drive attached to a Linux system as /dev/sdX. (Make sure to use the right device address and to backup any valuable content of the pen drive before proceeding.)

One possible method to write "my_disk.img" to the "sdc" device is:

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

Nevertheless, there are occasions where disk image files are part of a boot process, without occupying a whole own storage device. Such case is out of the scope of this article.

Installing SYSLINUX on disk images under Linux

The following procedures refer to a disk image with MBR.

We need to know the start address of the partition with the FAT filesystem:

/sbin/fdisk -lu my_disk.img

which displays a result similar to:

Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

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

In the above result, note the start address by the number underneath "Start". E.g. 32 sectors.

Multiply it by 512 bytes. The result can be used with mount option -o offset= and with the -t option of the SYSLINUX installer.

In this example the respective commands would be:

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

and

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

See Also

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 in it. As always, the SYSLINUX installer operates on the partition device.

See also the articles about Preparing a normal disk and mkdiskimage.