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″.
- dd if=/dev/partition of=/dev/destination - Copy the partition partition to the partition destination.
- 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.
- 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.
- 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.
- dd if=/dev/part of=filename.disk - Makes a intact backup of everything on the partition part into the file filename.disk.
- 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.
- dd if=/dev/cdrom of=/dev/part bs=10M - Copies the CD filesystem on your CD to the partition part.
- 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.
- dd if=filename.img of=/dev/fd0 - Copies the image filename.img to the floppy in your floppy drive.
- dd if=/dev/disk of=bootsect.bin bs=512 count=1 - Copies the boot sector of disk disk to the file bootsect.bin.
- 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!