Andries filmer

Feel free with Open Source Software

Andries Filmer - Internet professional sinds 1996.
Ik ben groot voorstander van Free- en Opensource Software (FOSS) en laat deze site jouw overtuigen waarom dit goed is.
Home Over deze website Kennisbank Ezelsoren Freelancer Online gereedschap

Harddisk clone disk and partition - Shred, a tool to erase a harddisk

Index
  1. Harddisk clone
  2. Partition clone
  3. Shred - Tool om een harddisk te wissen, erase a harddisk
  4. Comments

Harddisk clone

Clone your entire disk, all partitions, byte for byte, using the dd command. The replacement drive will be a turn-key, plug-in replacement for the original drive. Drive sdb has to be bigger!

 dd if=/dev/sda of=/dev/sdb bs=32768

The bs=32256 represents one complete track of 63 sectors each with 512 bytes. This is about the optimum in my experience with the hardware I have. Omitting the bs parameter will cause dd to default to 512 bytes in each transfer and can slow down the process significantly.

Partition clone

 sudo dd if=/dev/sda1 of=/dev/sdb1

If this partition is the boot partition we need to tell this to grub.

 sudo grub

Grub will launch and give you the grub> prompt. Here, type:

 find /boot/grub/stage1

You should see something come back that looks like hd(0,0). Jot that down, you’ll need it in a second.

Now, still in the grub> prompt, type:

 root hd(0,0)

You’ll put in whatever result you go above – it may be different than hd(0,0). Once that completes, type:

 setup (hd0)

Even if you got a result that differs from hd(0,0) above. Type:

 quit

And you’re out of grub. Restart your machine, removing the LiveCD and you should be up and running on your new hard drive. You may also encounter a problem on your first boot where the system will try to scan your hard drive for bad sectors. If that fails, you’ll find yourself in a root terminal session. Just type:

 fsck

Shred - Tool om een harddisk te wissen, erase a harddisk

Overwrite the specified device/file repeatedly, in order to make it harder for even very expensive hardware probing to recover the data. Start the server with an Ubuntu Server CD and choose for a live/try Ubuntu.

Open a Terminal and type:

 shred -fuvz -n 3 /dev/{device}

  • f: (force) change permissions to allow writing if necessary
  • u: (remove) truncate and remove file after overwriting
  • v: (verbose) show progress
  • n: (iterations) Overwrite N times instead of the default (25)

NOTE: Be aware that the data is definitely lost after running this command!

This page is created on 2009-11-19 and updated on 2011-05-06

I appreciate if you give some comment about this page. Please go ahead.
Your e-mailaddress will not be published it is only to contact you (if needed).

 
Your name
Your e-mailaddress
To prefent robots to use this form I ask you kindly to type the next characters in the input field.
 

 


Mijn Curriculum vitae | De content op deze website heeft de Creativecommons 3.0 licentie | © 2011
Andries Filmer | http://andries.filmer.nl | andries@filmer.nl | © 2011
Deze website wordt gerealiseerd met Free- en Open Source Software: | | | | | |