Click to See Complete Forum and Search --> : Windows image backup on Linux


mobygeek
07-16-2001, 06:50 AM
I am dual booting Linux/Windows. I want to make a backup or ghost/image of my Win/Dos partition in Linux. I believe I need to mount my dos/win partition? Then run a dd command. Something like dd if=/dev/hda1 of=windows.img

Am I on the right track? Can someone please post me a step by step guide to doing this along with command lines. Also if I do the above, how do I restore the image file when I need to reinstall win/dos?

Thank you in advance.

MobyGeek

bdg1983
07-16-2001, 07:09 AM
I've never used dd myself as DriveImage works great with both fat and ext2 partitions.

Should have something in the man pages for dd. 'man dd'

To restore (if dd works with fat partitions), then just reverse the if= and of=.

Strike
07-16-2001, 07:38 AM
dd is just a data duplicator, if you copy all the data, it doesn't matter what format it is in. You could have a homebrewed partition on /dev/hda1, do

dd if=/dev/hda1 of=mypartition

and then zero it out, write random crap to it, and then restore it back with

dd of=/dev/hda1 if=mypartition

and it's as if nothing ever happened.

Basically, the syntax is just if=<where you get the data to be copied>, of=<the name of the file it's going to (which can be a partition or even a floppy, any block device or file should do)>, bs=<block size, you don't often need to use this>, count=<number of blocks to copy, if unspecified it will take all of the data out of the input file>. And that's about all the important ones.

mobygeek
07-16-2001, 08:13 AM
wow, cool guys, so I dont need to worry bout the .img extn? And do I still have to mount my win/dos drive?

Cheers

ronmon
07-16-2001, 08:19 AM
You can also do it with cp -ax.

mobygeek
07-16-2001, 08:23 AM
how do i use the cp - ax command? Do I have to mount my dos partition?

bdg1983
07-16-2001, 08:32 AM
A great bonus about Linux is that most commands have related manual pages for them.

man dd

man cp

Getting into the habit of using the man pages will certainly increase your knowledge of Linux.

Try the man page for cp and post back if you are still having problems understanding the command.