Include:Parted BIOS with MBR mode with DOS disklabel

From Alpine Linux
This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Prabuanand on 14 Jan 2025.)

We'll be partitioning the storage device using parted utility to have a /boot partition for use with the Syslinux bootloader. Syslinux is meant for use with legacy BIOS and an MSDOS MBR partition table. The root partition in this example takes up the entire remaining space. This can be changed suitably.

Syslinux does support GPT partition tables but GRUB2 is the better option for UEFI (UEFI is possible only with GPT).

+---------------------------+------------------------+-----------------------+
| Partition name            | Partition purpose      | Filesystem type       |
+---------------------------+------------------------+-----------------------+
| /dev/sda1                 | Boot partition         | ext4                  |
| /dev/sda2                 | Root partition         | ext4                  |
+---------------------------+------------------------+-----------------------+
Warning: This will delete an existing partition table and make your data very hard to recover. If you want to dual boot, stop here and ask an expert.


To create a Boot partition of approximately 100MB to boot from,

# parted -a optimal
(parted) mklabel msdos
(parted) mkpart primary ext4 0% 100M
(parted) set 1 boot on
(parted) mkpart primary ext4 100M 100%

To view your partition table, type print while still in parted. Your results should look something like this:

(parted) print
Model: ATA TOSHIBA ******** (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  99.6MB  98.6MB  primary  ext4         boot
 2      99.6MB  1000GB  1000GB  primary  ext4