LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Back up windows NTFS with Linux (https://www.linuxquestions.org/questions/linux-general-1/back-up-windows-ntfs-with-linux-242458/)

theonebeyond 10-14-2004 02:24 AM

Back up windows NTFS with Linux
 
Hi there!

I wonder if I could make an image of a NTFS-Partition with a clean and fresh intstalled Win2k or WinXP on it from Linux, and recover it later, if I kill Windows by some error or something.

Like with the programm ImageMagig from DOS...

Is that possible?

Greetings, Sascha

rjlee 10-14-2004 05:48 AM

If you have a partition, say /dev/hda1, (or any other block device) then you can create a backup image of it using:
Code:

bzip2 < /dev/hda1 > hda1bak.bz2
You can then restore the image from backup using:
Code:

bunzip2 < hda1bak.bz2 > /dev/hda1
Make sure that /dev/hda1 isn't mounted for either of these operations. You can restore onto any partition of exactly the same size and geometry. Obviously, if you don't have enough space to make the image, it won't work.

Edit: This works for any block device, provided that the device isn't in use when you try this. An NTFS partition contains all of its data inside the partition, so this will work. It's not optimal, though; it will sit and read sectors of empty space for example. You can also use the dd command to make this more efficient, by reading block sizes equal to the cache size on the disk.

theonebeyond 10-14-2004 05:51 AM

And you are sure it works with NTFS drives?

It looks like it does to me, and that is exactly the way I thought it would be done... but I was too afraid to try until now :-)

Thanks very much!


All times are GMT -5. The time now is 11:36 AM.