LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2016, 11:30 PM   #1
easybullet3
LQ Newbie
 
Registered: Oct 2016
Posts: 6

Rep: Reputation: Disabled
GNU ddrescue - can someone give me an appropriate command-line ?


i'm a newbie to Linux.
but i'm a confident Windows user.


I have a damaged hard drive with many bad sectors from my parents windows computer, attached via Sata cable to a Virtual Ubuntu (on my Windows Desktop).
i want to use ddrescue (GNU) to create a Disk Image.
Can someone tell me what to type into the ubuntu Terminal to achieve the following:
  • invoke ddrescue.
  • skip over bad sectors (to avoid wasting hours and hours of time).
  • create a Log (map file) to enable ddrescue to resume itself if the computer hangs or crashes or restarts.
  • avoid imaging the Windows System Files (MBR) partition (as i dont intend to restore windows.. I only want to recover data and not waste time imaging windows OS files).


Extra Questions (to add to the above):
  • Am I supposed to Un-Mount the damaged drive before invoking ddrescue ? how can I do this ?
  • Will I be able to run ddrescue a 2nd time more thoroughly to try to image the sectors that were skipped on the 1st image and then MERGE these 2 images to create a more complete image ?
  • Can I control how often the mapfile saves itself ?
  • Can I control how many attempts it makes to read a sector before skipping to the next sector ?


Software/hardware info:
i'm running Ubuntu GNOME from a USB Memory Stick (virtual machine, and with Persistence on my Windows 7 Desktop computer).
Faulty Hard drive is connected to the motherboard with Sata Cable.

PS: Am I correct in doing this with Virtual Ubuntu ? or would I be better off installing ubuntu as a dual boot on my windows desktop ?
i am under the impression that the virtual machine Persistence setting will allow for the ddrescue mapfile to resume itself if the computer crashes or restarts.
 
Old 10-24-2016, 02:45 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
Run the 'info ddrescue' command. The information you want is there.

Personally, I would _not_ do this from a virtual environment. Perhaps a live CD (e.g. SystemRescueCd), with persistence so you can save the log file, is your best option.
 
Old 10-24-2016, 03:03 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Agree with all the above.
However, "info" can (would) be difficult to navigate for an admitted new user. Easier to read the doco on the web here - includes examples.
 
Old 10-24-2016, 10:15 PM   #4
easybullet3
LQ Newbie
 
Registered: Oct 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
Run the 'info ddrescue' command. The information you want is there.

Personally, I would _not_ do this from a virtual environment. Perhaps a live CD (e.g. SystemRescueCd), with persistence so you can save the log file, is your best option.
i apologise: I was calling it Virtual. but actually it is a Live USB version of Ubuntu... (it boots from my USB stick with 'UneBootin' software)

Persistence is set already. (i set 300mb), do you think thats enough ?

also:
have you ever tried using DDRescue-GUI ?
i can imagine the GUI interface would be much easier for me... but I do worry it may not be as powerful as using ddrescue in the terminal.

my hard disk has loads of bad sectors. (eg: i originally tried a windows recovery software which took 2 days to reach 4% of the drive).
I am trying to recover files.. and google has led me to Linux and dd rescue as a superior option to windows recovery.

am i correct in wanting to do a disk image, and not a clone ?
or not ?

Last edited by easybullet3; 10-24-2016 at 10:16 PM.
 
Old 10-24-2016, 10:26 PM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
If I recall, ddrescue doesn't make images. It rescues data as files.
 
Old 10-25-2016, 06:22 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
I have had success using ddrescue to recover partitions to single files that can be mounted. The last logfile I recorded was less than 400KB for a 20GB partition.
I have not tried DDRescue-GUI; but I am comfortable at the command line (where the up arrow key can be your friend).
Using recovery software like ddrescue to create an image can do wonders. My last use was on a DVD filled with photos. I got all but 4KB back, a small fraction of the total.
 
Old 10-25-2016, 03:27 PM   #7
LukeRFI
Member
 
Registered: Jun 2016
Location: Canada
Distribution: Various versions of Fedora
Posts: 30

Rep: Reputation: Disabled
I wrote a basic guide to using ddrescue (for data recovery) and posted it on another forum a while ago, if that helps.

https://www.recoveryforce.com/forums...php?f=18&t=245

A few things to consider:

1. Sector read errors are usually a sign of a bigger issue...especially if the drive is behaving as badly as you stated. If the data is of value, you should probably stop and consider seeking professional assistance before you kill the drive.
2. ddrescue is a sector-by-sector imaging program. You cannot target specific files, which is best practice for data recovery.
3. you can either image to a file on a formatted drive with enough space to hold the full image file or you can image directly to another hard drive, overwriting every sector with the content that you read from the source. But, if your destination drive is not zeroed out and your source has lots of bad sectors, it is best to fully erase the destination first, otherwise you could find a lot of mixed up data, should you need to run data recovery programs to recover the files from your copy
4. be super careful not to clone the wrong way...there is no undo and every sector overwritten cannot be recovered to its previous state

Good luck.
 
  


Reply

Tags
command line, ubuntu 14.04.1



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to optimize images in Ubuntu (GNU/Linux) using command line tools LXer Syndicated Linux News 0 06-29-2015 04:10 PM
LXer: Cool Command Line Apps for GNU/Linux and other Unix Systems LXer Syndicated Linux News 0 11-29-2008 10:50 AM
What is the the command line that will give me full DNS IP address? mrdancemachine Linux - Networking 17 05-19-2008 05:53 PM
LXer: Command Line Efficiency with GNU Perfect LXer Syndicated Linux News 0 07-30-2007 05:02 PM
LXer: A beginner’s introduction to the GNU/Linux command line LXer Syndicated Linux News 0 06-21-2006 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:31 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