Subject: bin/24765: disklabel(8) cannot read what it writes
To: None <gnats-bugs@gnats.NetBSD.org>
From: Matthias Scheler <tron@colwyn.zhadum.de>
List: netbsd-bugs
Date: 03/13/2004 18:19:30
>Number:         24765
>Category:       bin
>Synopsis:       disklabel(8) cannot read what it writes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 13 17:20:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6ZK 2004-03-12 sources
>Organization:
Matthias Scheler                                  http://scheler.de/~matthias/
>Environment:
System: NetBSD lyssa.zhadum.de 1.6ZK NetBSD 1.6ZK (LYSSA) #0: Fri Mar 12 15:19:00 CET 2004 tron@lyssa.zhadum.de:/src/sys/compile/LYSSA i386
Architecture: i386
Machine: i386
>Description:
"disklabel" can now longer read a protofile it has created:

tron@lyssa:/tmp#disklabel -C wd1 >bla
tron@lyssa:/tmp#disklabel -R wd1 bla 
disklabel: line 22: invalid format

Here is the file it wrote out:

# /dev/rwd1d:
type: ESDI
disk: WDC WD1600JD-00G
label: fictitious
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 15
sectors/cylinder: 945
cylinders: 330774
total sectors: 312581808
rpm: 7200
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0		# microseconds
track-to-track seek: 0	# microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 c: 313208/0/0 17561/0/0     unused      0     0        # (Cyl.  17561 - 330768)
 d: 330774/6/0     0/0/0     unused      0     0        # (Cyl.      0 - 330774*)
 e: 16384/0/0 17561/0/0     4.2BSD   1024  8192 46640  # (Cyl.  17561 -  33944)
 f: 296829/0/0 33945/0/0     4.2BSD   1024  8192 46664  # (Cyl.  33945 - 330773)
 m: 17560/14/0     0/1/0       NTFS                     # (Cyl.      0*-  17560)

>How-To-Repeat:
cd /tmp
disklabel -C wd1 >bla
disklabel -R wd1 bla

>Fix:
None provided.

>Release-Note:
>Audit-Trail:
>Unformatted: