Compdigitec Labs

« | Home | »

How to use dd to copy, move and erase disks

By admin | August 14, 2008

Often, you may encounter the need to move a partition, copy a partition or copy a CD/DVD. The easiest and most user-friendly way to do this is with GParted. However, in a server environment or a command line environment where the GUI is not available, GNU dd is an good way to perform these simple tasks. Here are easy tips on how to use dd for disk manipulation. Most of these commands require you to be part of the “disk” group.

If you are on the Windows platform, you will need a copy of rawwrite dd for Windows in your %PATH%. To list the disks with rawwrite dd, use dd –list and use the devices listed there; for example, use “\\?\Device\HarddiskVolume1” instead of “/dev/sda1”. For CD drives, replace /dev/cdrom with “\\?\Device\CdRom0”.

  1. dd if=/dev/partition of=/dev/destination – Copy the partition partition to the partition destination.
  2. dd if=/dev/cdrom of=filename.iso – Make an ISO image of the disc in your CD drive as filename.iso. Then you can use in Virtual Machines such as VMWare, mount it in Windows with DaemonTools or mount it as an file system in Linux.
  3. dd something bs=speed – Performs the action something at the speed of speed bytes per second. Can be used to copy CDs and disks faster.
  4. dd if=/dev/zero of=/dev/pdest – Wipes the filesystem from the partition pdest, which can you can then make a new filesystem with mkfs.ext3 /dev/pdest.
  5. dd if=/dev/part of=filename.disk – Makes a intact backup of everything on the partition part into the file filename.disk.
  6. dd if=filename.disk of=/dev/part – Copies from intact backup filename.disk into the partition part. Make sure that the partition part is big enough to hold filename.disk.
  7. dd if=/dev/cdrom of=/dev/part bs=10M – Copies the CD filesystem on your CD to the partition part.
  8. dd if=/dev/fd0 of=filename.img – Copies the floppy in your floppy drive to filename.img. Then the image can be used in Virtual Machines.
  9. dd if=filename.img of=/dev/fd0 – Copies the image filename.img to the floppy in your floppy drive.
  10. dd if=/dev/disk of=bootsect.bin bs=512 count=1 – Copies the boot sector of disk disk to the file bootsect.bin.
  11. dd if=/dev/disk of=/dev/null – The best way to waste your CPU power; copies disk to NULL.

So as you can see, dd is a very useful tool to manipulate partitions and images. If you found this article interesting or helpful, please help us spread the word or please leave a comment!

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux, Windows | 11 Comments »

11 Responses to “How to use dd to copy, move and erase disks”

  1. David Rankin Says:
    May 16th, 2009 at 04:06

    Umm,

    bs doesn’t have anything to do with ‘byte speed’, it is simply ‘bytes’:

    bs=BYTES
    read and write BYTES bytes at a time (also see ibs=,obs=)

  2. Animal X Says:
    August 18th, 2009 at 04:36

    Thank you. I found this page very useful, including the comment by Mr. Rankin.

  3. sbo Says:
    February 15th, 2022 at 20:29

    … [Trackback]

    […] Find More Information here on that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  4. สล็อตวอเลท ไม่มีขั้นต่ำ Says:
    February 21st, 2022 at 20:55

    … [Trackback]

    […] Info on that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  5. 토토사이트 Says:
    February 24th, 2022 at 18:50

    … [Trackback]

    […] Read More here to that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  6. learn the facts here now Says:
    March 17th, 2022 at 12:35

    … [Trackback]

    […] Information to that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  7. 툰코 Says:
    April 5th, 2022 at 22:59

    … [Trackback]

    […] Read More on on that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  8. cc dumps online Says:
    April 25th, 2022 at 06:10

    … [Trackback]

    […] There you can find 28308 additional Info to that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  9. Godrej Bettahalli Says:
    June 9th, 2022 at 11:52

    … [Trackback]

    […] Read More to that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

  10. pg slot Says:
    June 19th, 2022 at 03:07

    ข่าววันนี้ Pg มีโบนัส ข่าววันนี้ เล่นเกมกับ Pg เกมสล็อตเรามีโบนัสให้เข้ามาเล่นเกม มีเท่าไรเล่นได้ไม่จำกัดมารอโบนัสกับเรามีเเต่ได้กับได้ คุณไม่ผิดหวังได้ผลตอบเเทนทุกเกมชัว

  11. live cvv shop 2022 Says:
    June 23rd, 2022 at 23:33

    … [Trackback]

    […] Information to that Topic: compdigitec.com/labs/2008/08/14/how-to-use-dd-to-copy-move-and-erase-disks/ […]

Comments