Re: Questions about the dd command



On Fri, Feb 29, 2008 at 11:09:09AM -0500, elmo wrote:
I've spent literally hours trying to find direct answers on the dozens
of websites that discuss 'dd'
but the couldn't find what I wanted.

A few questions about the ' dd ' command:

For example: sudo dd if=/dev/sda2 of=/dev/sdb2 bs=1440

1. Which is preferrable; execute the command from an installed
ubuntu (/dev/sda2) or from a ubuntu CD?

CD. If you run it while the system is running, it may change the
contents of /dev/sda2 in the middle of the operation, and you'll end up
with an inconsistent copy.

2. How do you modify the example to show the data as it is being
copied?
Would this have a drastic effect on how long it takes to complete
the copy
compared to just watching a blinking cursor?

You can't, easily. Run killall -USR1 from a different terminal to see
the current progress whenever you get bored. Or estimate the time to
copy by dividing the partition size by the transfer speed

Run vmstat 1 and observe the bi/bo columns to see the current read/write
speed in kilobytes per second.

3. What effect on the does the ' bs = ' number have on
the time to complete the copy or the accuracy of the copy? Is
there a
default number if the the bs= is omitted from the command?

The default number is 512 bytes. Using a 1KB block size can be twice as
fast. When I played with it (running dd with various block sizes and
watching the I/O speed with vmstat), I didn't see any further speedups
with larger block sizes.

Block size has no effect on the accuracy. dd will copy the partial block
at the end of the partition correctly, even if the block size doesn't
divide the size of the partition.

HTH,
Marius Gedminas
--
You have moved the mouse. NT must be restarted for the changes to take effect.

Attachment: signature.asc
Description: Digital signature

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


Relevant Pages

  • mount
    ... I'm having an issue with mounting from the command line. ... partition on my built-in hard drive. ... partition from ubuntu so that I can transfer data between them, ... into command line, go to the mnt directory that I set up using mkdir, ...
    (Ubuntu)
  • Copying partitions in terminal mode
    ... Is it practical to use terminal mode to copy an entire ubuntu partition ... The command seems to be too simple to do a complete partition copy. ...
    (Ubuntu)
  • Ubuntu not using the swap partition
    ... OS: Ubuntu 7.10 x86. ... The number of cylinders for this disk is set to 38913. ... Command: p ... Partition table entries are not in disk order ...
    (Ubuntu)
  • using dd for cloning
    ... I have just about given up with using various cloning programs in ubuntu ... command to copy partition to partition ... I couldn't see any action except a constantly blinking mark. ... Can someone get me on the right track with the ' dd ' command? ...
    (Ubuntu)
  • IDE HDD fail?
    ... This caused after this command: ... Device contains neither a valid DOS partition table, nor Sun, SGI or OSF ... Offline data collection status: ... Self-test execution status: ...
    (Linux-Kernel)