LinuxQuestions.org
Visit Jeremy's Blog.
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-10-2015, 05:05 AM   #1
Bonjour a tous
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Rep: Reputation: Disabled
trying to recover files from crashed HDD now plugged as USB in Ubuntu


Hello,
My HDD crashed in a windows7 computer, so I put another HDD in my computer and installed Ubuntu 17.04 on it. Now I try to get back data from my former HDD (important doc, xls and ppt files)
I actually was able to get back a lot of data with Photorec but with no names and random numbers. I don't mind looking one after the other but for the moment I could just be able to read 3 files, the rest are a mess of < ???xxx0000 ...>

So I tried Foremost but it's been 3 days and nothing!...
I ran:
sudo mkdir /foremostrec
sudo chown me /foremostrec
sudo foremost -v -t ole -i /devsdb -o /foremostrec
computer wrote:
Output directory/foremostrec
Configuration file: /etc/foremost.conf
Processing:stdin
--------------------------------------------------------------
File: stdin
Start: Thu Oct 8 10:21
Length: Unknown

Num Name(bs=512) Size ...
And no news yet.
And nothing in the doc, xls, ppt in foremostrec.

what can I do?

Thank you for reading.
 
Old 10-12-2015, 06:57 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 7,576

Rep: Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698Reputation: 698
You have done what I would have done.

If you NEED the stuff, go to a professional & try paying. But are you the only one with a copy of those files? Otherwise, get over it.

Also, analyse. The hard disk fault is either platter,(surface gone) or electronics. The pcb can often be bought from a disk manufacturer. That's another option.
 
Old 10-12-2015, 09:38 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Quote:
Originally Posted by Bonjour a tous View Post
I ran:
sudo mkdir /foremostrec
sudo chown me /foremostrec
sudo foremost -v -t ole -i /devsdb -o /foremostrec
computer wrote:
Output directory/foremostrec
Configuration file: /etc/foremost.conf
Processing:stdin
--------------------------------------------------------------
File: stdin
Start: Thu Oct 8 10:21
Length: Unknown

Num Name(bs=512) Size ...
I have marked the clues in bold. Since you told Foremost to read from an invalid device (it should be /dev/sdb, not /devsdb) it tries to read from stdin instead. Which in turn means that Foremost is waiting for 3 days now that you press some keys on the keyboard and if you do so it tries to recover data from those keys you pressed.
This of course won't work, as you have seen. If you fix that Foremost should work, but I doubt that it will find more than Photorec.

Anyways, if the crash was caused by a hardware problem with the disk you shouldn't do it this way at all, you should at first make an image of the disk (for example using ddrescue) and do all recovery attempts solely on the created image.
In the meantime, while those programs are working, think about a good backup strategy, if those files are important you shouldn't have to recover in the first place.
 
Old 10-31-2015, 08:58 AM   #4
Bonjour a tous
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile Thank you

I'm sorry, it has been a while...
Thank you for your advice. I bought a bigger HDD to make a image of my former one and will try to apply your advices.
... Including the backup strategy for the future.
I can't do it now because I'm in hospital but I'll try, and I may get in touch later if I have specific problems again.
Thanks !!
I will stay with Ubuntu anyway. It works perfectly with my new HDD .
 
Old 11-07-2015, 07:19 AM   #5
Bonjour a tous
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
I'm back.
Thank you for your help.
It seems I need more help , I'm sorry to ask again.

I tried to make the HDD image as I was told to.
My new 1 To HDD is installed with Ubuntu (/dev/sda) and my broken HD is connected through USB( /dev/sda
)
With ddrescue I wrote: (after some unsuccessful attempts)
sudo ddrescue -v /dev/sdb /dev/sda -f

It started to work properly but switched to a black screen.

What should I do?
 
Old 11-07-2015, 07:29 AM   #6
Bonjour a tous
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Of course it's not just sleep.
I tried a few things but no results.
Should I abort the process?
 
Old 11-07-2015, 07:46 AM   #7
Bonjour a tous
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
My son told me I should abort the process and I did.
But I can't boot again on Ubuntu , it wants to start on windows and can't access.
Oh no!!!
 
Old 11-07-2015, 08:02 AM   #8
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 14.04 LTS
Posts: 230

Rep: Reputation: 65
Quote:
Originally Posted by Bonjour a tous View Post
I'm back.
Thank you for your help.
It seems I need more help , I'm sorry to ask again.

I tried to make the HDD image as I was told to.
My new 1 To HDD is installed with Ubuntu (/dev/sda) and my broken HD is connected through USB( /dev/sda
)
With ddrescue I wrote: (after some unsuccessful attempts)
sudo ddrescue -v /dev/sdb /dev/sda -f

It started to work properly but switched to a black screen.


What should I do?
You overwrote your Ubuntu installation with the Windows installation, or at least you started until it crashed. You cannot use the medium you're booting from as the destination for you recovery operation.

Get yourself 2 usb sticks. On the first one you put a "live cd". I would recommend systemrescuecd. Then you boot it. Then you mount the second usb stick somewhere to use it for the logfile ddrescue produces. The logfile is needed if the ddrescue process gets interrupted. Then you just need to run ddrescue again and it continues where it left.

Before you run ddrescue TRIPLE CHECK!!! whether you got the right devices in the right order and run

Code:
ddrescue [options] infile outfile logfile
substituting infile, outfile and logfile of course.

Edit: if you wan't to write an image file, you DON'T want to write to /dev/sda. You need to mount it somewhere an use "/path/to/image.img" as the outfile.

Last edited by hortageno; 11-07-2015 at 08:06 AM.
 
Old 11-07-2015, 08:39 AM   #9
Bonjour a tous
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you so much !
I'm not sure how to "mount it somewhere" , just creating a folder with that name?
Don't laugh too loud...

What about reinstalling Ubuntu from a bootable USB on my new 1To HDD, put my broken HDD back inside and link my 1To through USB? That I can do I think...
 
Old 11-07-2015, 10:12 AM   #10
hortageno
Member
 
Registered: Aug 2015
Distribution: Ubuntu 14.04 LTS
Posts: 230

Rep: Reputation: 65
Quote:
Originally Posted by Bonjour a tous View Post
Thank you so much !
I'm not sure how to "mount it somewhere" , just creating a folder with that name?
Don't laugh too loud...

What about reinstalling Ubuntu from a bootable USB on my new 1To HDD, put my broken HDD back inside and link my 1To through USB? That I can do I think...
Ok, install Ubuntu on the new HDD. Connect the 2nd HDD and boot Ubuntu. Open a terminal and type "sudo bash" followed by your password. Now you have a root terminal. Install ddrescue with

Code:
apt-get install gddrescue
Check which device is the one you want to rescue. If it's /dev/sdb run

Code:
ddrescue /dev/sdb/ /path/to/image.img /path/to/logfile
Here's a good howto for ddrescue

https://www.technibble.com/guide-usi...-recover-data/

Edit: BTW if you know what partition the data is on, it's better to make an image of that instead of the whole hard disk.

Last edited by hortageno; 11-07-2015 at 10:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ubuntu 11.04 Crashed - need to recover a file but not sure how odimachkie Linux - General 8 08-15-2011 03:01 PM
Process crash while it reads write on the USB HDD and USB is plugged out. nitinarora Linux - Kernel 4 05-18-2009 04:37 AM
Laptop HDD messed up - can i recover the files somehow? brinstar Linux - Hardware 8 08-21-2007 02:02 AM
How to mount/recover files from crashed Linux OS? alar Ubuntu 3 09-14-2006 06:13 PM


All times are GMT -5. The time now is 02:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration