= ___________________________________________________________________________ Howto Fix Windows by restoring a previously made Tar backup copy. Apr 16, 2005 David Gleba V0.02 Purpose: This method involves making a backup of a newly installed MS windows 2k/XP, using Linux and restoring it when Windows becomes broken or infected seemingly beyond repair. ___________________________________________________________________________ 1. Introduction: You install Windows, add the software you need to get going, and back it up. If there is a problem that is not easily fixed, you will at some point deem the installation easier to restore than to fix. This takes you through the process. Advantages of this system: -you can back it up to any media including the very same ppartition it is installed on. -you can rename the old system and keep it on the disk until you are comfortable that all the files you need from the old system are retrieved. -no need to format your drive. This same procedure can be used to backup a Linux system as well. 1b. Requirements: -fat32 format for windows partition. Not NTFS. -Kanotix live CD -Windows CD -disk space for backup. A 2.3 gig winxp install is about 11.2 gig backed up. 2. Partition the drive as per the following: Use Windows XP/2K setup CD to create empty unformatted partitions the sizes listed in the table below for the first three partitions. Use Kanotix live Linux CD or similar CD for the rest. It may be possible to use Kanotix to do all the partitioning, although I am not sure I have tested that. c: hda1 FAT16 1G Optional:Compatible format, use for booting and things that insist on being on c: drive. d: hda5 FAT32 6.1G Windows XP Main installation e: hda6 FAT32 6.4G Windows XP testing installation hda7 swap 350Meg Linux Swap hda8 ext3 5.3G Linux (EG: Mepis) hda9 ext3 5.45G Linux (EG: Debian-Kanotix) f: hda11 fat32 29.9G Data (rest of the disk can be data) etc... I don't think Linux can reliably write to NTFS, so I recommend Fat32 disk format. Note that you don't have to partition this way, it's just more flexible since you can run more than one operating system from the disk, and you can save stuff on one partition while working on or erasing another. Be carefull not to exceed the windows 127meg partition limit. Use different partition sizes to help uniquely identify each partition. Once this partitioning is done, the likelyhood of needing to change this is very low. I do change format of a partition at times. Eg: from reiser to ext3. Don't use too many partitioning programs on the same disk. In this case, start with Windows XP, then use Kanotix thereafter. 3. Install WindowsNT/2k/XP on d: Then Add the software you need to get productive. for example: -serv.pack 2 -norton internet security -printer: laser 4p -java You may want to back it up before it gets 'broken'. -openoffice -msn messenger -firefox -flash plugin for firefox -editpadlite -winrar or winzip -MSoffice-2000 -adobe pdf reader -nero burning rom Then back it up before it gets 'broken'. 4. Backup the windows system: Boot up the Kanotix CD and from a command prompt run the following commands. You may have to edit it to suit your partitions. su [to change to root user] cd /mnt/hda5 #tar -czvf /mnt/hda11/bwinxp-j-pf-b4l06.tgz /mnt/hda12/"Program Files"/* #tar -czvf /mnt/hda11/bwinxp-j-ds-b4l06.tgz /mnt/hda12/"Documents and Settings"/* #tar -czvf /mnt/hda11/bwinxp-j-b4l06.tgz /mnt/hda12/winxp/* Store these files somewhere like a DVD, another hard disk, or even on the same hard disk that you backed up. If you want to backup a linux o/s: tar --index-file=tarout5 --one-file-system -czvvf /mnt/hda14/bkd9hda5-mep-b5c29.tgz / Since this method makes the Windows folders listed below 'expendable', it is advisable to store your files/music/pictures/etc [this is your data] in another folder. "Program Files"/* "Documents and Settings"/* "winxp"/* Create a folder named something like c:\data and store all your files you want to keep there. Make subfolders in the c:\data folder. Some things cannot be kept elsewhere, such as Internet Explorer favourites, so you have to come up with a way around it or back them up. In this case you can: -import them to yahoo.com bookmarks periodically. -rename the "Documents and Settings" folder before you resstore and pluck the necessary info from it later. 5. Restore: If your system becomes broken and it can't be easily fixed, then you can restore the backup and be running again. The backup was taken after you installed just enough software to be productive. It will have some desktop.ini files showing up in menus and such, but these are easily deleted. The file permissions/attributes will not be ideal, but Windows doesn't respect those in many cases anyway. You can delete the folders that will be restored or just rename them for safe keeping. If you rename them, you can get what files you need from them in the next few weeks/months after restoring and then delete them when you no longer have great need for them. Boot up the Kanotix 2005-01 CD and from a command prompt run the following commands. You may have to edit it to suit your partitions. cd /mnt/hda5 #restore #tar -xzvf /mnt/hda11/bwinxp-j-pf-b4l06.tar.gz #tar -xzvf /mnt/hda11/bwinxp-j-ds-b4l06.tar.gz #tar -xzvf /mnt/hda11/bwinxp-j-b4l06.tar.gz If you want to restore a linux O/S: tar --same-permissions -xzvvvpf /mnt/hda14/bkd9hda5-mep-b5c29.tgz End. Keywords: backup, restore, fix Microsoft Windows XP 2000 2k, Linux, tar, ___________________________________________________________________________ Revision history. V 0.01 initial version Apr 5-2005 v 0.02 additions, May17-2005 ___________________________________________________________________________