Date: Sun, 28 Jul 1996 13:08:46 -0400 (EDT) From: Peter Dufault <dufault@hda.com> To: grog@freefall.freebsd.org (Greg Lehey) Cc: scsi@freefall.freebsd.org Subject: Re: Setting disk sector size? Message-ID: <199607281708.NAA01613@hda.com> In-Reply-To: <199607281545.IAA27303@freefall.freebsd.org> from "Greg Lehey" at Jul 28, 96 08:45:13 am
next in thread | previous in thread | raw e-mail | index | archive | help
>
> Yes, we have this option too (with a Tandem box, of course), and if
> things get too hard I'll do just that. But I didn't want to give up
> without a fight :-)
>
See if something like this works. You'll have to remove the final
"echo". I haven't tried it - I don't have a disk I'm willing to
change the sector size on right now.
#!/bin/sh
if [ "$#" != "2" ]
then
echo "Usage: blocksize ctl-device-name new-block-size"
exit
fi
CTL=$1
NEWSIZE=$2
# Print out the device we're about to destroy:
scsi -f $CTL -c "12 0 0 0 v 0" 96 -i 96 "s8 z8 z16 z4"
# Read in page 4. Actually, we only read the block descriptor.
set `scsi -f $CTL \
-c "1A 0 4 0 C 0" \
-i 0xc "{Mode data length} i1 \
{Medium type} i1 \
{Device Specific Parameter} i1 \
{Block descriptor length} i1 \
{Density code} i1 \
{Number of blocks} i3 \
{Reserved} i1 \
{Block length} i3"`
echo "Current block size is: $8"
# Corresponding mode select:
echo scsi -f $CTL -c "15 0 4 0 C 0" \
-o 0xc "i1 i1 i1 i1 i1 i3 i1 i3" $1 $2 $3 $4 $5 $6 $7 $NEWSIZE
--
Peter Dufault Real-Time Machine Control and Simulation
HD Associates, Inc. Voice: 508 433 6936
dufault@hda.com Fax: 508 433 5267
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607281708.NAA01613>
