Package: mtools
Version: 4.0.12-1
Severity: normal

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.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.36-rc2-00098-gd1b113b (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages mtools depends on:
ii  dpkg                      1.15.8.4       Debian package management system
ii  install-info              4.13a.dfsg.1-5 Manage installed documentation in 
ii  libc6                     2.11.2-2       Embedded GNU C Library: Shared lib

mtools recommends no packages.

Versions of packages mtools suggests:
pn  floppyd                       <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to