I do:
dd if=/dev/zero of=diskimage count=`expr 255*63*1000` bs=512
echo 'drive c file=diskimage partition=1 blocksize=512 cylinders=1000 heads=63 sectors=255' > mtoolsrc
export MTOOLSRC=`pwd`/mtoolsrc
mpartition -I -B /usr/lib/syslinux/mbr.bin c:
and get:
read MBR: Inappropriate ioctl for device
Looking at the source, this comes from line 532 of mpartition.c
which says:
if(read(fd, (char *) buf, 512) < 512) {
perror("read MBR");
exit(1);
}
fd here points at /usr/lib/syslinux/mbr.bin which is 440 bytes long.
I suspect that the inequality should be <0 not <512.
Changing it that way makes mpartition work.