Vista Recipe
Before reading any further, don't expect to be able to restore a crashed Windows harddisk with Dirvish. It is simply not going to work because some NTFS features cannot be extracted or copied onto a Linux filesystem.
Dirvish however is an excelent tool to backup your data files in case they got lost or corrupted, and keep copies of old versions of files.
My current setup at time of writing
The really cool thing about this setup is that you do not have to be logged on at backup time. The Vista client just needs to be booted into the login screen.
Dirvish server
- Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz
- 8GB RAM
- Kubuntu 9.10
- 200GB reiserfs logical volume for backup storage (reiser doesn't use inodes, which is good when using loads of small files and hard links)
Network
- eth0: negotiated 100baseTx-FD
Windows client
Lenovo T61
Intel(R) Core(TM)2 Duo CPU T7100 @ 1.80GHz
2GB RAM
C: 35GB @ 95% used
D: 58GB @ 97% used
Microsoft Vista 32bits no SP
Local user has admin privileges
Copssh_3.1.1_Installer.exe
cwRsync_4.0.4_Installer.exe
WiFi has very bad performance and crashes at approx 16GB transfer.
Installation
On the Windows computer
download and install copssh do not start it yet
use Service account
download and install cwrsync do not start it yet
use Administrator account when possible to prevent as many file permission problems as possible
Copy the rsync.exe binary into the bin directory under copssh.
type "services.msc" in the Run box of the start menu
start copssh "OpenSSH SSHD" server and set Startup type to "Automatic"
use Activate a user for copSSH from the start menu and create a key pair for user Administrator
The key pair you created will be in the CopSSH install directory\ICW\home\Administrator
open the windows firewall for connections to port 22
notice that D: becomes /cygdrive/D through cwrsyncserver
connect from the dirvish server to the Windows computer via ssh (ssh Administrator@hostname ), a simple bash shell should come available
you should not need a password for ssh connectivity, otherwise your key pair is wrongly installed
disable acl's as these cannot be properly mapped to Linux ACL's
Check mount options before changing:
$ mount D:/ProgramsVista/ICW/etc/terminfo on /usr/share/terminfo type ntfs (binary,noacl) D:/ProgramsVista/ICW/bin on /usr/bin type ntfs (binary,noacl) D:/ProgramsVista/ICW/lib on /usr/lib type ntfs (binary,auto) D:/ProgramsVista/ICW on / type ntfs (binary,noacl) C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto) D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto) E: on /cygdrive/e type iso9660 (binary,posix=0,user,noumount,auto)
- Change setting for ACL's
cp /etc/fstab /etc/fstab.install echo "none /cygdrive cygdrive binary,posix=0,user,noacl 0 0" >> /etc/fstab
- To activate the new setting, logout and login again
logout ssh Adminstrator@hostname
- Check the new setting for "noacl":
$ mount D:/ProgramsVista/ICW/etc/terminfo on /usr/share/terminfo type ntfs (binary,noacl) D:/ProgramsVista/ICW/bin on /usr/bin type ntfs (binary,noacl) D:/ProgramsVista/ICW/lib on /usr/lib type ntfs (binary,auto) D:/ProgramsVista/ICW on / type ntfs (binary,noacl) C: on /cygdrive/c type ntfs (binary,noacl,posix=0,user,noumount,auto) D: on /cygdrive/d type ntfs (binary,noacl,posix=0,user,noumount,auto) E: on /cygdrive/e type iso9660 (binary,noacl,posix=0,user,noumount,auto)
- If the noacl does not appear, try a to stop and start the copssh service or reboot the machine.
On the dirvish server
- the default.conf file for the dirvish vault should look something like:
client: Administrator@hostname
tree: /cygdrive/c/
exclude:
$RECYCLE.BIN- run
time /usr/sbin/dirvish --vault laptop-C --init
to make the initial backup
- the first backup will most probably fail. check the rsync.errors file in your vault which files went wrong and put them in the exclude list of the default.conf
rsync: send_files failed to open "/cygdrive/c/hiberfil.sys": Device or resource busy (16) rsync: send_files failed to open "/cygdrive/c/pagefile.sys": Device or resource busy (16)
- your default.conf file will look something like this:
client: Administrator@hostname
tree: /cygdrive/c/
exclude:
/$RECYCLE.BIN
/hiberfil.sys
/pagefile.sys- remove or rename the existing directory and restart the --init job until it finishes without errors
- remember to edit /etc/dirvish/master.conf in two places!
bank:
/backup/laptop
Runall:
laptop-C
laptop-DThe resulting backupset sizes for yesterday's and today's sets:
du -sh */*/tree 24G laptop-C/20100205/tree 585M laptop-C/20100206/tree 45G laptop-D/20100205/tree 2.6G laptop-D/20100206/tree
After a few successful snapshots, you should examine the log files created for each snapshot and look for any files that are being backed up, but are rather useless to keep. Usually there are a lot of temp-files or cache files that do not need backing up.
Readable registry backup
With current releases of the software, it is easily possible to backup your windows registry! It makes changes to the registry searchable between backup sets, with your favorite Linux tools.
Just create an extra vault for your registry, and use the following default.conf:
client: Administrator@hostname
tree: /proc
exclude:
+ /registry
- /*Notice that the --init registy snapshot can have a multi-GB size, mainly because filesystem (blocksize) overhead!!
http://www.cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-proc-registry The /proc/registry filesystem provides read-only access to the Windows registry. It displays each KEY as a directory and each VALUE as a file. As anytime you deal with the Windows registry, use caution since changes may result in an unstable or broken system. There are additionally subdirectories called /proc/registry32 and /proc/registry64. They are identical to /proc/registry on 32 bit host OSes. On 64 bit host OSes, /proc/registry32 opens the 32 bit processes view on the registry, while /proc/registry64 opens the 64 bit processes view.
So on a 32bit Windows Vista it is sufficient to backup /proc/registry. On 64bit Windows Vista you want to backup both registry32 and registry64
default.conf:
client: Administrator@hostname
tree: /proc
exclude:
+ /registry32
+ /registry64
- /*
Notes
- probably a memory leak issue with rsync. this shows when a large number of files are in the backup set. Especially backing up both registry32 an registry64 in a single vault may run into problems.
