From owner-freebsd-questions@FreeBSD.ORG Sun May 25 12:37:12 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0200637B401 for ; Sun, 25 May 2003 12:37:12 -0700 (PDT) Received: from sage-one.net (adsl-65-71-135-137.dsl.crchtx.swbell.net [65.71.135.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0ADC443F3F for ; Sun, 25 May 2003 12:37:11 -0700 (PDT) (envelope-from jackstone@sage-one.net) Received: from sagea (adsl-65-68-247-73.dsl.crchtx.swbell.net [65.68.247.73]) by sage-one.net (8.12.6p2/8.12.6) with SMTP id h4PJb81v002688; Sun, 25 May 2003 14:37:09 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20030525143707.0131a7e0@sage-one.net> X-Sender: jackstone@sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Sun, 25 May 2003 14:37:07 -0500 To: D Velez , questions@freebsd.org From: "Jack L. Stone" In-Reply-To: <3ED0E9B0.4060703@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, hits=-1.0 required=4.5 tests=EMAIL_ATTRIBUTION,IN_REP_TO version=2.54-sage_one.rules_v1 X-Spam-Checker-Version: SpamAssassin 2.54-sage_one.rules_v1 (1.174.2.17-2003-05-11-exp) Subject: Re: using dd to copy my freebsd partion to another drive X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2003 19:37:12 -0000 At 12:05 PM 5.25.2003 -0400, D Velez wrote: >Hi, I would like to know what would be the best >block size to use when using the dd command. >I read many web pages on how to use the dd >command, but all have different block sizes >and I am confuse. I see some as bs=512 bs=1024 >bs=8192, etc.... > >Is there a way to calculate the block size of the >two hard drives myself or is there a standard >block size to use for any hard drive, cdrom and floppy. > >I appreciate your help > >Thanks > >David V > This has been discussed quite a bit on the list. Here's one of those that should help you see what your computer wants according to the I/O: The obvious intention is to minimize the number of transfers, so theoretically the larger the transfer, the better. The maximum I/O transfer size is limited to the value of MAXPHYS, which is defined in sys/param.h: #ifndef MAXPHYS #define MAXPHYS (128 * 1024) /* max raw I/O transfer size */ #endif The ATA subsystem uses this value. SCSI drives were limited to 60 kB transfers, though this could have changed. I don't currently have any machine with SCSI disks connected, so I can't confirm that. A way to find is to run a command like sageame@sagec$ dd if=/dev/ad0c of=/dev/null bs=128k & sageame@sagec$ top -I dd if=/dev/ad0c of=/dev/null bs=128k & and in the background do an 'iostat ad0 1'. Here's an example with an IDE drive: === grog@zaphod (/dev/ttyp0) ~ 3 -> iostat ad0 1 tty ad0 cpu tin tout KB/t tps MB/s us ni sy in id 0 3 5.19 7 0.03 11 0 4 1 84 0 126 127.36 183 22.74 0 0 6 2 92 0 44 128.00 190 23.76 0 0 2 0 98 0 44 128.00 191 23.89 0 0 5 0 95 0 44 128.00 191 23.88 0 0 7 1 92 As you can see, it's really doing 128 kB transfers, for an average transfer rate of almost 24 MB/s. Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net