Samstag, 25. Juni 2011

Hard Disk backup / mirroring with Ubuntu and dd

In this post I will show you how to mirror  your hard disk with Ubuntu and the dd command. I used this method to backup the data from my laptop, which didn't start anymore. I was sure the hard disk was still alive and i wanted to save all my data.

You will need a s-ATA to USB cable like this one
At first you've got to make sure both hard disks are connected to the PC.
In my case /dev/sdc is the source and /dev/sdd is the target hard disk.


Use this command to mirror the whole hard disk, bit per bit.

pv /dev/sdc | dd bs=128k of=/dev/sdd
Where /dev/sdc is the source- and /dev/sdd is the target-hard-disk!

The dd command copies the hard disk bit per bit and the pv command adds a neat progress bar, because by default dd comes with no visual feedback.


For me it took like 3 hours to mirror all the data to my new USB-hard-disk.

Datensicherung / Festplattenbackup mit Ubuntu

Der Laptop, auf dem ich die meisten Artikel hier verfasst habe, hat nach einer Bierdusche das Zeitliche gesegnet. Da die Festplatte aber noch lief und ich die ganzen Daten vor der Reparatur sichern wollte habe ich mich ein bisschen über Datensicherung mit Ubuntu schlau gemacht.

s-ATA-USB-Kabel mit Stromversorgung und IDE-Anschluss
In dem Laptop war eine 320 GB Festplatte verbaut und glücklicherweise habe ich auch eine 320 GB USB-Festplatte von CnMemory. Am einfachsten habe ich mir eine komplette 1:1 Spiegelung der Laptop-Festplatte vorgestellt. Dazu brauchte ich ein s-ATA zu USB Kabel wie z.B. dieses hier.
Ubuntu  hat die s-ATA-Festplatte des Laptops dann sofort als /dev/sdc erkannt. Die USB-Festplatte auf die ich die Daten sichern möchte ist /dev/sdd.

Nach ein wenig googeln und nachlesen in den manpages habe ich mir dann diesen Befehl zusammengesetzt:
pv /dev/sdc | dd bs=128k of=/dev/sdd
Wo /dev/sdc die Quell- und /dev/sdd die Zielfestplatte ist!

dd ist der eigentliche Befehl zum bit-genauen Kopieren der Festplatte ist, durch den Befehl pv wird die Ausgabe von dd mit einem Fortschrittsbalken versehen.


Nach ein paar Stunden war die gesamte Laptop-Festplatte auf meine USB-Festplatte gespiegelt, inklusive der verschiedenen Partitionen und Betriebssysteme!

Mittwoch, 22. Juni 2011

Ubuntu in Big Bang Theory

Saw this episode just a few minutes ago :D

Ubuntu in Big Bang Theory

Lief vor ein paar Minuten auf ProSieben :D