This document is made to be easily skimmed. The latest addition was on 5-21-2009, 'DVD backup of hard drive partition'. This is comprehensive documentation for one of the most useful Linux/UNIX Windows commands-dd. It is a bit-stream duplicator for duplicating data. If you have a question, post it.
First Time visitors please leave a reply.
New Content, for a while at least.DVD backup of hard drive partition:
dd if=/dev/hda3 of=/home/sam/backup_set_1.img bs=1M count=4600
dd if=/dev/hda3 skip=4600 of=/home/sam/backup_set_2.img bs=1M count=4600
dd if=/dev/hda3 skip=9200 of=/home/sam/backup_set_3.img bs=1M count=4600
And so on ... Burn the images to DVD+R/RW:
wodim -dev=/dev/hdc --driveropts=burnfree /home/sam/backup_set_1.img
and so forth ... To restore, load the DVDs in order, and:
dd if=/media/dvd/backup_set_1.img of=/dev/hda3 bs=1M conv=sync,noerror
Load another DVD
dd if=/media/dvd/backup_set_2.img of=/dev/hda3 seek=4600 bs=1M conv=sync,noerror
Load another DVD
dd if=/media/dvd/backup_set_3.img of=/dev/hda3 seek=9200 bs=1M conv=sync,noerror
and so forth ...
You wrote chat messages and emails on your girlfriend's computer. You deleted everything. But you want to make sure a private investigator and/or computer consultant can't find it.
dd if=/dev/sda | sed 's/Wendy/Janet/g' | dd of=/dev/sda
Where every instance of Wendy is replaced by Janet, over every millimeter of disk. I picked names with the same number of characters, but you can just pad a smaller name with blanks.
Windows users will find help about 50 lines down from here.
FYI: duplicateing smaller partition, or drive to larger partition, or drive; or vice versa:
rsync -avH --exclude=/other_mount_point/ /mount_point/* /other_mount_point/
You want to duplicate the root directory tree to another drive, but the other drive is larger. If you use dd, you will get a file system that is smaller then the larger destination drive. To duplicate files, not the file system: Format and mount the destination drive:
rsync -avH --exclude=/mnt/destination_drive/ /* /mnt/destination_drive/
will duplicate all the files as files. You need to run:
from a the rescue menu of an installation CD/DVD for the target to become bootable. If target was previously bootable, it remains bootable.
MS Windows Section
Use dd for drive cloning, backup, upgrading, and restore tasks. Boot a Windows XP machine with a Knoppix CD; A live CD Linux system. Download Knoppix, burn the iso image file to a CD, boot with it, and clone drives. Drives are described to the dd command using device files. Boot into Knoppix, and open a root shell. It's in the penguin menu. (80 conductor grey ribbon cable) = /dev/hda for master; /dev/hdb for slave. SATA are /dev/sda and /dev/sdb.
fdisk -l /dev/hda
The partitions on the first drive.
The manual page for fdisk. Parted to make partitions
If one has trouble, ask. Knoppix is slow, because it runs on a CD drive (1/1000 the speed of a HDD). Feel free to read the entire post.
Dd is not presently able to clone Microsoft Windows Vista OEM Partitions.
The basic command structure is as follows: