View previous topic :: View next topic |
Author |
Message |
guitarman Guru
Joined: 26 Apr 2004 Posts: 307 Location: http://mattsbox.dyndns.org:81/
|
Posted: Tue Sep 21, 2004 1:12 am Post subject: Making exact image of hard drive [Solved] |
|
|
Hi,
I want to make an exact copy of my windows hard drive to make a backup so I can transfer my linux setup to it and I'm not quite sure the best way to do this. If i use the dd command:
dd if=/dev/hda of=/dir/file
Does it make a copy of all the space I've used on the windows drive or would it make an image 250gigs since thats the capacity of the windows drive? If i was to do dd if=/dir/file of=/dev/hdb would that make my second hard drive exactly like my first one was(Would it be bootable)?
Last edited by guitarman on Mon Sep 27, 2004 2:25 am; edited 1 time in total |
|
Back to top |
|
|
PowerFactor Veteran
Joined: 30 Jan 2003 Posts: 1693 Location: out of it
|
Posted: Tue Sep 21, 2004 1:52 am Post subject: Re: Makeing exact image of hard drive |
|
|
guitarman wrote: |
dd if=/dev/hda of=/dir/file
Does it make a copy of all the space I've used on the windows drive or would it make an image 250gigs since thats the capacity of the windows drive? | It would make an image the same size as the capacity of hda. So yes it would make a 250gig image file if that how big that hard drive is.
Quote: | If i was to do dd if=/dir/file of=/dev/hdb would that make my second hard drive exactly like my first one was(Would it be bootable)? | It would be bootable if the two drives are the same size, model, etc. It might be bootable otherwise. But it's not a good idea in general to copy full drive images between drives that are not identical because the partition table from one drive might not "fit" the other properly due to geometry differences.
It's ok to copy partitons from one drive to another with dd. But I usually advise using file level tools like cp or cpio to do that. Unless of course its an ntfs partition or something else where dd is the only otion. |
|
Back to top |
|
|
guitarman Guru
Joined: 26 Apr 2004 Posts: 307 Location: http://mattsbox.dyndns.org:81/
|
Posted: Tue Sep 21, 2004 1:57 am Post subject: |
|
|
Thanks for the reply. So is there a way i could make some kind of back up that i could transfer between 2 different drives? What I want to do is take my linux setup from my 80 gig hd and transfer it to my 250 gig hd but id like to save what i got on my windows hd (the 250gig one) and transfer that to my 80 gig hd. I only used 30 gigs on my windows drive and there is enough space to save it all on my 80 gig drive which has linux on it. |
|
Back to top |
|
|
KingTaco Developer
Joined: 22 Aug 2003 Posts: 207 Location: Bay Area, CA
|
Posted: Tue Sep 21, 2004 2:15 am Post subject: |
|
|
you might be able to
Code: | # dd if=/dev/hda1 | gzip -9 > hdb.iso.gz | that would produce a compressed image. Otherwise, buy a copy of norton ghost. _________________ Explaining the obvious to the oblivious.
Adopt an unanswered post today -- https://forums.gentoo.org/search.php?search_id=unanswered |
|
Back to top |
|
|
PowerFactor Veteran
Joined: 30 Jan 2003 Posts: 1693 Location: out of it
|
Posted: Tue Sep 21, 2004 2:19 am Post subject: |
|
|
Yep you should be able to do that. I guess windows is on one big partition that fills the whole drive. And I'm guessing it's ntfs.
First you need to resize the windows partition to make it small enough to fit on the 80gig drive. Best make it a little smaller, you can always expand it again later. You can resize it using ntfsresize and fdisk. Or you can use qtparted for a nice gui to handle it all in one step. Don't use qtparted on gentoo though if you're running a 2.6 kernel. If you don't have a 2.4 kernel handy for gentoo then use knoppix, it comes with qtparted. After that you can use dd to make an image of the partition. You can pipe it through bzip2 to make the image smaller and easier to store temporarily. After you've copied your gentoo partitions off the 80 gig drive you can create a partition for windows on it then use dd to restore the image to that partition.
How to copy the gentoo partitions has been addressed in several threads already. Just search for them. |
|
Back to top |
|
|
guitarman Guru
Joined: 26 Apr 2004 Posts: 307 Location: http://mattsbox.dyndns.org:81/
|
Posted: Tue Sep 21, 2004 2:29 am Post subject: |
|
|
Thanks for you answers will try resizing my ntfs partition and backing it up to fit my 80 gig hd. |
|
Back to top |
|
|
|