hard disk image

Place to discuss anything, almost. No politics, religion, Microsoft, or anything else that I (the nazi censor) deem inappropriate.

hard disk image

Postby Master of Reality » Tue Sep 27, 2005 4:52 pm

I think i have to get my laptop replaced (screen is a bit messed, i believe from a twisted cable or some such thing) and i dont want to reinstall everything when i get it replaced. Would i be able to create a hard disk image so that i could do that?
Would dd be able to create the image and do that with this?
# dd if=/dev/hda of=disk.img

And i have two partitions so would i have to do them separetly or the hard disk altogether?

Would the image be the complete 60GB of the hard disk, or would i be able to make it smaller so that it was just the 20GB of data i have on it?

It will be an exact replacement of the laptop so there should be no hardware issues.
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Void Main » Tue Sep 27, 2005 5:19 pm

Unless the drives are identical I wouldn't dd /dev/hda. Even if you think they are I wouldn't. If I use dd to back up a disk I usually do it partition by partition and yes, dd has to read the entire file system so you might want to shrink it first. There are alternatives. You can also use something like partimage:

http://www.partimage.org/

You could also just tar it up. Make sure that if you use dd that the partition you are backing up is unmounted and if using tar it's best to boot form alternate media and mounting the partition to tar up just to make sure all files are not being written to.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Thu Sep 29, 2005 2:10 pm

Do I have to do anything special to "format" a harddrive or do i just delete the current partitions, remake them with linux format, and then make2fs?

I have an 80GB external drive that current has a vfat partition that has some useless stuff on it which i am going to use to store my images.
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Ice9 » Thu Sep 29, 2005 3:13 pm

Nothing special, just did it with a spare 80GB drive I put in an Icy Box.
All I really did was fdisk /dev/sda, erase everything, make 2 new partitions and then mkfs -t ext3 /dev/sdax
Ice9
guru
guru
 
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium

Postby Void Main » Thu Sep 29, 2005 3:20 pm

You don't even have to do the mkfs. All you have to do is create the partitions because the filesystem is actually what you dd'd. When you write it back to the new partition it will be your in tact file system. It will just overwrite whatever file system you make there when writing the image back so... Before I back up a partition using dd I usually shrink the file system. I restore it to the new partition (or just dd from one partition to the new partition, even over ssh if on a remote machine, then I resize the file system on the new partition to take up the full space on the partition (resize2fs etc).
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Sat Oct 01, 2005 9:40 am

i actually ended up using partimage, and so i did have to re create the filesystem, although i messed it up by trying to make a reiserfs 4 filesystem, which wasnt supported by the rescue disk distro i was using. Eventually I did figure out to put the ext3 on and save the images to it.
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Master of Reality » Thu Oct 06, 2005 8:46 am

just a note to anyone having to send a laptop back.... i wouldnt suggest leaving in your rescueCD in the laptop you are returning which you will need to put the images on your new laptop.

Other than that... partimage is great to use for this.
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm


Return to The Lounge

Who is online

Users browsing this forum: No registered users and 1 guest

cron