1819501 Members
3416 Online
109603 Solutions
New Discussion юеВ

dd blocksize limit

 
Brian Bartley
Frequent Advisor

dd blocksize limit

Hello, I'm using the /dev/zero device to erase disks. The document said to use dd if=/dev/zero of=/dev/rdsk/. It took over four hours to do one 2 gig disk. I'd like to set the blocksize to a higher number so the dd will go faster. Does anyone know what the best blocksize would be for this? Thanks, Brian
Brian Bartley
Campus Card Services
Indiana University
5 REPLIES 5
Hai Nguyen_1
Honored Contributor

Re: dd blocksize limit

I ran into the sam problem as you did. You can try bs=4096k which would reduce the amount of time to run dd greatly.

Hai
Pete Randall
Outstanding Contributor

Re: dd blocksize limit

dd defaults to a 512 byte block size. Specifying bs=1024k or even bs=2048k will speed things tremendously. Do not us ibs or obs, just bs.


Pete

Pete
Jeff Schussele
Honored Contributor

Re: dd blocksize limit

Hi Brian,

When using raw disks, block size should always be a multiple of the disk's sector size - 512 bytes. Not positive what the block size max is - it's 512 bytes default - but I've seen 64K used before, I believe.
dd would probably give you an error if you exceed max.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Dietmar Konermann
Honored Contributor

Re: dd blocksize limit

I would expect the best performance if you use the maximum request size, which is, as far as I know, 1MB for the scsi layer (bs=1024k). For LVM it is 256KB, since the requests are split on logical track group boundries.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
eran maor
Honored Contributor

Re: dd blocksize limit

Hi

well it dep. a lot of your system , if you have storng system with fast io you can you bs=4096k but it is recommend that you will use bs=2048k

dont forget to put the k in the block size :

dd if=/dev/zero of=/dev/rdsk/cXtXdX bs=2048k
love computers