Bug 17483

Summary: Cannot run disklabel on virgin disk
Product: Base System Reporter: cjohnson <cjohnson>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-RELEASE   
Hardware: Any   
OS: Any   

Description cjohnson 2000-03-19 06:20:00 UTC
The Fujitsu just came back from repair.  It had no partition, no labels
no nothing.  Used camcontrol cmd -n da -u 3 -v -t 7200 -c "4 0 0 0 0 0"
To prep the drive as it seemed to have some media errors.

After that ran "fdisk -e" Which reported that -e still exists but the
man page says "fdisk -I" is what I want now.  (Thank you for the change,
I destroyed my slice table once trying to edit it with fdisk -e)  Ran
fdisk -I and the results were:

The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 63, size 8498322 (4149 Meg), flag 80 (active)
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 528/ sector 63/ head 254

This looks good, so I try to write a disklabel:
su-2.03# disklabel -w -r da1s1 auto
disklabel: ioctl DIOCGDINFO: Invalid argument
disklabel: auto: unknown disk type

and:
su-2.03# disklabel -w -r da1 auto
disklabel: No space left on device

I've never been able to get disklabel to work on a virgin disk...

Fix: 

work around is to use a current version of sysinstall.
How-To-Repeat: 
See description
Comment 1 iedowse freebsd_committer freebsd_triage 2001-06-05 22:29:43 UTC
State Changed
From-To: open->closed


This was fixed just after 4.2-RELEASE. disklabel should now be 
able to initialise slices as well as raw disks.