Subject: kern/26075: disklabel/fdisk takes garbage from USB floppy
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <abs@absd.org>
List: netbsd-bugs
Date: 06/27/2004 00:06:41
>Number:         26075
>Category:       kern
>Synopsis:       disklabel/fdisk takes garbage from USB floppy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 26 23:08:02 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     David Brownlee
>Release:        NetBSD 2.0F
>Organization:
	
>Environment:
	
	
System: NetBSD forsaken 2.0F NetBSD 2.0F (GENERIC) #6: Sat Jun 26 11:08:23 BST 2004 abs@tll.i.purplei.com:/files/netbsd/current/sys/arch/i386/compile/obj/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	Attached a Y-E DATA USB Floppy Drive to a NetBSD box, drive contains
	an MSDOS formatted floppy without any partitions. As it attaches as
	sd0 the faked up disklabel will attempt to use the MBR partitions,
	resulting in a disklabel with e-h full of garbage, and paritition
	'a' undefined.

	disklabel sd0:

# /dev/rsd0d:
type: ATAPI
disk: mydisk
label: fictitious
flags: removable
bytes/sector: 512
sectors/track: 18
tracks/cylinder: 2
sectors/cylinder: 36
cylinders: 80
total sectors: 2880
rpm: 7680
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0


8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 d:      2880         0     unused      0     0        # (Cyl.      0 - 79)
 e: 4149908451 4153561121    unknown                     # (Cyl. 115376697+- 111347285+)
 f: 1229803331 538988361    unknown                     # (Cyl. 14971898+- 49133102+)
 g: 1953460034 168643919    unknown                     # (Cyl. 4684553+- 58947332+)
 h:       101 1920298089    unknown                     # (Cyl. 53341613+- 53341616+)
disklabel: boot block size 0
disklabel: super block size 0
disklabel: partition e: offset past end of unit
disklabel: partition e: partition extends past end of unit
disklabel: partition f: offset past end of unit
disklabel: partition f: partition extends past end of unit
disklabel: partition g: offset past end of unit
disklabel: partition g: partition extends past end of unit
disklabel: partition h: offset past end of unit
disklabel: partition h: partition extends past end of unit

	fdisk sd0

Disk: /dev/rsd0d
NetBSD disklabel disk geometry:
cylinders: 80, heads: 2, sectors/track: 18 (36 sectors/cylinder)
total sectors: 2880

BIOS disk geometry:
cylinders: 80, heads: 2, sectors/track: 18 (36 sectors/cylinder)
total sectors: 2880

Partition table:
0: unknown (sysid 27)
    start 4153561121, size 4149908451 (2026322 MB, Cyls
115376697/1/12-230651932/1/3), flag 0xdb
1: unknown (sysid 73)
    start 538988361, size 1229803331 (600490 MB, Cyls
14971898/1/16-49133102/1/3), flag 0xe2
2: DM6 Aux3 (sysid 83)
    start 168643919, size 1953460034 (953838 MB, Cyls
4684553/0/12-58947332/0/2), flag 0x42
3: unknown (sysid 107)
    start 1920298089, size 101 (0 MB, Cyls 53341613/1/4-53341616/0/15), flag
0x20


>How-To-Repeat:
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: