Table of Contents
dd
wipe your disk
Overwrite all partitions, the master boot record, and data:
dd if=/dev/zero of=/dev/sda bs=4M
This will overwrite everything with zeros (0).
Overwrite (more securely) all partitions, the master boot record, and data:
dd if=/dev/urandom of=/dev/sda bs=4M
This will overwrite everything with random data.
Progress check:
# to see the progress of dd enter: kill -USR1 $(pidof dd)
Repeat to check again.
wipe your mbr
To wipe out your MBR:
dd if=/dev/zero of=/dev/hda bs=446 count=1
Wipe out MBR -AND- partition table:
dd if=/dev/zero of=/dev/hda bs=512 count=1
create image of a windows disk partition
To create a copy or image of your hole disk or a partition, dd
is quite useful because you can mount the image. With the image mounted you can browse and even copy files out of the image.
I used this to create a backup copy of my windows partition before reinstalling. I booted with the rescue CD from http://www.sysresccd.org and did the following steps:
# figure out the disk layout, identify your source partition and where it should go fdisk -l # mount the ntfs data partition where the image will be placed: mkdir /mnt/backup-drive ntfs-3g /dev/sdc1 /mnt/backup-drive # dd (using bs=16M gave me a throughput of 40 MB/sec) dd if=/dev/sda2 of=/mnt/backup-drive/windows_c.img bs=16M # Alt+F2 to the next console window, and run this command so see the # progress of dd in you Alt+F1 console window while true; do sleep 5; kill -USR1 $(pidof dd); done
Mount the image to browse within:
mkdir /mnt/image_mount mount -o loop /mnt/backup-drive/windows_c.img /mnt/image_mount