[syslinux] syslinux installation problem

Shao Miller sha0.miller at gmail.com
Sun Nov 4 00:46:23 PDT 2012


On 11/4/2012 02:40, Alexei Babich wrote:
> Hey, guys.
> I have a problem when installing syslinux 4.06, and I'd be grateful if someone could tell me how to solve the problem.
> My task - to install the bootloader on the virtual machine image. The image contains the MBR and the only partition with the file system ext4. The file system contains all the files for the guest OS.
> To install bootloader into the image of the guest OS, I use the following procedure (guest OS is not running):
> 1. losetup -f --show /tmp/guest_os.img               #map guest OS image to, e.g., /dev/loop0. So, "file -s /dev/loop0" shows: "/dev/loop0: x86 boot sector; partition 1: ID=0x83, starthead 32, startsector 2048, 2095104 sectors, extended partition table (last)\011, code offset 0x0"
> 2. losetup -f --show -o 1048576 /dev/loop0         #map partition with ext4 to, e.g., /dev/loop1. So, "file -s /dev/loop1" shows: "/dev/loop1: Linux rev 1.0 ext4 filesystem data, UUID=11e3ba2e-63aa-47ac-a013-1d868176c398, volume name "vps3-1234" (extents) (large files) (huge files)"
> 3. mount /dev/loop1 /mnt/guest                          #mount guest OS root fs
> 4. extlinux --install --device=/dev/loop0 /mnt/guest/boot/syslinux    #this instruction was to install the bootloader, but did not. It say:
>    /mnt/guest/boot/syslinux is device /dev/loop0
>    extlinux: path /mnt/guest/boot/syslinux doesn't match device /dev/loop0
>
> Is it possible to bypass this check? Or other ways to get the desired?
> Thank you.
>

This e-mail was a bit difficult to read, but I do not understand why you 
are using two /dev/loopX devices.  Why not simply do:

   $ umount /mnt/guest
   $ losetup -d /dev/loop1
   $ losetup -d /dev/loop0
   $ losetup -o $((2048 * 512)) /dev/loop0 /tmp/guest_os.img
   $ mount /dev/loop0 /mnt/guest
   $ extlinux --install /mnt/guest/boot/syslinux

?  Extlinux does not install to the MBR, so there is no reason to worry 
about the beginning of the disk image, as far as I know.

- Shao Miller



More information about the Syslinux mailing list