Subject: bin/4564: newfs(8) can destroy non 4.2BSD partitions
To: None <gnats-bugs@gnats.netbsd.org>
From: Eric S. Hvozda <hvozda@helios.ack.org>
List: netbsd-bugs
Date: 11/22/1997 22:41:19
>Number:         4564
>Category:       bin
>Synopsis:       newfs(8) can destroy partitions not of type 4.2BSD
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 22 19:50:01 1997
>Last-Modified:
>Originator:     Eric S. Hvozda
>Organization:
	
>Release:        NetBSD 1.3_ALPHA supped 22Nov97
>Environment:
	
System: NetBSD helios.ack.org 1.3_ALPHA NetBSD 1.3_ALPHA (HELIOS) #0: Sat Nov 22 13:57:07 EST 1997 esh@ra.ack.org:/usr/src/sys/arch/i386/compile/HELIOS i386


>Description:
	newfs(8) will destroy the contents of a non 4.2BSD disk
	slice.  Apparently newfs(8) doesn't check the slice type
	in the disklabel when attempting to initalize a raw device.
>How-To-Repeat:
	Create a DOS partition; format it (under DOS of course).  Now
	add it to the disklabel (so that it may be mounted).  Now
	attempt initalize a FFS on it (I did this by a typo).  Discover
	very quickly that newfs(8) did indeed junk the DOS parition.
>Fix:
	newfs(8) should check the disklabel for type 4.2BSD.  I was under
	the impression that it did (didn't this fix go in a while ago?
	or was that only for swap slices?).  
>Audit-Trail:
>Unformatted: