LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-27-2017, 09:44 PM   #1
anthonysaulnier
Member
 
Registered: Sep 2005
Posts: 136

Rep: Reputation: 16
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
 
Old 01-27-2017, 10:01 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
Old 01-27-2017, 10:09 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 01-27-2017, 10:47 PM   #4
anthonysaulnier
Member
 
Registered: Sep 2005
Posts: 136

Original Poster
Rep: Reputation: 16
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.
 
Old 01-27-2017, 11:09 PM   #5
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,111
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
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.
 
Old 01-28-2017, 12:20 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
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.
 
Old 01-28-2017, 04:35 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by anthonysaulnier View Post
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.
 
Old 01-28-2017, 09:54 AM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by anthonysaulnier View Post
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.
 
Old 01-28-2017, 12:54 PM   #9
anthonysaulnier
Member
 
Registered: Sep 2005
Posts: 136

Original Poster
Rep: Reputation: 16
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
 
Old 01-28-2017, 01:13 PM   #10
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,490

Rep: Reputation: Disabled
Might be worth grabbing the companion program of TestDisk also.

PhotoRec - http://www.cgsecurity.org/wiki/PhotoRec
 
Old 01-28-2017, 01:57 PM   #11
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
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
 
Old 01-28-2017, 02:06 PM   #12
anthonysaulnier
Member
 
Registered: Sep 2005
Posts: 136

Original Poster
Rep: Reputation: 16
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.
 
Old 01-28-2017, 03:19 PM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.

Last edited by rknichols; 01-28-2017 at 03:21 PM.
 
Old 01-28-2017, 09:16 PM   #14
anthonysaulnier
Member
 
Registered: Sep 2005
Posts: 136

Original Poster
Rep: Reputation: 16
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
 
Old 01-28-2017, 10:21 PM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by anthonysaulnier View Post
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.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
looking to reset ide hard drives deanoman Linux - Newbie 1 10-07-2014 02:15 AM
USB to IDE/SATA Adapters, any recommendations (something that works)? xchron Linux - Hardware 7 10-15-2013 08:10 AM
2 hard drives, XP on my main sata drives, 10.2 on my IDE LILO doesnt show on boot up Dachy Slackware 14 01-03-2008 07:01 AM
LXer: Back Up/Restore Hard Drives And Partitions With Ghost4Linux LXer Syndicated Linux News 0 01-11-2007 02:21 PM
2.6 looses ide hard drives h2gofast Linux - Software 3 09-06-2004 12:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08: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
Open Source Consulting | Domain Registration