From owner-freebsd-scsi Fri Nov 28 10:32:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA29442 for freebsd-scsi-outgoing; Fri, 28 Nov 1997 10:32:42 -0800 (PST) (envelope-from owner-freebsd-scsi) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA29436 for ; Fri, 28 Nov 1997 10:32:39 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.6.9) id FAA09692; Sat, 29 Nov 1997 05:27:57 +1100 Date: Sat, 29 Nov 1997 05:27:57 +1100 From: Bruce Evans Message-Id: <199711281827.FAA09692@godzilla.zeta.org.au> To: bde@zeta.org.au, earle@isolar.Tujunga.CA.US Subject: Re: FreeBSD 2.1-STABLE: Why can't I disklabel a SCSI disk? Cc: freebsd-scsi@freebsd.org, gibbs@plutotech.com Sender: owner-freebsd-scsi@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >I tried adding Bruce's "su#" entry as follows: > >nntp1# tail -4 /etc/disktab > >seagate15150|Seagate ST15150N:\ > :dt=SCSI:ty=winchester:ns#63:nt#255:nc#521:\ > :su#8385867:pc#8385867:oc#0: > >figuring that pc + oc == su. > >Well, now I get a new error: > >nntp1# disklabel -w -r sd1 seagate15150 >disklabel: ioctl DIOCSDINFO: Open partition would move or shrink > >I don't understand this at all. Which partition is "open" and why is it >considered "open"? Simply because the disk label has been read into memory? The C partition. Some partition has to be open to do ioctls on. >This *seems* to be addressed by the "DIAGNOSTICS" section of disklabel(8): > >DIAGNOSTICS > The kernel device drivers will not allow the size of a disk partition to > be decreased or the offset of a partition to be changed while it is open. > Some device drivers create a label containing only a single large parti- > tion if a disk is unlabeled; thus, the label must be written to the ``a'' > partition of the disk while it is open. This sometimes requires the de- > sired label to be set in two steps, the first one creating at least one > other partition, and the second setting the label on the new partition > while shrinking the ``a'' partition. > >but to be honest, I don't parse this paragraph at all. I tried creating an >"a" partition (same size as "c") which worked (disklabel -e) but I still get >the same thing when I try to use the disktab entry. I think it needs to be at least as small as the final size of the C partition. >I tried to zero-out the present disklabel and this failed as well. >This worked back when the drive was new (i.e. had never been put into the >FreeBSD machine). Now it doesn't: > >xxxx1# dd if=/dev/zero of=/dev/rsd1c bs=1 count=2 >dd: /dev/rsd1c: Invalid argument >1+0 records in >0+0 records out >0 bytes transferred in 1 secs (0 bytes/sec) Not much can be written in blocks of size 1 byte :-). Bruce