LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-09-2007, 11:35 PM   #1
HGeneAnthony
Member
 
Registered: Mar 2003
Posts: 178

Rep: Reputation: 30
How can I do a raw copy to make an image of a harddrive


I'm working on someone's hard drive which is corrupt, or at least the partition table seems to be. It has 2 partitions, a dell utility partition (which I can read) and the main partition (which I can't). Windows can not even detect the drive however Linux can. I can see and access the dell partition but as soon as I try to hit the main partition the whole drive seems to lock up and I can't even see the table anymore with the cfdisk command. I wasn't interested in backing up the drive using the dd command so I can do a raw copy. I figured I might be able to copy it this way. I don't have much experience with this but I'd like to dump the contents into an iso so I can use my drive recovery tools to work on it. What I'm wondering is what would be the best way to do this and does anyone have any better suggestions? What command should I use to do a raw copy of the drive?
 
Old 07-10-2007, 12:31 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Use ddrescue. It's designed for exactly this purpose. It works like the regular dd command, but it will keep attempting to read bad sectors for as long as you want it to instead of spitting out an error. Of course, if the drive is simply locking up completely when you attempt to access it, it might not work either.
 
Old 07-10-2007, 04:18 PM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Normally you can rebuild the Windows partition from the recovery partition from the main menu in Windows. Not sure about Dell, but Compaq would also give you the ability to create a recovery tools CD if Windows would be rendered inaccessible, and if you were not smart enough to create the OS CD's and the recovery tools CD before disaster struck, you could download the recovery tools CD from HP's web site.
If what you are after is to save the recovery partition and wipe the drive, reinstall the recovery partition, then use bootitng. Simply download the small utility, make a boot floppy or a boot CD if you have no floppy and boot with it into a dos environment. Say no to the first window to avoid installing it to the drive and go into maintenance, click on the partition work icon and highlight your recovery partition in the appropriate drive if you have more than one drive. Click on "image" on the right, it will say "paste pending" or similar at the bottom, if you want to put the image on a DVD, click on the radio button on the left for "CDz" and click "paste" on the right, follow instructions. You can also have a USB drive plugged in before going into partition work and it will show up as another drive and you can click on the radio button for that drive an click on the appropriate partition in it and select "paste", then navigate to the directory you want to put it in and type a name at the top and click OK, it will ask you what the maximum size of the image you want, go for the 4GB, if the image will be larger it will make more than one file, or burn it to more than one CD/DVD if required. When it asks if you want to validate the image, do it when creating, you do not need to validate when restoring.
Now run a test to see what size of partition your image will need for restoration, click on the drive partition or CD/DVD that contains the image file and select "image", it should ask if you want to create or restore an image, select "restore", then navigate to your image file and highlight it and click OK at the top, now at the bottom of the window it should say "paste pending" with the partition size required for the image.
It only copies data, not free space like dd, and compresses it. My Linux / partitions are 10GB, if they take up 5.5GB of it, the image size is 1.5GB. Most of my Windows partitions images are 15GB and the image is only 2GB.
Then once you've imaged the partitions you want to back up, highlight the partition(s) and click "delete" on the right and put a check in the "clear boot sector" and "wipe" boxes to wipe the drive by writing zeros across it and making like a new drive off the store shelf. Then when your left with free space, click on the free space and click "create" to create the partition, pick the appropriate file system and make it the same size as what it was when you made the image (or what the image requires), if it's Fat, leave the check mark in the "format now" box. Once the partition is created, after the surface scan (which will isolate any bad sectors), then you can restore the image and your back in business.
To restore, click on the CD/DVD button. or USB pen or external drive, or second/third/fourth internal drive that has your image and click "image" select "restore" and navigate to the directory that contains it and it will say paste pending at the bottom, navigate to the drive partition where you want to restore it too and paste it there.
Make a note as to what the size of the partitions are and the file system type for restoration as it has to be the same. Bootitng is adamant when it comes to creating partitions to properly align them within C.H.S. values, if the original partition was not properly aligned, the partition that the image needs will be slightly different in size, but if you use bootitng to make the new partition, it will jive with the image bootitng made, it may not necessarily be the size you specify.
You can use bootitng without obligation, once you install it to the drive for the boot manager features, you are "asked" to pay $35.00 US after 30 day trial.

Last edited by Junior Hacker; 07-10-2007 at 04:22 PM.
 
Old 07-10-2007, 04:33 PM   #4
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Actually, if you think it is just partition information in the MBR that is corrupt, you may want to try testdisk from a Live CD like knoppix. Testdisk recovers lost partitions and repairs corrupt MBR information. Just type: 'testdisk' in a terminal, how to use it? I don't know but I believe it is fairly easy. There have been many success stories using testdisk, even on systems that are all Window related. You can also use another Windows XP CD to fixboot in the Windows partition if that's where the issue is. Or fix MBR.

Last edited by Junior Hacker; 07-10-2007 at 04:35 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS raw printer only can print one copy: how to allow mutiple copies c4onastick Linux - Server 1 01-06-2012 11:26 AM
HD to HD raw copy with dd? mmx87 Linux - Hardware 1 09-10-2004 12:01 PM
HardDrive to HD image copy gerrymatbeacon Linux - Newbie 1 08-13-2004 03:18 PM
Samba Cups and RAW Printer - only one Copy ?! dancindoc Linux - General 0 03-28-2004 02:42 PM
raw cd copy hjles Slackware 2 05-02-2003 08:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration