Trying to restore hard drives-IDE connected to usb adapters
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.