From owner-freebsd-scsi Sun Jul 28 10:15:56 1996 Return-Path: owner-freebsd-scsi Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA01367 for freebsd-scsi-outgoing; Sun, 28 Jul 1996 10:15:56 -0700 (PDT) Received: from hda.com (ip82-max1-fitch.zipnet.net [199.232.245.82]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id KAA01360; Sun, 28 Jul 1996 10:15:52 -0700 (PDT) Received: (from dufault@localhost) by hda.com (8.6.11/8.6.9) id NAA01613; Sun, 28 Jul 1996 13:08:47 -0400 From: Peter Dufault Message-Id: <199607281708.NAA01613@hda.com> Subject: Re: Setting disk sector size? To: grog@freefall.freebsd.org (Greg Lehey) Date: Sun, 28 Jul 1996 13:08:46 -0400 (EDT) Cc: scsi@freefall.freebsd.org In-Reply-To: <199607281545.IAA27303@freefall.freebsd.org> from "Greg Lehey" at Jul 28, 96 08:45:13 am Reply-to: hdalog@zipnet.net X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-freebsd-scsi@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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