Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Nov 1997 05:27:57 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, earle@isolar.Tujunga.CA.US
Cc:        freebsd-scsi@freebsd.org, gibbs@plutotech.com
Subject:   Re: FreeBSD 2.1-STABLE: Why can't I disklabel a SCSI disk?
Message-ID:  <199711281827.FAA09692@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711281827.FAA09692>