From owner-freebsd-scsi Mon Nov 24 12:32:58 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA02835 for freebsd-scsi-outgoing; Mon, 24 Nov 1997 12:32:58 -0800 (PST) (envelope-from owner-freebsd-scsi) Received: from isolar.Tujunga.CA.US (root@[128.149.24.254]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id MAA02830 for ; Mon, 24 Nov 1997 12:32:54 -0800 (PST) (envelope-from earle@isolar.Tujunga.CA.US) Received: from localhost.tujunga.ca.us by isolar.Tujunga.CA.US (4.1/SATAN-6.6.6) id AA24312; Mon, 24 Nov 97 12:31:29 PST Message-Id: <9711242031.AA24312@isolar.Tujunga.CA.US> X-Mailer: exmh version 2.0zeta 7/24/97 To: bde@zeta.org.au Cc: freebsd-scsi@freebsd.org, gibbs@plutotech.com Subject: Re: FreeBSD 2.1-STABLE: Why can't I disklabel a SCSI disk? In-Reply-To: Your message of "Sun, 31 Aug 1997 11:08:48 +1000." <199708310108.LAA13107@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 24 Nov 1997 12:30:19 -0800 From: Greg Earle Sender: owner-freebsd-scsi@freebsd.org X-Loop: FreeBSD.org Precedence: bulk A few months ago Bruce Evans (and others) helped me with a disk labelling problem I had trying to disk label a 4 Gb Seagate Barracuda to be the same DOS-translated geometry labelled as my other existing disks. Based on the other existing disks, I had come up with a prototype /etc/disktab entry and had tried to use it, getting the following error: partition c: partition extends past end of unit Bruce Evans replied as follows: >> xxxx1# tail -5 /etc/disktab >> >> seagate15150|Seagate ST15150N:\ >> :dt=SCSI:ty=winchester:ns#63:nt#255:nc#521:\ >> :pc#8385867:oc#0: >> >> (I changed the disktab entry to reflect the DOS remapped geometry) > > You didn't specify su#, so the disk size is ns*nt*nc = 63*255*521 = 8369865. > >> xxxx1# disklabel -w -r sd1 seagate15150 >> partition c: partition extends past end of unit > > oc+pc extends past end of unit. I kind of dropped the ball on this (he said, sheepishly) as the going-bad disk went into a lull where it wasn't having the same problems as before. Well, sure enough, it went south over the weekend and now I have to deal with it right away. 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? 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 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) xxxx1# dd if=/dev/zero of=/dev/rsd1 bs=1 count=2 dd: /dev/rsd1: Invalid argument 1+0 records in 0+0 records out 0 bytes transferred in 1 secs (0 bytes/sec) Any enlightenment you can provide would be greatly appreciated. (cc'd to Justin Gibbs and freebsd-scsi in case it's still too early in Australia for Bruce to see this, also in hopes someone can shed some light on the DIAGNOSTICS paragraph above vis a vis my DIOCSDINFO error. The box in question is JPL's main Usenet newsfeed box, and I need to get this disk disklabelled a.s.a.p. so I can try to back up the failed disk and get the server back in service.) Thanks in advance, - Greg P.S. This is on a Pentium 133 box running FreeBSD 2.1-STABLE.