How to back up a windows installation

Now that I have installed winXP I think it’s time to back it up.

Summary

[Backup]
~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

[Verify backup files]
~$ md5sum /dev/hda1

~$ cat winxpsp2.img-part-* | bunzip2 | md5sum

[Restore]
~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

Detail

The dd command seems to be the way to go, but it backs up empty space as well, so I am using the compression tool bzip2 to ensure I don’t waste too much space. I’ll be storing the backup files on my network file server share.

First I’ll have to mount my file server shared directory:
~$ sudo mkdir /media/fileserver
~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

This command failed with the following error (grrr):
smbfs: mount_data version 1919251317 is not supported

After a quick google session I found that it means the smbfs package is not installed. I installed smbfs via: sudo apt-get install smbfs then executed this again:
~$ sudo mount -t smbfs //server01/shared /media/fileserver -o username=WindowsUserName,password=WindowsPassword

Now we are ready to backup not just the windows installation, but the entire partition that it is installed on.

The command to back up the partition is:
~$ sudo time dd if=/dev/hda1 ibs=4096 | bzip2 -v --fast | split -a 2 -b 1024m - winxpsp2.img-part-

Where sudo time dd if=/dev/hda1 ibs=4096 means:

sudo Super user do. That is, do the following command as the root user.
time Report how long the commands took
dd Disk Dump (as far as I know)
if In file
/dev/hda1 A reference to the partition that has windows on it
ibs Input byte size. That is, read 4096 bytes at a time
   

The results of the above commands are then piped into the bzip2 compression tool where bzip2 -v --fast means:

bzip2 Name of compression program
-v Do verbose logging (a bit pointless when piping – it really shouldn’t be there)
–fast Do fast compression. basically means it’s compressing smaller block sizes, which leads to sub-optimal compression. 7.5GB is still going to take about 2 hours on my AMD 2500+ CPU

The output of the compression tool is then piped (yet again) to a tool called split that splits large files into smaller ones. It uses the following syntax split -a 2 -b 1024m - winxpsp2.img-part- where:

split Name of splitting program
-a 2 The number indicates how many suffixes to use in the output file name. Say I split a large file into 3 pieces. I can use -a 1 to give me three files called filea, fileb and fileb. Using -a 2 would result in three files called fileaa, fileab and fileac.
-b 1024m Indicates the maximum size of each split output file – in this case 1024MB (1 gigabyte)
– winxpsp2.img-part-: The first dash means read from standard input (or piped input – same thing really). Usually you could put the name of a file to split. The ‘winxpsp2.img-part-‘ bit means to name each file winxpsp2.img-part- followed by the specified amount of suffices. In this case winxpsp2.img-part-aa, winxpsp2.img-part-ab, … winxpsp2.img-part-ah.

Eventually I guess I’ll do something silly and trash Windows XP. If that is the case I should be able to restore it by:
~$ sudo time cat winxpsp2.img-part-* | bunzip2 | dd of=/dev/hda1

Tada! A brand new windows installation in mint condition.

Installing Windows XP SP2

A lot of steps:

  1. Install WinXP SP2 from CD
  2. Adjust folder settings. I like to see the folders NOT in simple view. I also like to see extensions.
  3. Move ‘My Documents’ to be on another partition
  4. Install motherboard drivers
  5. Turn off firewall, autoupdate and virus protection, then disable security center alerts.
  6. Join my local PC workgroup.
  7. Set up network 10.10.0.x/255.255.255.0
  8. Configure the cmd shell. I like 100 chars wide, 55 deep, black background, light green text.
  9. Install a firewall. Currently using an old version of Tiny Personal Firewall (version 2). Might be time to try something else…
  10. Do lots of Windows Updates and enjoy your Windows Genuine Advantage check.
  11. Set https://google.com/ig as homepage in IE7
  12. Disable autoruns on all devices. (ie usb, CD’s, DVD’s etc)
  13. Install eraser to zero out all the unused HDD space.

It’s at this point that I figured the installation is worth backing up. (See next post…)

Making Ubuntu wife-friendly

At home the study PC is used by the entire family. We all share the same account. I’ve been getting quite into Ubuntu for quite some time now, the only thing stopping me from moving entirely to Ubuntu is the wife factor.

  1. Email clients are different.
  2. Everything looks different.

Our windows email client is Eudora. While it’s in the process of being open-sourced there is still no linux client. The reason we don’t just switch is due to the history. We’ve got 5+ years of emails, attachments and addresses stashed away in Eudora that I am not sure how to port over to something like Thunderbird.

So, in the meantime I’ve installed Ubuntu 7.04 (aka Feisty Fawn) – desktop edition to another partition and have settled on dual-booting until I can get these things sorted out. I am slowly working on problem 2 – Everything looks different…

I found a post on whirlpool that mentioned some of the things I was thinking – like xpde an xp theme for Ubuntu. But I didn;t like xpde, and figured I could come up with something that was more like the theme we use at home.

One guy mentioned replacing the Ubuntu menu icon with a more windowsy start icon.

 

The Ubuntu logo icon is called ‘distributor-logo.png’ and right now 95% of themes and icon sets are unaware of it as it has just been introduced. This will change. But for now, just replace it. Either globally (/usr/share/icons/hicolor/48×48/ap­ ps/distributor-logo.png) or per-user (~/.icons/name_of_your_current_ico­ n_theme/somedir/apps/gnome-main-menu.ext).

So I made one. Tada:

You can probably guess that I am a fan of Windows 2000 themes. We still use Windows 2000 at home, and I dislike the XP theme enough that I switched my work PC back to the Windows 2000 look’n’feel asap.

Update (7 March 2008)

I managed to get linux and windows reading the same profile information so they could share the same emails and address books. One way to do is outlined here, but I found an even easier way:

  • Install Thunderbird on first OS
  • Make sure your profile is stored on a partition that can be read by both windows and linux (ie a FAT32 partition).
  • Check everything is still AOK in first OS
  • Reboot into your other OS and open Thunderbird using the “-P” parameter to ensure the profile is asked for.
  • Point it to the funny named directory (something like 1a2s3d4fg5.default).
  • Tada! Your alternate OS can read and share the same email  and address book.

Worked a treat for me.