DON'T PANIC

Using dd to duplicate one hard disk partition to another one

Posted on: April 11, 2011


Situation:
* 1 hard disk completely installed as I like it.
* 1 hard disk without format.
* 1 extern disk with just format.
* VERY IMPORTANT: All hard disks must be to same size.

To copy the hard disk, which is completely installed as I like it, to an extern empty disk, first boot with a rescue cd then run:

root@buzz:~# dd if=/dev/sda of=/dev/sdb bs=2G 2> dd.errors

Notice that dd.errors is a file where all errors will be redirected.
if means “input file”, in that case is the hard disk that is completely installed as I like it.
of means “output file”, in that case is the extern disk.
bs means count of blocks at a time. In that case are blocks of 2G. It shouldn’t be more than the size ram.

Now, you should ran dd one more time, from extern disk to the disk without format. So boot with a recue cd again in order to access to disk without format.

root@buzz:~# dd if=/dev/sdb of=/dev/sda bs=2G 2> dd.errors

Reboot it, without rescue cd! aaaand enjoy!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Advertisements

  • None
  • analialorenzatto: Buzz is just a host name for this example, it doesn't have any relation to the topic. Instead of being "Buzz", could be whatever name.
  • fridelain: >buzz What's the story behind this host name? Actully running buzz, once running buzz and upgraded many times since, or unrelated to debian naming
  • Pratik: Nice, but I would change it to include more directories. Like my .mozilla and .kde4 by using .{config,mozilla,kde4} instead of just .config .

Categories

%d bloggers like this: