[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] Windows backup / Linux bare-metal restore

Hello everyone,

I am working on a project where I have to backup to tape various Windows
machines (mainly XP Professional and Server 2k3). I have been testing many
schemes and solutions for the past weeks.

In my search for a quick and painless solution, here is the best method I have

>From Windows, do a normal backup. The job I use is based upon the windows full
set from a vanilla install, with some additions like:

RunBeforeJob = "\"C:\\Program Files\\Bacula\\bin\\make_catalog_backup\" bacula
  RunBeforeJob = "\"C:\\SetACL.exe\" -on \"\\\\SERVERNAME\\c$\" -ot file -actn
list -lst \"f:sddl;w:d,s,o,g\" -rec cont -bckp \"C:\\setacl-c.txt\" -silent"
  RunBeforeJob = "\"C:\\SetACL.exe\" -on \"\\\\SERVERNAME\\d$\" -ot file -actn
list -lst \"f:sddl;w:d,s,o,g\" -rec cont -bckp \"C:\\setacl-d.txt\" -silent"
  RunBeforeJob = "ntbackup backup systemstate /F \"C:\\systemstate.bkf\""

The "SetACL.exe" program is taken from setacl.sourceforge.net .

Restore part 1
>From Linux (currently Mandriva 2008.1 on an external USB hard drive, but any
other distro may fit), with a running MySQL database and a working bacula
installation, I bscan the tape to build the catalog.

Then, I restore to fresh NTFS partitions. Because the Windows setups I backupped
are in French, I need to be careful with encodings. The mount commands I use are
of the form:

mount -t ntfs-3g -o users,fmask=0113,dmask=0002,locale=fr_CA.UTF-8 /dev/sdb1

After restoring every file, I use "chntpw" from
http://home.eunet.no/pnordahl/ntpasswd/ , which permits me to reset the local
administrator's password.

Restore part 2
I reboot into Windows, in Active Directory repair mode. I don't know the exact
expression in English; it is one of the many failsafe modes available by
pressing F8 before Windows boots.

I login with the local administrator account, then I restore the ACL with:

C:\> SetACL.exe -on "dummy" -ot file -actn restore -bckp "C:\setacl-c.txt"
C:\> SetACL.exe -on "dummy" -ot file -actn restore -bckp "C:\setacl-d.txt"

Sometimes, SetACL will choke on certain files, like RECYCLER. You need to filter
the offending entries in "setacl-c.txt" and "setacl-d.txt" and restart the
process, until it ends successfully.

At last, I do a system state restore from "C:\systemstate.bkf", using NTBackup.

Final words
This describes the main steps I use to do a complete backup of a Windows
machine, and then do a bare-metal recovery. It works correctly, except for file
attributes. For example, hidden files are no more hidden. On the other hand,
Active Directory works, and the ACL are kept.

Alas, I am still stuck with an annoyance: I would like to get rid of NTBackup. I
need it to do a system state copy, because if I don't do a restore at the end,
Active Directory will complain and make Windows unable to boot. It would be nice
not having to copy a ~500 MB file every incremental backup.

Thanks, and hope that will help,
Alexandre Boily

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Bacula-devel mailing list

This mailing list archive is a service of Copilotco.