[syslinux] altmbr.bin always boots the first partition

Maxim Kammerer mk at dee.su
Wed Mar 21 09:22:16 PDT 2012


Hi,

altmbr.bin and its variants apparently always boot the first partition
(in Syslinux 4.05, but this issue seems older than that). The
following example uses parted 3.0:

----------
rm -f flat
mkdir mnt
truncate -s 20M flat
parted -s flat mklabel msdos mkpart primary fat32 1MiB 10485759B
mkpart primary ext2 11MiB 100% unit KiB print

losetup -o 1048576 -s 9437184 /dev/loop7 flat
mkdosfs /dev/loop7
syslinux -i /dev/loop7

mount -t vfat /dev/loop7 mnt
echo LINUX PARTITION-1 > mnt/syslinux.cfg
umount -d mnt

losetup -o 11534336 -s 9437184 /dev/loop7 flat
mkfs.ext2 -q /dev/loop7

mount -t ext2 /dev/loop7 mnt
extlinux -i mnt
echo LINUX PARTITION-2 > mnt/extlinux.conf
umount -d mnt

printf '\002' | cat /usr/share/syslinux/altmbr_c.bin - | dd bs=440
count=1 iflag=fullblock conv=notrunc of=flat

qemu-kvm -nodefaults -sdl -m 4M -vga cirrus -drive file=flat,if=virtio,readonly
----------

Note also that iflag=fullblock above is necessary, yet the wiki misses it.

-- 
Maxim Kammerer
Liberté Linux (discussion / support: http://dee.su/liberte-contribute)




More information about the Syslinux mailing list