Bug#696718: grub-probe --target=partmap does not detect MS-DOS parttable (on /dev/loopX)

Wolfram Gloger bugzilla1 at malloc.de
Wed Dec 26 12:01:28 UTC 2012


Package: grub-pc
Version: 1.98+20100804-14+squeeze1

My basic problem is that grub-install silently does not work without
specifying '--modules=part_msdos' manually on a loop device for a
virtual machine raw disk image.

When using '--modules=part_msdos' it works just fine but clearly that
should not be necessary.

I have tracked this down to

# grub-probe --target=partmap --device /dev/XXX

outputting _nothing_ in many cases (also for a GPT partitioned hard
disk) but in particular with this very simple msdos partition table for
which I've attached the MBR.

Please consider this self-contained test case:

========================================================================
% dd if=/dev/zero of=test.raw bs=1024 seek=64000000 count=0
% dd if=msdos-disk.mbr of=test.raw conv=notrunc

# losetup -f test.raw
# /usr/sbin/grub-probe -v  --target=partmap --device /dev/loop0 
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: the size of hd0 is 3907029168.
/usr/sbin/grub-probe: info: opening /dev/loop0.
/usr/sbin/grub-probe: info: the size of /dev/loop0 is 128000000.
/usr/sbin/grub-probe: info: no partition map found for /dev/loop0.

The partition table is very simple and was created with sfdisk:

# sfdisk -l -uS /dev/loop0 
Disk /dev/loop0: cannot get geometry

Disk /dev/loop0: 7967 cylinders, 255 heads, 63 sectors/track
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/loop0p1   *      1008  59890319   59889312  83  Linux
/dev/loop0p2      59890320  64998989    5108670  83  Linux
/dev/loop0p3             0         -          0   0  Empty
/dev/loop0p4             0         -          0   0  Empty
========================================================================

Thanks for looking at this,
Wolfram Gloger

-------------- next part --------------
A non-text attachment was scrubbed...
Name: msdos-disk.mbr
Type: application/octet-stream
Size: 512 bytes
Desc: MBR which fails to detect in grub-probe
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20121226/3bf2ac94/attachment.obj>


More information about the Pkg-grub-devel mailing list