Tue 25 May 2010 12:06:44 AM UTC, original submission:
When the partition is listed in the DOS MBR, grub-probe --target=fs on a BSD partition is successful. But if that partition is not listed in the MBR, then the same command fails.
Tests have been performed on NetBSD/i386 with a USB key.
The NetBSD disk label is:
9 partitions:
# size offset fstype [fsize bsize cpg/sgs]
c: 338688 3624768 unused 0 0 # (Cyl. 3596 - 3931)
d: 3964928 0 unused 0 0 # (Cyl. 0 - 3933*)
g: 499905 63 MSDOS # (Cyl. 0*- 495)
h: 3124800 499968 Linux Ext2 0 0 # (Cyl. 496 - 3595)
i: 338688 3624768 4.2BSD 0 0 0 # (Cyl. 3596 - 3931)
The DOS disk label is:
Partition table:
0: Primary DOS with 32 bit FAT (sysid 11)
start 63, size 499905 (244 MB, Cyls 0-123)
1: Linux native (sysid 131)
start 499968, size 3124800 (1526 MB, Cyls 124-898)
PBR is not bootable: All bytes are identical (0x00)
2: NetBSD (sysid 169)
start 3624768, size 338688 (165 MB, Cyls 899-982)
3: <UNUSED>
Here, everything works fine:
$ grub2-probe -v --target=drive --device-map=/dev/null -d /dev/rsd0g
grub2-probe: info: /dev/rsd0g starts from 63.
grub2-probe: info: opening the device /dev/rsd0d.
grub2-probe: info: the size of /dev/rsd0d is 3964928.
grub2-probe: info: Partition 0 starts from 63.
(/dev/rsd0d,1)
$ grub2-probe -v --target=fs --device-map=/dev/null -d /dev/rsd0g
grub2-probe: info: /dev/rsd0g starts from 63.
grub2-probe: info: opening the device /dev/rsd0d.
grub2-probe: info: the size of /dev/rsd0d is 3964928.
grub2-probe: info: Partition 0 starts from 63.
grub2-probe: info: opening /dev/rsd0d,1.
grub2-probe: info: the size of /dev/rsd0d is 3964928.
fat
I now remove the DOS partition #0 from the MBR partition table, but without changing the NetBSD disklabel, I then get:
Partition table:
0: <UNUSED>
1: Linux native (sysid 131)
start 499968, size 3124800 (1526 MB, Cyls 124-898)
PBR is not bootable: All bytes are identical (0x00)
2: NetBSD (sysid 169)
start 3624768, size 338688 (165 MB, Cyls 899-982)
3: <UNUSED>
$ grub2-probe -v --target=drive --device-map=/dev/null -d /dev/rsd0g
grub2-probe: info: /dev/rsd0g starts from 63.
grub2-probe: info: opening the device /dev/rsd0d.
grub2-probe: info: the size of /dev/rsd0d is 3964928.
grub2-probe: info: Partition 1 starts from 499968.
grub2-probe: info: Partition 2 starts from 3624768.
grub2-probe: info: Partition 6 starts from 4291342591.
(/dev/rsd0d,3,7)
$ grub2-probe -v --target=fs --device-map=/dev/null -d /dev/rsd0g
grub2-probe: info: /dev/rsd0g starts from 63.
grub2-probe: info: opening the device /dev/rsd0d.
grub2-probe: info: the size of /dev/rsd0d is 3964928.
grub2-probe: info: Partition 1 starts from 499968.
grub2-probe: info: Partition 2 starts from 3624768.
grub2-probe: info: Partition 6 starts from 4291342591.
grub2-probe: info: opening /dev/rsd0d,3,7.
grub2-probe: info: the size of /dev/rsd0d is 3964928.
grub2-probe: error: unknown filesystem.
So grub-probe --target=fs fails when the partition is accessed as (/dev/rsd0d,msdos3,bsd7) instead of (/dev/rsd0d,msdos1).
|