From jin@iss-p5.lbl.gov  Fri Aug 14 12:29:41 1998
Received: from iss-p5.lbl.gov (iss-p5.lbl.gov [131.243.2.30])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA25805
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Aug 1998 12:29:40 -0700 (PDT)
          (envelope-from jin@iss-p5.lbl.gov)
Received: (from jin@localhost)
	by iss-p5.lbl.gov (8.8.8/8.8.8) id MAA02936;
	Fri, 14 Aug 1998 12:29:12 -0700 (PDT)
	(envelope-from jin)
Message-Id: <199808141929.MAA02936@iss-p5.lbl.gov>
Date: Fri, 14 Aug 1998 12:29:12 -0700 (PDT)
From: Jin Guojun (ITG staff) <jin@iss-p5.lbl.gov>
Reply-To: jin@iss-p5.lbl.gov
To: FreeBSD-gnats-submit@freebsd.org
Subject: disklabel fails to write labal on scsi disk
X-Send-Pr-Version: 3.2

>Number:         7614
>Category:       bin
>Synopsis:       disklabel fails to write labal on scsi disk
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 14 12:30:01 PDT 1998
>Closed-Date:    Sat Dec 12 17:03:12 PST 1998
>Last-Modified:  Sat Dec 12 17:07:22 PST 1998
>Originator:     Jin Guojun (ITG staff)
>Release:        FreeBSD 2.2.7-RELEASE i386
>Organization:
>Environment:

	2.2.7-RELEASE

>Description:

iss# dmesg 
Copyright (c) 1992-1998 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

FreeBSD 2.2.7-RELEASE #0: Fri Jul 24 16:05:48 PDT 1998
    root@iss-p4.lbl.gov:/usr/src/sys/compile/MinMax
CPU: Pentium Pro (199.31-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x617  Stepping=7
  Features=0xf9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV>
real memory  = 67108864 (65536K bytes)
avail memory = 63291392 (61808K bytes)
Probing for devices on PCI bus 0:
chip0 <Intel 82440FX (Natoma) PCI and memory controller> rev 2 on pci0:0:0
chip1 <Intel 82371SB PCI-ISA bridge> rev 1 on pci0:1:0
chip2 <Intel 82371SB IDE interface> rev 0 on pci0:1:1
pci0:9:    vendor=0x111a, device=0x0002, class=network (unknown subclass 0x03) int a irq 12 [no driver assigned]
ncr0 <ncr 53c810 fast10 scsi> rev 2 int a irq 10 on pci0:11:0
ncr0 waiting for scsi devices to settle
(ncr0:0:0): "SEAGATE ST15230N 0298" type 0 fixed SCSI 2
sd0(ncr0:0:0): Direct-Access 
sd0(ncr0:0:0): 10.0 MB/s (100 ns, offset 8)
4095MB (8386733 512 byte sectors)
(ncr0:1:0): "SEAGATE ST15230N 0498" type 0 fixed SCSI 2
sd1(ncr0:1:0): Direct-Access 
sd1(ncr0:1:0): 10.0 MB/s (100 ns, offset 8)
4095MB (8386733 512 byte sectors)
ncr1 <ncr 53c810 fast10 scsi> rev 2 int a irq 11 on pci0:12:0
ncr1 waiting for scsi devices to settle
(ncr1:0:0): "SEAGATE ST15230N 0298" type 0 fixed SCSI 2
sd2(ncr1:0:0): Direct-Access 
sd2(ncr1:0:0): 10.0 MB/s (100 ns, offset 8)
4095MB (8386733 512 byte sectors)
(ncr1:1:0): "SEAGATE ST15230N 0298" type 0 fixed SCSI 2
sd3(ncr1:1:0): Direct-Access 
sd3(ncr1:1:0): 10.0 MB/s (100 ns, offset 8)
4095MB (8386733 512 byte sectors)
...

iss# disklabel -rw sd0 auto
disklabel: /dev/rsd0c: Undefined error: 0
iss# disklabel -rwB sd0 auto
disklabel: No space left on device

iss# ^0^1
disklabel -rwB sd1 auto
disklabel: No space left on device

iss# tail /etc/disktab
# Max   :pc#8386733:oc#0: generated from FreeBSD installation FDISK
st15230n|Seagate HAWK 4 Family 4.2GB SCSI:\
        :dt=SCSI:ty=winchester:se#512:nt#19:ns#110:nc#4012:rm#5411: \
        :pa#8192:oa#0:ta=4.2BSD:ba#4096:fa#512: \
        :pc#8385080:oc#0: \
        :pe#8376888:oe#8192:te=4.2BSD:be#4096:fe#512:

iss# disklabel -w sd0 st15230n
disklabel: No space left on device

Is this NCR problem or a general SCSI disklabel problem?

>How-To-Repeat:

	<>

>Fix:
	

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, jin@iss-p5.lbl.gov
Cc:  Subject: Re: bin/7614: disklabel fails to write labal on scsi disk
Date: Sat, 15 Aug 1998 16:16:39 +1000

 >...
 >
 >iss# disklabel -rw sd0 auto
 >disklabel: /dev/rsd0c: Undefined error: 0
 >iss# disklabel -rwB sd0 auto
 >disklabel: No space left on device
 >
 >iss# ^0^1
 >disklabel -rwB sd1 auto
 >disklabel: No space left on device
 >
 >iss# tail /etc/disktab
 ># Max   :pc#8386733:oc#0: generated from FreeBSD installation FDISK
 >st15230n|Seagate HAWK 4 Family 4.2GB SCSI:\
 >        :dt=SCSI:ty=winchester:se#512:nt#19:ns#110:nc#4012:rm#5411: \
 >        :pa#8192:oa#0:ta=4.2BSD:ba#4096:fa#512: \
 >        :pc#8385080:oc#0: \
 >        :pe#8376888:oe#8192:te=4.2BSD:be#4096:fe#512:
 >
 >iss# disklabel -w sd0 st15230n
 >disklabel: No space left on device
 >
 >Is this NCR problem or a general SCSI disklabel problem?
 
 This is a user error (attempting to write a label that specifies a
 disk size or partition size larger than the slice).  Most likely a
 label suitable for covering the whole disk combined with a slice
 *not* covering the whole disk.  The `auto' label only applies to
 the whole disk.
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Sat Dec 12 17:03:12 PST 1998 
State-Changed-Why:  
I'm pretty sure this PR can be closed, though I will add another note: 
sometimes there will be data on the disk that causes disklabel to barf, 
even when you are trying to install a new label.  When this happens to 
me I clear out the first 64K or so worth of the partition with dd and 
then install a complete new label and boot program.  If you do this, 
however, remember that using dd to clear the label will also clear 
the boot blocks so always install new boot blocks :-)  

e.g.  dd if=/dev/zero of=THEPARTITION bs=64k count=1 
(this will 'destroy' the disk, after which you can install a new 
label & new boot blocks with disklabel) 
>Unformatted:
