From owner-freebsd-scsi@FreeBSD.ORG Tue Nov 13 13:39:55 2007 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF07A16A417 for ; Tue, 13 Nov 2007 13:39:55 +0000 (UTC) (envelope-from M.S.Powell@salford.ac.uk) Received: from abbe.salford.ac.uk (abbe.salford.ac.uk [146.87.0.10]) by mx1.freebsd.org (Postfix) with SMTP id 485BE13C4A6 for ; Tue, 13 Nov 2007 13:39:54 +0000 (UTC) (envelope-from M.S.Powell@salford.ac.uk) Received: (qmail 95129 invoked by uid 98); 13 Nov 2007 13:13:05 +0000 Received: from 146.87.255.121 by abbe.salford.ac.uk (envelope-from , uid 401) with qmail-scanner-2.01 (clamdscan: 0.90/3838. spamassassin: 3.1.8. Clear:RC:1(146.87.255.121):. Processed in 0.044601 secs); 13 Nov 2007 13:13:05 -0000 Received: from rust.salford.ac.uk (HELO rust.salford.ac.uk) (146.87.255.121) by abbe.salford.ac.uk (qpsmtpd/0.3x.614) with SMTP; Tue, 13 Nov 2007 13:13:05 +0000 Received: (qmail 2207 invoked by uid 1002); 13 Nov 2007 13:13:03 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 13 Nov 2007 13:13:03 -0000 Date: Tue, 13 Nov 2007 13:13:03 +0000 (GMT) From: "Mark Powell" To: freebsd-scsi@freebsd.org Message-ID: <20071113130614.Y99575@rust.salford.ac.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: scottl@freebsd.org Subject: Maximum block size on scsi tape? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2007 13:39:55 -0000 Hi, I'm having trouble with large block sizes. FreeBSD 7.0-BETA2 on amd64: ahc0: port 0xd000-0xd0ff mem 0xf5000000-0xf5000fff irq 20 at device 0.0 on pci7 ahc0: [ITHREAD] aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs ahc1: port 0xd100-0xd1ff mem 0xf5001000-0xf5001fff irq 19 at device 0.1 on pci7 ahc1: [ITHREAD] aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs ... sa0 at ahc1 bus 0 target 6 lun 0 sa0: Removable Sequential Access SCSI-3 device sa0: 160.000MB/s transfers (80.000MHz DT, offset 31, 16bit) In variable block-size mode, it seems to have a 64KB maximum: # mt blocksize 0 # sdd if=/dev/random of=/dev/sa0 bs=32k count=1 sdd: Read 1 records + 0 bytes (total of 32768 bytes = 32.00k). sdd: Wrote 1 records + 0 bytes (total of 32768 bytes = 32.00k). Try to read it back without specifying a buffer size: # sdd if=/dev/sa0 -onull (sa0:ahc1:0:6:0): 32768-byte tape record bigger than supplied buffer sdd: Input/output error. Error reading '/dev/sa0'. sdd: Read 0 records + 0 bytes (total of 0 bytes = 0.00k). sdd: Wrote 0 records + 0 bytes (total of 0 bytes = 0.00k). As expect we are warned that the blocksize is 32k. Do that with 64k and we get expected behaviour too: # sdd if=/dev/random of=/dev/sa0 bs=64k count=1 sdd: Read 1 records + 0 bytes (total of 65536 bytes = 64.00k). sdd: Wrote 1 records + 0 bytes (total of 65536 bytes = 64.00k). # sdd if=/dev/sa0 -onull (sa0:ahc1:0:6:0): 65536-byte tape record bigger than supplied buffer sdd: Input/output error. Error reading '/dev/sa0'. sdd: Read 0 records + 0 bytes (total of 0 bytes = 0.00k). sdd: Wrote 0 records + 0 bytes (total of 0 bytes = 0.00k). But go beyond 64k and the blocksize seems to be limited: # sdd if=/dev/random of=/dev/sa0 bs=65k count=1 sdd: Read 1 records + 0 bytes (total of 66560 bytes = 65.00k). sdd: Wrote 1 records + 0 bytes (total of 66560 bytes = 65.00k). # sdd if=/dev/sa0 -onull (sa0:ahc1:0:6:0): 65536-byte tape record bigger than supplied buffer sdd: Input/output error. Error reading '/dev/sa0'. sdd: Read 0 records + 0 bytes (total of 0 bytes = 0.00k). sdd: Wrote 0 records + 0 bytes (total of 0 bytes = 0.00k). What's going on here? Why is blocksize getting limited to 64k? Isn't that rather small these days? An LTO-2 drive can support block sizes in the megabytes. Or is this just a problem in variable block mode? Yes, I don't understand how sa(4) really works :) Many thanks. -- Mark Powell - UNIX System Administrator - The University of Salford Information Services Division, Clifford Whitworth Building, Salford University, Manchester, M5 4WT, UK. Tel: +44 161 295 6843 Fax: +44 161 295 5888 www.pgp.com for PGP key