Date: Sun, 25 May 2003 14:37:07 -0500 From: "Jack L. Stone" <jackstone@sage-one.net> To: D Velez <dvelez502@verizon.net>, questions@freebsd.org Subject: Re: using dd to copy my freebsd partion to another drive Message-ID: <3.0.5.32.20030525143707.0131a7e0@sage-one.net> In-Reply-To: <3ED0E9B0.4060703@verizon.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20030525143707.0131a7e0>