another "tar" question - backup XP

Doncho N. Gunchev mr700 at globalnet.bg
Tue Aug 3 20:52:10 UTC 2004


On 2004-08-03 (Tuesday) 22:44, Mick Mearns wrote:
> Hello list;
>   I would like to know how to zip/bzip2/tar.gz etc my Windows XP
> partition.
> 
>  I rarely use XP, when I last did - I realized what a PITA it was to
> get current.
> (fdisk/format/w98se/upgrade to XP/load drivers/load SP1/patch/load
> progs)
> 
> So I would like to make an iso (while I still have space), and burn it
> to DVD.
> 
> I know that Linux file permissions are not possible on vfat, but how do
> I save the vfat file attributes? hid/sys/archive
> 
> Is there a script out there to do this?
> 
> Thanks
>    Mick M.
> 
> =====
> Dogs have Masters - Siamese Cats have Staff!

    I do not know such, but I can give you an idea: mount your fat partition,
create a file with zeroes to take all the free space on that it, umount the
partition and compress and backup the whole partition. I assume you have your
XP on /dev/hda2, so:

[root at fedora ~]# mkdir /mnt/c
[root at fedora ~]# mount /dev/hda2 /mnt/c
[root at fedora ~]# cd /mnt/c
[root at fedora /mnt/c]# cat /dev/zero > ZEROFILE
cat: write error: No space left on device
[root at fedora /mnt/c]# rm -f ZEROFILE
[root at fedora /mnt/c]# cd
[root at fedora ~]# umount /mnt/c
[root at fedora ~]# sync
[root at fedora ~]# dd if=/dev/hda2 | bzip2 -vv -9 > /mnt/home/hda1.bz2
# ( or 'dd if=/dev/hda2 | gzip -9 > hda1.gz' )

    Then backup /mnt/home/hda1.bz2 where you want. You need the 'ZEROFILE'
in order to full the unused partition space with zeroes, which will be
compressed very much (128MB zeroes | bzip2 -9 > 112 bytes). When you need
to restore your XP just do 'bzcat hda1.gz > /dev/hda2'. All files and
permissions (this trick can be done a bit harder with any fs) will be 1:1.

!!! WARNING !!!
    1. You should restore to the same partition (size).
    2. Any mistake like /dev/hda1 instead of /dev/hda2 will totally destroy
/dev/hda1.
    3. This does not take care of the MBR. You might need to recover
it with the XP's rescue mode -> manual -> restore boot sector.
!!! WARNING !!!

    Hope this helps :)
    PS: I used such trick to 'clone' some machines with same hardware and
disks.

-- 
Regards,
  Doncho N. Gunchev    Registered Linux User #291323 at counter.li.org
  GPG-Key-ID: 1024D/DA454F79                        http://pgp.mit.edu
  Key fingerprint = 684F 688B C508 C609 0371  5E0F A089 CB15 DA45 4F79
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040803/52c705ae/attachment-0001.sig>


More information about the fedora-list mailing list