LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Trying to restore hard drives-IDE connected to usb adapters (https://www.linuxquestions.org/questions/linux-general-1/trying-to-restore-hard-drives-ide-connected-to-usb-adapters-4175598410/)

anthonysaulnier 01-27-2017 09:44 PM

Trying to restore hard drives-IDE connected to usb adapters
 
Hi folks,

I have two IDE drives that Im trying to recover for a friend of mine. I have them connected to a USB hard drive adapter, and I need to find a way to retrieve the contents from them. I tried testdisk and it does not see the drives, and im not having any luck using gpart (maybe I dont know how to use it :( ).

In Windows, when I plug the drives the OS sees that there is some sort of drive connected, but I cant do anything because somehow the partitions are corrupted.

I remember doing this some time ago for a friend of mine, but I dont seem to have the documentation on what I did and I was wondering if anyone can give me any ideas.

Thanks in advance


Anthony

rknichols 01-27-2017 10:01 PM

What messages get logged (/var/log/messages perhaps -- depends on what Linux distro you are running) when you plug in the drive and USB adapter? A drive needs to be seen and have a /dev/sd{X} node created in order for any program to access it.

syg00 01-27-2017 10:09 PM

I have found adapters (especially IDE) to be particularly flakey. Keep an eye on dmesg and see if the drives are appearing then disappearing.
I have a (cheap) docking station that takes IDE and SATA, and it works fine for the SATA, but needs some serious jiggling to get the IDE to stay attached. However I also have an older fully encased Nexstar 3 which is a really solid unit, and that never has given a problem, but is a pain to have to dismantle to change disk.

YMMV.

anthonysaulnier 01-27-2017 10:47 PM

Yeah I ran the dmesg command with the drive connected and without it connected and there are differences between the outputs, in particular with the USB hardware detected, so the computer definitely seems something when the drives are connected.

rokytnji 01-27-2017 11:09 PM

Drives could be trash. A good one would show up on a Desktop in a desktop environment and just ask on right click to mount it. Is ntfs-3g installed also.

Code:

$ apt search ntfs-3g
Sorting... Done
Full Text Search... Done
disk-manager/stable 1.1.1-2 all
  simple graphical filesystem configurator

ntfs-3g/stable,stable,now 1:2014.2.15AR.2-1+deb8u2 i386 [installed]
  read/write NTFS driver for FUSE

ntfs-3g-dbg/stable,stable 1:2014.2.15AR.2-1+deb8u2 i386
  read/write NTFS driver for FUSE (debug)

ntfs-3g-dev/stable,stable 1:2014.2.15AR.2-1+deb8u2 i386
  read/write NTFS driver for FUSE (development)

ntfs-config/stable 1.0.1-11 i386
  Enable/disable write support for any NTFS devices

Code:

sudo fdisk -l
Should show them also as well as

Code:

sudo parted -l
as well as

Code:

mount
But if they are physically broken. They are just good skeet targets then.

Gparted should have shown though even if they are not mounted. Hence why I think they are trashed maybe.

syg00 01-28-2017 12:20 AM

As rknichols mentioned, what you are looking for is a /dev/sd? node appearing after the USB is recognised. That is the disk drive. Then post the commands above using that device node.
If there is no node, nothing you/we can do.

ondoho 01-28-2017 04:35 AM

Quote:

Originally Posted by anthonysaulnier (Post 5661271)
I tried testdisk and it does not see the drives

maybe this was a little hasty.
i remember using testdisk and it wasn't exactly user-friendly or straightforward.
did you get sufficiently aquainted with it?

in any case, what the previous poster wrote.

if the drive is recognized, you can at least dd it to some backup file:
Code:

sudo dd if=/dev/sdX of=backup.file.of.sdX
(replace X with drive letter)
if that was succesful, you could then remove the flaky ide drive and the usb adapter, and work on that file.

rknichols 01-28-2017 09:54 AM

Quote:

Originally Posted by anthonysaulnier (Post 5661284)
Yeah I ran the dmesg command with the drive connected and without it connected and there are differences between the outputs, in particular with the USB hardware detected, so the computer definitely seems something when the drives are connected.

Please post the messages that appear when the drive is connected.

anthonysaulnier 01-28-2017 12:54 PM

Thanks for the replies folks.

The node definitely does show up. Testdisk is now able to find the drive so I'm running it again. I even switched the adapter too.

Lets see how this goes.

The name of the last program that I used started with an S I believe but I can't remember the name of it :(

fatmac 01-28-2017 01:13 PM

Might be worth grabbing the companion program of TestDisk also. :)

PhotoRec - http://www.cgsecurity.org/wiki/PhotoRec

Doug G 01-28-2017 01:57 PM

For putting an IDE drive on usb, I've been using one of these gizmos which converts IDE to SATA and lets you plug the drive into a SATA usb dock. So far has worked fine recovering data from 5-6 old IDE drives.

https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

anthonysaulnier 01-28-2017 02:06 PM

Now I'm trying to figure out how to mount the dd file to access it.

so far I've tried:

sudo mount -t auto -o loop backup.file.of.sdd /media/sdd

sudo mount -t ntfs -o loop backup.file.of.sdd /media/sdd

but I keep getting error messages such as:
NTFS signature is missing.
Failed to mount '/dev/loop0': Invalid argument
The device '/dev/loop0' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

And

wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error

In some cases useful info is found in syslog - try
dmesg | tail or so.



dmesg | tail results
[ 1254.382906] sd 19:0:0:0: [sdd] Asking for cache data failed
[ 1254.382914] sd 19:0:0:0: [sdd] Assuming drive cache: write through
[ 1254.409373] sdd:
[ 1254.412404] sd 19:0:0:0: [sdd] Attached SCSI disk
[ 1332.768914] sdc: sdc1
[ 1332.774882] sdd:
[ 1333.161099] sdd:
[ 4985.468950] EXT4-fs (loop0): VFS: Can't find ext4 filesystem
[ 5005.429632] EXT4-fs (loop0): VFS: Can't find ext4 filesystem
[ 5019.110477] EXT4-fs (loop0): VFS: Can't find ext4 filesystem


Oh and I should clarify that this is a windows disk that I'm trying to access.


Just curious if anyone has any ideas.

rknichols 01-28-2017 03:19 PM

It looks as though you cloned the entire disk, not individual partitions. You need to mount individual partitions from that image. You can get devices created for each partition by running
Code:

kpartx -av backup.file.of.sdd
The "-v" will let you see what loop devices are created, and you can try mounting those. Run "kpartx -dv backup.file.of.sdd" to get the loop devices deleted.

Problem is, right now there do not appear to be any partitions defined. You may need to run testdisk on the image to recover the partitioning.

anthonysaulnier 01-28-2017 09:16 PM

Yeah im now getting errors saying that the partitions cannot be recovered using testdisk.

I don't give up easily though. If only I could remember the tool that I used before :(

rknichols 01-28-2017 10:21 PM

Quote:

Originally Posted by anthonysaulnier (Post 5661667)
Yeah im now getting errors saying that the partitions cannot be recovered using testdisk.

testdisk is frequently not very user-friendly, especially when running on a disk image and not a physical device. If you would try it again with a log file and then post that log file, perhaps some suggestions could be made.


All times are GMT -5. The time now is 12:49 AM.