LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trying to recover files from crashed HDD now plugged as USB in Ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-recover-files-from-crashed-hdd-now-plugged-as-usb-in-ubuntu-4175555764/)

Bonjour a tous 10-10-2015 04:05 AM

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.

business_kid 10-12-2015 05:57 AM

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.

TobiSGD 10-12-2015 08:38 AM

Quote:

Originally Posted by Bonjour a tous (Post 5432440)
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.

Bonjour a tous 10-31-2015 07:58 AM

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 .

Bonjour a tous 11-07-2015 06:19 AM

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?

Bonjour a tous 11-07-2015 06:29 AM

Of course it's not just sleep.
I tried a few things but no results.
Should I abort the process?

Bonjour a tous 11-07-2015 06:46 AM

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!!!

hortageno 11-07-2015 07:02 AM

Quote:

Originally Posted by Bonjour a tous (Post 5445960)
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.

Bonjour a tous 11-07-2015 07:39 AM

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...

hortageno 11-07-2015 09:12 AM

Quote:

Originally Posted by Bonjour a tous (Post 5445989)
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.


All times are GMT -5. The time now is 08:58 PM.