Operating System - Linux
1757573 Members
2867 Online
108862 Solutions
New Discussion юеВ

Re: for speed, should I also use 'bs' in 'dd' ?

 
SOLVED
Go to solution
Maaz
Valued Contributor

for speed, should I also use 'bs' in 'dd' ?

required: speed

i use to take backup of /dev/sda onto /dev/sdb, as following

dd if=/dev/sda of=/dev/sdb

should I also use 'bs' ?

if yes then what value for 'bs' is good

Note: I have two system groups, one has both(sda,sdb) disk scsi, and the group has both disk sata

Regards
Maaz
4 REPLIES 4
Ivan Ferreira
Honored Contributor
Solution

Re: for speed, should I also use 'bs' in 'dd' ?

Yes. You must use the bs option. And you have to do some tests to obtain the best performance. Start with 256k, then 512k, probably, 512k is the largest block size. You could also try 1024k.

Do test of some data and take the time, for example:

time dd if=/dev/sda of=/dev/sdb bs=256k count=100

And compare them with different block sized.

Another thing to consider is that probably you could use another tool to "image" your disk, avoiding the copy of unused disk space.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: for speed, should I also use 'bs' in 'dd' ?

Shalom Maaz,

bs, blocksize does improve or degrade performance in dd read/writes.

The value for best speed depends on the layout of the disk itself, which varies based on the OS and the size of the disk.

If you are using LVM, you can obtain information on this and set your size with pvdisplay data.

Now I've said it can improve performance, its not always necessarily going to be dramatic and therefore worth your time.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Huc_1
Honored Contributor

Re: for speed, should I also use 'bs' in 'dd' ?

Testing is the way to go, but for a really very complete read of all you ever wanted to know about dd and more have a look at this link.

http://www.softpanorama.org/Tools/dd.shtml

enjoy life.

Jean-Pierre Huc
Smile I will feel the difference
Maaz
Valued Contributor

Re: for speed, should I also use 'bs' in 'dd' ?

Hi SEP
>If you are using LVM, you can obtain
>information on this and set your size with
>pvdisplay data.

elaborate/explain please