-
Making *.img to backup a Windows partition
Hello everyone,
Parcival reporting back into the wonderful world of Linux; my 1337 skills are sort of rusted in, however, so please bear with me.
So, here is my question:
What exactly allows me to create a custom tailored *.img file to backup the contents of a partition?
This is my problem:
My wife wants me to backup some Windows NTFS partitions on her working computer so she can use them on a different computer.
This is my solution attempt:
- Boot the Gentoo based System Rescue CD.
- dd the contents of the data partitions into *.img files on an external usb drive.
- dd the contents of the *.img files onto the new computer.
So far that worked, but there's one annoying problem: one partition on the work computer is 50GB big, but contains only 8GB of data. It would be really nice if I could just dd out those 8GB of "real data" instead of having a 50GB *.img file that is mostly empty. Likewise, it would be cool if there's an easy way to match the contents of the *.img file to the size of the new partition. The new data partition is 100GB big so it would be cool if my backup were automatically scaled to that size so I don't have an 8GB partition and an additional 92GB partition.
Thanks in advance,
Parcival
-
Parcival,
Nice to hear from you. I am on holiday in the Far East.
I think you can "resize" the 50Gb partition into a 8Gb before cloning it out by dd. This involves a bit of work/time especially if you want to expand the source partition back to the original size. Gaprted is the resizing tool I used normally. However if the MS system is a Vista or Win7 its resising function within the "Disk Management" is better as it is faster.
Think backup programs like rysnc, which gives you a size based on files, can do NTFS partition with some loss of file attributes according to this site. dd will not be used though.
Apparently Cloneziller is a variation of dd that can skip the empty spaces and hence faster but the partition size would not be changed. Not use it before myself.
For all the trouble I would just use a USB hard disk with a formatted NTFS partition to do drag and drop the folders from the computer. If the partition is a system related, which can prevent intervention of its system files, I would use a Linux terminal with ordinary copying tools like tar or cp. Most Linux distros are equipped with the NTSF-3g that can read and write NTFS partitions reliably.
-
You can use ntfsclone which only copies the actual data to its image files, the downside to using this is you won't be able to mount the image files with the loopback device. When restoring it will restore the filesystem to its original size, so if you want to copy it to a smaller partition, then you'll have to resize it before making the image, if you are copying it to a bigger partition then you can do a resize after restoring it. You can use ntfsresize to do the resizing, which is what Gparted uses.
-
DriveiImage-XML might be what your looking for. I've used it and its very straight-forward. No resizing. Can be run inside Windows.
HERE
Last edited by JohnT; 07-21-2009 at 07:32 PM.
-
Thank you for all your helpful advice. I will try it and tell you how it went.
-
Welcome back, Parcival.
Originally Posted by Parcival
It would be really nice if I could just dd out those 8GB of "real data" instead of having a 50GB *.img file that is mostly empty.
Why not issue this:
Code:
cat /dev/zero > tempfile && rm tempfile
The file, tempfile, needs to be created in the partition that you wish to back up. This will fill up the unused space on that partition with zeros, making it highly compressible. Now, you could issue this and create a compressed image of the same.
Code:
dd if=/dev/sdX ibs=4096 | lzma -vz9 > image.img.lzma conv=noerror
To restore, issue this:
Code:
dd if=image.img.lzma | lzma -dv | dd of=/dev/sdX
Also, I'd recommend that you use dcfldd instead of dd. It provides a graphical progress indicator, which, IMO, is pretty useful.
Last edited by i845_; 07-25-2009 at 05:57 PM.
-
I would like to know if you were successful in retrieving your image from the external USB drive using "dd"?
-
I fully recommend fog. I have also heard good things about ping
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|