Backup

From Torben's Wiki

Jump to: navigation, search

As harddisks are known to break from time to time and re-setting up an old measurement pc is quite some pain in the ass doing a backup onto an external USB harddisk (40-100€) might be worth thinking about...

Basically we have to distinguish between two types of backups:

  1. Frequently changed data (your personal data)
  2. Full image of the PC (important for measurement PCs), that includes all needed drivers, libraries, etc and allows restoring of the PC in no time

The first one should be done very frequently (daily/weekly?), the second one once a year or whenever some greater changes to the PC are done.

Concerning the USB harddisk I prefere small 2.5" ones that work without a separate power supply. For home use some 100GB should be enough, depending on whether you want to backup your home-made-porno-collection as well.

Here I wrote a little guide that might help you.
ps: If my guide saves you in future I expect some beers...
Happy backing up Torben (18.02.2010)

Contents

Backup of a single folder

Windows

I like the free tool Directory Compare and will now explain you how I use it to backup a single folder like My Documents (De: Eigene Dateien)

  • First get the tool. I prefer the .zip file version, since I see no need in installing it.
  • Unpack the zip-file or install the tool into some folder (remember this folder!)
  • Run the tool by starting "DirCmp.exe"
  • Select the folder you want to backup as "Source" and the one you want to copy it to as "Target"
    (e.g. your external harddisk/networkdrive etc, but keep in mind that the drive has to be connected using the same driveletter before stating the backup...)
  • Click on "Scan" as a test
  • Under "Options->Configure->Unattended mode" check "use direct API calls..." to prevent the tool to produce message windows
  • Click on File->Save to save this settings into a file (e.g. myBackup) that is placed in the program folder. e.g.:
    c:\program files\Directory Compare\myBackup
  • Leave the program
  • Use the windows explorer to navigate to the program folder
  • Right click on "DirCmp.exe" -> Create new Shortcut
  • Rename it to something nice
  • Right click on it -> properties (De: Eigenschaften)
  • Edit the link target (De: Ziel) and append "myBackup.dcp /m/q" without the "
    (/m stands for mirror=make target exactly the same as source, overwriting all changes to files done on taget)
  • Now just create a desktop shortcut to this file and you are done

Keep in mind, that all changes to files in the target folder are lost and overwritten with each backup, since /m is set, see above. If you want to keep an older version of the backup, just rename the folder on your external harddisk, so a new copy of all your data is created at the next backup.

In order to increase security, I strongly advice using two different USB harddisks alternating, e.g. one for even months/weeks, one for uneven ones. The reason is, that if your PC breaks while your USB disk is connected you might loose it... (This also keeps a little more history of changes)

Linux

Use the command line tool rsync e.g.:

rsync -rvhu --delete --delete-excluded dir1 dir2

rsync is able to speak ssh:

rsync -rvhu --delete --delete-excluded dir1 user@server:dir2

An alternative is rsnapshot (Thanks to Philipp)

Full image of a harddisk drive

I like the free tool DriveImage XML that be placed on a boot CD in order to do a full backup of a harddisk or partition. It can be found on some bootcds you can find in the net, like UBCD4Win or Hiren's BootCD, but I prefere creating a small personal bootcd without any other tools on it. In order to do so read the next passage or skip it if you already have a suitable boot cd with DriveImage XML on it.

Build a Boot CD

For some very strange reasons I was not able to build a working bootcd when running the tools in a virtualbox' WinXP. Using a "real" Windows (Vista 64 in my case) it all worked out fine...

  • Fetch Bart's PE Builder
  • Ensure you have a WinXP Install CD ready
  • Install Bart's PE Builder
  • Get the DriveImage XML plugin (.cab file) for Bart's PE Builder
  • Insert your WinXP CD
  • Run Bart's PE Builder
  • Tell the program where the WinXP install is located (CD Drive)
  • Click on plugins and add the previously downloaded DriveImage XML plugin
  • Close the plugin window
  • Enable the creation of an iso file
  • Start building
  • Close the program and burn the newly created image onto a cd (not the file, but use the iso-image-mode of your burn program)

Instead of burning directly you might want to try you bootcd first using virtualbox...

Backing up

  • FIRST: Attach the external hard disk that you want to store the image of your pc on
  • Boot from a bootcd that has DriveImage XML installed
  • Start the tool DriveImage XML
  • Do the backup and ensure that the image is stored on your external harddisk
  • Settings: Compression = "Low" makes sense

Alternative using a Linux CD and dd

dd if=/dev/sdXX of=/mnt/backup/sdXX.img

Thanks to Philipp

Personal tools