NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: install/47671: How do I manually add an extra MBR style disk?
The following reply was made to PR install/47671; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
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@localhost 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@localhost
"A potential Snark may lurk in every tree."
Home |
Main Index |
Thread Index |
Old Index