NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/43454: gpt(8) and disklabel(8) conflict with each other
>Number: 43454
>Category: bin
>Synopsis: gpt(8) and disklabel(8) conflict with each other
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 11 08:05:00 +0000 2010
>Originator: Grégoire Sutre <gregoire.sutre%gmail.com@localhost>
>Release: NetBSD 5.1_RC2
>Organization:
>Environment:
System: NetBSD niagara 5.1_RC2 NetBSD 5.1_RC2 (NIAGARA) #0: Thu Jun 10 00:19:14
CEST 2010 instsoft@niagara:/usr/build/usr/src/sys/arch/i386/compile/NIAGARA i386
Architecture: i386
Machine: i386
>Description:
On a gpt-partitioned disk, running disklabel -e -I silently destroys the GPT
header.
Conversely, on a BSD-labeled disk (with a BSD label for the whole disk, i.e.
no DOS partition table in the MBR), running gpt create silently create destroys
the BSD disklabel.
>How-To-Repeat:
$ dd if=/dev/zero of=./testimage.bin bs=10m count=1
$ vnconfig vnd0 testimage.bin
// Create a new BSD disklabel
$ disklabel -e -I vnd0
// Check that the disklabel has been written to the disk
$ disklabel -r vnd0
[ shows the disklabel ]
// Create a new GUID partition table
$ gpt create vnd0
// Observe that the on-disk disklabel was destroyed
$ disklabel -r vnd0
disklabel: could not read existing label
Conversely:
$ dd if=/dev/zero of=./testimage.bin bs=10m count=1
$ vnconfig vnd0 testimage.bin
// Create a new GUID partition table
$ gpt create vnd0
// Add a new GPT partition
$ gpt add -s 10000 vnd0
// Read the GPT to check that the new partition is there
$ gpt show vnd0
// Create a new BSD disklabel
$ disklabel -e -I vnd0
// Observe that the GPT header was destroyed
$ gpt show vnd0
start size index contents
0 1 PMBR
1 20446
20447 32 Sec GPT table
20479 1 Sec GPT header
>Fix:
Home |
Main Index |
Thread Index |
Old Index