NetBSD Problem Report #47671
From www@NetBSD.org Wed Mar 20 01:33:59 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id C338563F105
for <gnats-bugs@gnats.NetBSD.org>; Wed, 20 Mar 2013 01:33:59 +0000 (UTC)
Message-Id: <20130320013358.D536663F105@www.NetBSD.org>
Date: Wed, 20 Mar 2013 01:33:58 +0000 (UTC)
From: andrew.cagney@gmail.com
Reply-To: andrew.cagney@gmail.com
To: gnats-bugs@NetBSD.org
Subject: How do I manually add an extra MBR style disk?
X-Send-Pr-Version: www-1.0
>Number: 47671
>Category: install
>Synopsis: How do I manually add an extra MBR style disk?
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: install-manager
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 20 01:35:00 +0000 2013
>Last-Modified: Sun Mar 24 00:30:06 +0000 2013
>Originator: cagney
>Release: trunk
>Organization:
>Environment:
NetBSD rpi 6.99.17 NetBSD 6.99.17 (RPI) #3: Fri Mar 15 16:35:21 EDT 2013 cagney@tv-desktop:/home/cagney/src/NetBSD/cvs/sys/arch/evbarm/compile/obj/RPI evbarm
>Description:
This is idle speculation, but I suspect the sequence is meant to be something like:
-- resize dos partition using another operating system
# fdisk -u /dev/rsd0
-- adjust things to add a netbsd partition
mprlabel -w /dev/rsd0
-- kind of gets it right
disklabel -i /dev/rsd0
-- first move things round so that c is the above partition and d is the entire disk, and then add a, b, h, ...
except I can't find anything in "The Manual" to confirm this.
I also noticed:
- disklabel has the comment:
<<
On systems that expect to have disks with MBR partitions (see fdisk(8))
disklabel will find, and update if requested, labels in the first 8k of
type 169 (NetBSD) MBR labels and within the first 8k of the physical
disk.
>>
is this still true, or has this been supplanted by mbrlabel? If it is true, it doesn't work reliably.
It continues:
<<
On other systems disklabel will only look at the start of the
disk.
>>
Is this true, or should it spot the MBR and act like i386 et.al.
<<
The offset at which the labels are written is also system
dependent.
>>
is this true when there's an MBR?
-- mbrlabel (assuming I'm meant to be using it)
It doesn't seem to let me specify which partitions should get which letters (a ended up being dos), or that it should start from scratch?
>How-To-Repeat:
Try to add a disk with an existing MBR partition table.
>Fix:
>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: install/47671: How do I manually add an extra MBR style disk?
Date: Wed, 20 Mar 2013 07:00:10 +0000 (UTC)
andrew.cagney@gmail.com writes:
>On systems that expect to have disks with MBR partitions (see fdisk(8))
>disklabel will find, and update if requested, labels in the first 8k of
>type 169 (NetBSD) MBR labels and within the first 8k of the physical
>disk.
[...]
>On other systems disklabel will only look at the start of the
>disk.
This only defines the place where disklabel is looking for an existing
BSD disklabel, it doesn't mean that it uses the MBR for anything else.
So to add a MBR disk you
- use fdisk to add a NetBSD partition to the MBR.
- use disklabel (-i or -e) to create NetBSD partitions within the
range of the raw partition 'c'. For a data disk that is usually only
one partition 'e' (to avoid confusion with the root 'a' or swap 'b').
and if necessary:
- use mbrlabel to collect non-NetBSD partitions from the MBR into
the BSD disklabel.
>-- mbrlabel (assuming I'm meant to be using it)
>It doesn't seem to let me specify which partitions should get which letters (a ended up being dos), or that it should start from scratch?
mbrlabel does read the MBR and adds partitions to the existing BSD disklabel
(the kernel has a default disklabel if it cannot read one from the disk).
It will skip MBR partitions that already exist in the BSD disklabel.
When I run mbrlabel it reads the MBR:
Partition table:
0: Primary DOS with 32 bit FAT - LBA (sysid 12)
bootmenu: WinME
start 16065, size 4049136 (1977 MB, Cyls 1-253/11/63)
1: NetBSD (sysid 169)
bootmenu: NetBSD
start 4745201, size 151556287 (74002 MB, Cyls 295/95/42-9729/80/63), Active
2: OS/2 hidden C: drive (sysid 132)
bootmenu: Resume
start 4065201, size 657909 (321 MB, Cyls 253/12/1-293)
3: <UNUSED>
and prints:
| Found MSDOS partition; size 4049136 (1977 MB), offset 16065
| skipping existing MSDOS partition at slot h.
MBR partition 0, already matches disklabel partition 'h'. Ignored.
| Found 4.2BSD partition; size 151556287 (74002 MB), offset 4745201
| skipping existing unused partition at slot c.
MBR partition 1, already matches disklabel partition 'c'. Ignored.
| Found unknown partition; size 657909 (321 MB), offset 4065201
| adding unknown partition to slot j.
MBR partition 2, no match in disklabel, create a new partition 'j'
for it ('j' because that's the first free partition slot in the disklabel,
i already have 'a' to 'i').
Then it prints the resulting disklabel and depending on options may
update the in-core disklabel and the one on the disk.
If you don't have an existing disklabel, mbrlabel will fill the
empty slots 'a', 'b', then 'e', etc. That's what you observeed.
--
--
Michael van Elst
Internet: mlelstv@serpens.de
"A potential Snark may lurk in every tree."
From: Andrew Cagney <andrew.cagney@gmail.com>
To: gnats-bugs@netbsd.org
Cc: install-manager@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: install/47671: How do I manually add an extra MBR style disk?
Date: Wed, 20 Mar 2013 08:23:56 -0400
--e89a8f924078c9214004d85a4b24
Content-Type: text/plain; charset=UTF-8
Here's the output from several further runs with -w:
# mbrlabel /dev/rsd0
Found MSDOS partition; size 1073741824 (524288 MB), offset 2048
skipping existing MSDOS partition at slot a.
Found 4.2BSD partition; size 524288000 (256000 MB), offset 1073743872
adding 4.2BSD partition to slot e.
5 partitions:
# size offset fstype [fsize bsize cpg/sgs]
a: 1073741824 2048 MSDOS # (Cyl. 1 -
524288)
b: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
524296)
c: 1952151552 0 unused 0 0 # (Cyl. 0 -
953198)
d: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
524296)
e: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
524296)
notice how it is breeding partitions ...
A reboot, however, seems to have flushed what ever was going wrong:
# mbrlabel /dev/rsd0
Found MSDOS partition; size 1073741824 (524288 MB), offset 2048
skipping existing MSDOS partition at slot e.
Found 4.2BSD partition; size 524288000 (256000 MB), offset 1073743872
skipping existing 4.2BSD partition at slot f.
8 partitions:
# size offset fstype [fsize bsize cpg/sgs]
c: 1952151552 0 unused 0 0 # (Cyl. 0 -
953198)
e: 1073741824 2048 MSDOS # (Cyl. 1 -
524288)
f: 524288000 1073743872 4.2BSD 0 0 0 # (Cyl. 524289 -
780288)
if nothing else, there needs to be an ignore disklable flag.
--e89a8f924078c9214004d85a4b24
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Here's the output from several further runs with -w:<div><br></div><div=
><div># mbrlabel /dev/rsd0</div><div>Found MSDOS partition; size 1073741824=
(524288 MB), offset 2048</div><div>=C2=A0 skipping existing MSDOS partitio=
n at slot a.</div>
<div>Found 4.2BSD partition; size 524288000 (256000 MB), offset 1073743872<=
/div><div>=C2=A0 adding 4.2BSD partition to slot e.</div><div><br></div><di=
v>5 partitions:</div><div># =C2=A0 =C2=A0 =C2=A0 =C2=A0size =C2=A0 =C2=A0of=
fset =C2=A0 =C2=A0 fstype [fsize bsize cpg/sgs]</div>
<div>=C2=A0a: 1073741824 =C2=A0 =C2=A0 =C2=A02048 =C2=A0 =C2=A0 =C2=A0MSDOS=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # (C=
yl. =C2=A0 =C2=A0 =C2=A01 - 524288)</div><div>=C2=A0b: =C2=A0 =C2=A0 16384 =
1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 1024 =C2=A08192 =C2=A0 =C2=A016 =C2=
=A0# (Cyl. 524289 - 524296)</div><div>=C2=A0c: 1952151552 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 0 =C2=A0 =C2=A0 unused =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0# (Cyl. =C2=A0 =C2=A0 =C2=A00 - 953198)</div>
<div>=C2=A0d: =C2=A0 =C2=A0 16384 1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 10=
24 =C2=A08192 =C2=A0 =C2=A016 =C2=A0# (Cyl. 524289 - 524296)</div><div>=C2=
=A0e: =C2=A0 =C2=A0 16384 1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 1024 =C2=
=A08192 =C2=A0 =C2=A016 =C2=A0# (Cyl. 524289 - 524296)</div></div><div><br>=
</div><div>notice how it is breeding partitions ...</div>
<div><br></div><div>A reboot, however, seems to have flushed what ever was =
going wrong:</div><div><br></div><div><div># mbrlabel /dev/rsd0</div><div>F=
ound MSDOS partition; size 1073741824 (524288 MB), offset 2048</div><div>
=C2=A0 skipping existing MSDOS partition at slot e.</div><div>Found 4.2BSD =
partition; size 524288000 (256000 MB), offset 1073743872</div><div>=C2=A0 s=
kipping existing 4.2BSD partition at slot f.</div><div><br></div><div>8 par=
titions:</div>
<div># =C2=A0 =C2=A0 =C2=A0 =C2=A0size =C2=A0 =C2=A0offset =C2=A0 =C2=A0 fs=
type [fsize bsize cpg/sgs]</div><div>=C2=A0c: 1952151552 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 0 =C2=A0 =C2=A0 unused =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0# (Cyl. =C2=A0 =C2=A0 =C2=A00 - 953198)</div><div>=
=C2=A0e: 1073741824 =C2=A0 =C2=A0 =C2=A02048 =C2=A0 =C2=A0 =C2=A0MSDOS =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # (Cyl. =
=C2=A0 =C2=A0 =C2=A01 - 524288)</div>
<div>=C2=A0f: 524288000 1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 =C2=A0 =C2=
=A00 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 0 =C2=A0# (Cyl. 524289 - 780288)</div></=
div><div><br></div><div>if nothing else, there needs to be an ignore diskla=
ble flag.</div>
--e89a8f924078c9214004d85a4b24--
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: install/47671: How do I manually add an extra MBR style disk?
Date: Thu, 21 Mar 2013 07:37:29 +0000 (UTC)
andrew.cagney@gmail.com (Andrew Cagney) writes:
>Here's the output from several further runs with -w:
># mbrlabel /dev/rsd0
>Found MSDOS partition; size 1073741824 (524288 MB), offset 2048
> skipping existing MSDOS partition at slot a.
>Found 4.2BSD partition; size 524288000 (256000 MB), offset 1073743872
> adding 4.2BSD partition to slot e.
>5 partitions:
># size offset fstype [fsize bsize cpg/sgs]
> a: 1073741824 2048 MSDOS # (Cyl. 1 -
>524288)
> b: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
>524296)
> c: 1952151552 0 unused 0 0 # (Cyl. 0 -
>953198)
> d: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
>524296)
> e: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
>524296)
>notice how it is breeding partitions ...
That looks like a non-i386 system (c seems to be the raw partition)
and a bug.
For some reason mbrlabel forces the size of a BSD partition to 16384,
which also defeats the duplicate detection. BSD partitions are those
with an MBR type of
165 MBR_PTYPE_386BSD
166 MBR_PTYPE_OPENBSD
168 MBR_PTYPE_APPLE_UFS
169 MBR_PTYPE_NETBSD
That's probably done because BSD partitions also use the other
parameters (fsize,bsize,cpg/sgs) that can only be guessed without
further analyzing the disk contents.
The bug doesn't usually show up on i386 systems because the only
BSD type MBR partition found is usually the raw partition which
is ignored anyway.
>A reboot, however, seems to have flushed what ever was going wrong:
That's because 'w' alone doesn't write to the disk but only updates the
in-core version of the disklabel.
--
--
Michael van Elst
Internet: mlelstv@serpens.de
"A potential Snark may lurk in every tree."
From: Andrew Cagney <andrew.cagney@gmail.com>
To: gnats-bugs@netbsd.org
Cc: install-manager@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: install/47671: How do I manually add an extra MBR style disk?
Date: Sat, 23 Mar 2013 20:29:06 -0400
--bcaec5555662aa776a04d8a0c64a
Content-Type: text/plain; charset=UTF-8
> andrew.cagney@gmail.com (Andrew Cagney) writes:
>
> >Here's the output from several further runs with -w:
>
> ># mbrlabel /dev/rsd0
> >Found MSDOS partition; size 1073741824 (524288 MB), offset 2048
> > skipping existing MSDOS partition at slot a.
> >Found 4.2BSD partition; size 524288000 (256000 MB), offset 1073743872
> > adding 4.2BSD partition to slot e.
>
> >5 partitions:
> ># size offset fstype [fsize bsize cpg/sgs]
> > a: 1073741824 2048 MSDOS # (Cyl. 1 -
> >524288)
> > b: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
> >524296)
> > c: 1952151552 0 unused 0 0 # (Cyl. 0 -
> >953198)
> > d: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
> >524296)
> > e: 16384 1073743872 4.2BSD 1024 8192 16 # (Cyl. 524289 -
> >524296)
>
> >notice how it is breeding partitions ...
>
> That looks like a non-i386 system (c seems to be the raw partition)
> and a bug.
>
Yes, it is a Pi. (arm). 1tb usb disk so C is the full disk. It the disk
is meant to have two partitions and some free space:
From dmesg:
sd0 at scsibus0 target 0 lun 0: <WD, My Passport 070A, 1030> disk fixed
sd0: fabricating a geometry
sd0: 930 GB, 953199 cyl, 64 head, 32 sec, 512 bytes/sect x 1952151552
sectors
and from fdisk:
fdisk: Cannot determine the number of heads
Disk: /dev/rsd0c
NetBSD disklabel disk geometry:
cylinders: 953199, heads: 64, sectors/track: 32 (2048 sectors/cylinder)
total sectors: 1952151552
BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 1952151552
Partitions aligned to 2048 sector boundaries, offset 2048
Partition table:
0: Primary DOS with 32 bit FAT - LBA (sysid 12)
start 2048, size 1073741824 (524288 MB, Cyls 0-66837/118/33)
1: NetBSD (sysid 169)
start 1073743872, size 524288000 (256000 MB, Cyls
66837/118/34-99472/225/17)
PBR is not bootable: All bytes are identical (0xff)
2: <UNUSED>
3: <UNUSED>
Hmm, the man page has "The raw partition (typically partition c, but d on
i386 and some other platforms) is left alone during this process.". Why?
Shouldn't it try to always try to make C the NetBSD partition, and D the
disk?
And to get off topic, instead of starting A up, would it be better to pack
the other partitions at the end of the table, keep A (root) and B (swap)
free? The first thing I'm going to do with disklabel is that shuffle.
> For some reason mbrlabel forces the size of a BSD partition to 16384,
> which also defeats the duplicate detection. BSD partitions are those
> with an MBR type of
>
> 165 MBR_PTYPE_386BSD
> 166 MBR_PTYPE_OPENBSD
> 168 MBR_PTYPE_APPLE_UFS
> 169 MBR_PTYPE_NETBSD
>
> That's probably done because BSD partitions also use the other
> parameters (fsize,bsize,cpg/sgs) that can only be guessed without
> further analyzing the disk contents.
>
Fdisk seems to know. This behavior seems to make mbrlabel less useful. I
was hoping it could predictably pre-populate and write a disklabel.
>
> The bug doesn't usually show up on i386 systems because the only
> BSD type MBR partition found is usually the raw partition which
> is ignored anyway.
>
>
>
> >A reboot, however, seems to have flushed what ever was going wrong:
>
> That's because 'w' alone doesn't write to the disk but only updates the
> in-core version of the disklabel.
>
Ah. I should be specifying -w -r.
--bcaec5555662aa776a04d8a0c64a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=3D=
"im">
=C2=A0<a href=3D"mailto:andrew.cagney@gmail.com">andrew.cagney@gmail.com</a=
> (Andrew Cagney) writes:<br>
<br>
=C2=A0>Here's the output from several further runs with -w:<br>
<br>
=C2=A0># mbrlabel /dev/rsd0<br>
=C2=A0>Found MSDOS partition; size 1073741824 (524288 MB), offset 2048<b=
r>
=C2=A0> =C2=A0skipping existing MSDOS partition at slot a.<br>
=C2=A0>Found 4.2BSD partition; size 524288000 (256000 MB), offset 107374=
3872<br>
=C2=A0> =C2=A0adding 4.2BSD partition to slot e.<br>
<br>
=C2=A0>5 partitions:<br>
=C2=A0># =C2=A0 =C2=A0 =C2=A0 =C2=A0size =C2=A0 =C2=A0offset =C2=A0 =C2=
=A0 fstype [fsize bsize cpg/sgs]<br>
=C2=A0> a: 1073741824 =C2=A0 =C2=A0 =C2=A02048 =C2=A0 =C2=A0 =C2=A0MSDOS=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # (C=
yl. =C2=A0 =C2=A0 =C2=A01 -<br>
=C2=A0>524288)<br>
=C2=A0> b: =C2=A0 =C2=A0 16384 1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 10=
24 =C2=A08192 =C2=A0 =C2=A016 =C2=A0# (Cyl. 524289 -<br>
=C2=A0>524296)<br>
=C2=A0> c: 1952151552 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 unused=
=C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# (Cyl. =
=C2=A0 =C2=A0 =C2=A00 -<br>
=C2=A0>953198)<br>
=C2=A0> d: =C2=A0 =C2=A0 16384 1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 10=
24 =C2=A08192 =C2=A0 =C2=A016 =C2=A0# (Cyl. 524289 -<br>
=C2=A0>524296)<br>
=C2=A0> e: =C2=A0 =C2=A0 16384 1073743872 =C2=A0 =C2=A0 4.2BSD =C2=A0 10=
24 =C2=A08192 =C2=A0 =C2=A016 =C2=A0# (Cyl. 524289 -<br>
=C2=A0>524296)<br>
<br>
=C2=A0>notice how it is breeding partitions ...<br>
<br>
</div>=C2=A0That looks like a non-i386 system (c seems to be the raw partit=
ion)<br>
=C2=A0and a bug.<br></blockquote><div><br></div><div><br></div><div>Yes, it=
is a Pi. =C2=A0(arm). =C2=A01tb usb disk so C is the full disk. =C2=A0It t=
he disk is meant to have two partitions and some free space:</div><div><br>=
</div><div>From dmesg:</div>
<div><br></div><div><div>sd0 at scsibus0 target 0 lun 0: <WD, My Passpor=
t 070A, 1030> disk fixed</div><div>sd0: fabricating a geometry</div><div=
>sd0: 930 GB, 953199 cyl, 64 head, 32 sec, 512 bytes/sect x 1952151552 sect=
ors</div>
</div><div><br></div><div>and from fdisk:</div><div><br></div><div><div>fdi=
sk: Cannot determine the number of heads</div><div>Disk: /dev/rsd0c</div><d=
iv>NetBSD disklabel disk geometry:</div><div>cylinders: 953199, heads: 64, =
sectors/track: 32 (2048 sectors/cylinder)</div>
<div>total sectors: 1952151552</div><div><br></div><div>BIOS disk geometry:=
</div><div>cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cy=
linder)</div><div>total sectors: 1952151552</div><div><br></div><div>Partit=
ions aligned to 2048 sector boundaries, offset 2048</div>
<div><br></div><div>Partition table:</div><div>0: Primary DOS with 32 bit F=
AT - LBA (sysid 12)</div><div>=C2=A0 =C2=A0 start 2048, size 1073741824 (52=
4288 MB, Cyls 0-66837/118/33)</div><div>1: NetBSD (sysid 169)</div><div>=C2=
=A0 =C2=A0 start 1073743872, size 524288000 (256000 MB, Cyls 66837/118/34-9=
9472/225/17)</div>
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 PBR is not bootable: All bytes are identic=
al (0xff)</div><div>2: <UNUSED></div><div>3: <UNUSED></div></di=
v><div><br></div><div><br></div><div>Hmm, the man page has "The raw pa=
rtition (typically partition c, but d on i386 and some other platforms) is =
left alone during this process.". =C2=A0Why? =C2=A0 Shouldn't it t=
ry to always try to make C =C2=A0the NetBSD partition, and D the disk?</div=
>
<div><br></div><div>And to get off topic, instead of starting A up, would i=
t be better to pack the other partitions at the end of the table, keep A (r=
oot) and B (swap) free? =C2=A0The first thing I'm going to do with disk=
label is that shuffle.</div>
<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">
<br>
=C2=A0For some reason mbrlabel forces the size of a BSD partition to 16384,=
<br>
=C2=A0which also defeats the duplicate detection. BSD partitions are those<=
br>
=C2=A0with an MBR type of<br>
<br>
=C2=A0165 MBR_PTYPE_386BSD<br>
=C2=A0166 MBR_PTYPE_OPENBSD<br>
=C2=A0168 MBR_PTYPE_APPLE_UFS<br>
=C2=A0169 MBR_PTYPE_NETBSD<br>
<br>
=C2=A0That's probably done because BSD partitions also use the other<br=
>
=C2=A0parameters (fsize,bsize,cpg/sgs) that can only be guessed without<br>
=C2=A0further analyzing the disk contents.<br></blockquote><div>=C2=A0</div=
><div><br></div><div>Fdisk seems to know. =C2=A0This=C2=A0behavior=C2=A0see=
ms to make mbrlabel less useful. =C2=A0I was=C2=A0hoping=C2=A0it could pred=
ictably pre-populate and write a disklabel.</div>
<div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
=C2=A0The bug doesn't usually show up on i386 systems because the only<=
br>
=C2=A0BSD type MBR partition found is usually the raw partition which<br>
=C2=A0is ignored anyway.<br></blockquote><div><br></div><div><br></div><div=
><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"marg=
in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=3D"im"><br>
<br>
=C2=A0>A reboot, however, seems to have flushed what ever was going wron=
g:<br>
<br>
</div>=C2=A0That's because 'w' alone doesn't write to the d=
isk but only updates the<br>
=C2=A0in-core version of the disklabel.<br></blockquote><div><br></div><div=
>Ah. =C2=A0I should be specifying -w -r.</div><div><br></div></div>
--bcaec5555662aa776a04d8a0c64a--
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.