Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problem accessing laptop sata drive with usb adaptor
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Wed Apr 18, 2018 7:10 pm    Post subject: problem accessing laptop sata drive with usb adaptor Reply with quote

This is not really a Gentoo problem, but I am relying on the wisdom of this group to at least point me in the right direction.

I have a dying 2.5" laptop hard drive, 360GB. If I plug it into my Gentoo desktop with the sata to usb adaptor (external power) only the adaptor itself shows up under lsusb, but both dmesg and lshw show the drive and partitions. However, I don't have any large enough disk in this PC to hold the image I want to recover with ddrescue. If I plug the drive into my laptop (running Artix Linux,)where I do have enough space, I have almost the same situation, except that lshw does NOT see the drive or partitions, even though "fdisk -l" does. I have tried all three USB ports on the laptop, and have unplugged the USB mouse. No joy.

While I look for either a larger empty hard drive to hold the recovery image on my PC, or else borrow another laptop with enough space - I'm looking for any hints at what I might do to get the laptop to actually recognize the drive through the adaptor.

My PC: kernel 4.15.11
Laptop: kernel 4.14.34

Thanks for any suggestions.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Wed Apr 18, 2018 7:16 pm    Post subject: Reply with quote

I suspect your USB-sata adapter doesn't have a power supply. If it does not have a power supply, try a powered hub, perhaps?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Wed Apr 18, 2018 7:47 pm    Post subject: Reply with quote

That adapter came with a separate power supply, and the drive is powered by that - to a 4 pin IDE connector and then an adapter to a SATA power plug (15 pin?), although you are correct the adapter itself is not externally powered. I'll see if I can dig up a powered USB hub, but I don't think I have one. (I have ordered a SATA-USB adapter specifically for 2.5" drives, which has 2 USB connectors and no external power, but that will not arrive for a few more days.)

Are you suggesting that the desktop is providing more power to its USB ports than the laptop is, and that difference is enough to cause what I'm seeing?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Wed Apr 18, 2018 8:27 pm    Post subject: Reply with quote

genterminl,

Laptop HDD have been 5v only for a long time.

I suspect that the external power for your SATA to USB adaptor is 12v, so it can be used with 3 1/2 inch drives.
These use 12v for the motors.

Your adaptor may or may not provide 5v for the drive electronics from the 12v PSU.
Its not hard or expensive but every penny is a prisoner.

Code:
lsusb -vvv
will give you a hint.
Look for the
Code:
MaxPower
entry for the device.
Self powered devices typically show 2mA

A single USB1 or USB2 root hub is specified to provide up to 500mA for all connected devices.
For USB 3 its 900mA.

When you go over the limit lots of things happen from
1. Everything still works
2. The root hub selectively powers off some devices.
3. The root hub shuts down until the overload is addressed.

In your case, I suspect 1. is happennig. Spinning up the drive is a slow operation compared to USB over current detection.
Until the drive spins up, it will not become ready. Until its ready, the kernel will not interact with it.
That it appears in /dev shows its ready.
That you can read a partition table confirms that.

genterminl wrote:
Artix Linux,)where I do have enough space, I have almost the same situation, except that lshw does NOT see the drive or partitions, even though "fdisk -l" does.

That's a contradiction. The drive must be present in /dev or fdisk could not see it either.

A couple of things. Are you sure that an your Artix system, fdisk is showing you the drive you think it is?
Does the drive have an MSDOS or GPT partition table?
If its GPT and Artix does not support GPT, strange things will happen.
Note that fdisk can read and write both with no support from the kernel.

If you don't know, try
Code:
fdisk -t dos -l /dev/...
and -t gpt.
If GPT is in use, the first command will tell you all about it.

For generating a disk image, you don't actually care as ddrescue reads raw blocks, not filesystems.
As long as you have a /dev node, you point ddrescue at the entire drive.

You will need to use losetup to pick partitions out of the image file, once you have it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Wed Apr 18, 2018 8:48 pm    Post subject: Reply with quote

NeddySeagoon - thanks for the additional information.

lsusb -vvv isn't helping, because the SATA to USB adaptor shows Self Powered, and the drive itself is NOT showing up under lsusb.

Note: on the laptop, fdisk does see the drive, and the /dev/ nodes are present, but lshw does NOT show the drive. That may be a contradiction, but it's what is happening. That's why I'm confused.

The drive is definitely MSDOS partitioned - it's been in use in that laptop for over five years (which is why I'm not terribly surprised it is failing.) I know it's the right drive because /dev/sda (the laptop internal drive) currrently has only one ext4 partition, and the failing drive has several NTFS partisions, and those are the only two drives present.

Context - I had been trying to use ddrescue-gui. That is failing, because it uses lshw to see what is present. It therefore looks like I'll end up using ddrescue directly.

Thanks for all the responses. I'd still love to know why lshw doesn't see the drive, but I'm not going to spend much more time on it, as I'll start working with ddrescue command line.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Wed Apr 18, 2018 9:57 pm    Post subject: Reply with quote

Hmm. wasn't sure how the drive was powered. Most 2.5" disks cannot be powered from USB only - they are close, 500mA, but not enough. Some computers are built well enough to power 2.5" disks through USB. Just a possibility that there was enough power to enable the USB adapter but not enough to spin up the drive.

Oh another thing, are you sure lshw isn't displaying the disk? Might be showing up in a different portion of the tree depending on the layout of your machine. Being able to fdisk -l and having it show the proper size means that Linux should be able to work with the disk.

One thing that I've done to deal with doing large dumps on machines without enough storage is dump large images through NFS or some other network filesystem to another machine that has enough disk space. You may need to do something like this.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Wed Apr 18, 2018 10:00 pm    Post subject: Reply with quote

genterminl,


Quote:
lsusb -vvv isn't helping, because the SATA to USB adaptor shows Self Powered, and the drive itself is NOT showing up under lsusb.

Thats expected. The SATA to USB adaptor is expected to advertise any power it might need for a HDD.
The drive will not show up in lsusb.

Heres some sample ddrescue commands I've used.
Code:
# Mapfile. Created by GNU ddrescue version 1.22
# Command line: ddrescue -A -r 256 /dev/sdk /mnt/floppy/maxstore /mnt/floppy/maxstore.log

 Mapfile. Created by GNU ddrescue version 1.22
# Command line: ddrescue -A -r 256 -R -d -b 4096 /dev/mapper/vm-media--server /mnt/floppy/vm-media--server /mnt/floppy/vm-media--server.log


I didn't know that there was a ddrescue-gui.

Beware SATA to USB adaptors with ddrescue. In general, they don't support the full low level command set.
You are likely to get better resulats if you can connect the drive to a SATA port.

You can put the ddrescue output onto a network drive if that helps, e.g. over nfs.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum