LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-03-2019, 04:24 PM   #1
cantremember_
LQ Newbie
 
Registered: Jan 2019
Posts: 3

Rep: Reputation: Disabled
Question External USB Hard disk bays not working in Linux


I have an issue I'm breaking my head over. I can't get external USB hard disks to work in Linux.

Hard disk with a Sata to USB3 adaptor: works fine

Same hard disk in an external HDD enclosure with eSATA connection: works fine

Same hard disk in the same external HDD enclosure with USB2 cable: doesn't work

Same hard disk in another HDD enclosure with USB3 cable: doesn't work

ALl situations work in Windows, so following the trial/error pattern it seems like Linux isn't compatible with external Hard disk enclosures over USB.


When I connect them, dmesg shows it detects the hard drive type and size, but it doesn't see any partitions and it creates /dev/sda, but it doesn't create /dev/sda1, /dev/sda2,...
Code:
"lsblk" also just shows the main drive but not the partitions on it (sdb here):
sdb            8:16   0  2.7T  0 disk
mmcblk1      179:0    0 29.1G  0 disk
├─mmcblk1p1  179:1    0  512M  0 part /boot/efi
├─mmcblk1p2  179:2    0 26.8G  0 part /
└─mmcblk1p3  179:3    0  1.8G  0 part [SWAP]
mmcblk1boot0 179:256  0    4M  1 disk
mmcblk1boot1 179:512  0    4M  1 disk
mmcblk1rpmb  179:768  0    4M  0 disk

dmesg gives the following output:

Code:
[ 1943.608507] usb 2-2: new SuperSpeed USB device number 3 using xhci_hcd
[ 1943.629660] usb 2-2: New USB device found, idVendor=152d, idProduct=1337
[ 1943.629667] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1943.629672] usb 2-2: Product: jmicron
[ 1943.629677] usb 2-2: Manufacturer: jmicron
[ 1943.629681] usb 2-2: SerialNumber: 7F833EEF5DC0
[ 1943.635475] scsi host1: uas
[ 1943.637472] scsi 1:0:0:0: Direct-Access     WDC WD30 EFRX-68EUZN0     0508 PQ: 0 ANSI: 6
[ 1943.677122] sd 1:0:0:0: Attached scsi generic sg0 type 0
[ 1949.365418] sd 1:0:0:0: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[ 1949.365426] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[ 1949.366164] sd 1:0:0:0: [sdb] Write Protect is off
[ 1949.366174] sd 1:0:0:0: [sdb] Mode Sense: 53 00 00 08
[ 1949.366529] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1949.402734] sd 1:0:0:0: [sdb] Attached SCSI disk

If i try to view it with gparted I just get an error message.
Any ideas ?
I'm sure the hard drive is good, works with eSATA, the USB3/SATA adaptor and all situations in Windows.
I'm sure the external HDD enclosures are good since they work in Windows (in Linux only with eSATA)

I have two Linux computers (one Debian 9 and one Ubuntu) and two different brand HDD enclosures and neither Linux likes neither enclosures, so it seems like a combination I don't get, but an HDD enclosure isn't exactly exotic, I can't figure out what I'm missing..
 
Old 01-04-2019, 09:17 AM   #2
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 301

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by cantremember_ View Post
Same hard disk in an external HDD enclosure with eSATA connection: works fine

Same hard disk in the same external HDD enclosure with USB2 cable: doesn't work
Strange!
I've got a Sharkoon external docking station with both e-SATA and USB-2 (my system doesn't have USB 3 yet) connectors and both work.
In fact the USB port is more reliable then the e-SATA one (which at the moment isn't detected by udev, but a reboot will fix that).
I use a lot of different disks in it, varying from 500 GB to 2 TB, with brands Western Digital, Seagate and Toshiba (the 2 TB one).
 
Old 01-04-2019, 09:53 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: CentOS at the time of this writing, but some others over the years too...
Posts: 2,319

Rep: Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041Reputation: 1041
Can you tell us what this "error message" is by any chance ?

The only common denominator I can see is the USB cables, so based on that; You've tried a different USB port I take it? Have you tested the actual cables themselves on something else if possible?

I'm suspecting it's something to do with USB anyway.
 
Old 01-04-2019, 01:26 PM   #4
cantremember_
LQ Newbie
 
Registered: Jan 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
I did some more tinkering and found some interesting stuff. I don't know what I did yesterday but today Gparted just shows the drive as being unpartitioned.

If I put smaller drives (500Gb or less) then the HDD enclosures work fine, even in Linux and on USB.

If I put a large drive, 3TB or 4TB then I get the weirdness above. This type I also tried "fdisk" command which shows something interesting.

If I connected the 4TB drive with the SATA to USB3 adapter (which works), and run fdisk, i get the following output:

Code:
Disk /dev/sdb: 3,7 TiB, 4000787030016 bytes, 976754646 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8C664CFC-B93C-4B83-9F91-7E9D2BAD3E70

Device     Start       End   Sectors  Size Type
/dev/sdb1    256 976754431 976754176  3,7T Linux filesystem

Now if I put that same drive inside the external HDD enclosure and do the same command I get:

Code:
GPT PMBR size mismatch (976754645 != 4294967294) will be corrected by w(rite).
Disk /dev/sdb: 2 TiB, 2199023255040 bytes, 4294967295 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1           1 976754645 976754645 465,8G ee GPT

The disk size is reported as being only 2TB, though the manual does mention the enclosure should support disks of up to 15TB.. Hmm. Also I'm still not yet blaming the HDD because the enclosure works if I connect it to Windows.
Strange huh
 
Old 01-04-2019, 02:58 PM   #5
cantremember_
LQ Newbie
 
Registered: Jan 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
Figured it out

Finally after some searching I figured what's going on. I don't know why I was convinced it did work in Windows because in fact it doesn't, and it isn't even really Linux related.


Some external HDD enclosures silently changed the hard disk's sector size when connected through USB.
So if a hard drive is formatted and used with its native sector size, and then put the drive in a HDD enclosure it can happen that the partitions become unreadable. (Or vic versa, an external hard drive which has its drive taken out and connected unternally you could end up not being able to read the partitions).

Aooarently this doens't happen when using the eSata cable, which is why the drisk in the enclosure worked over eSata but didn't when I used the USB cable instead (the enclosure had different connection options)

From what I can gather, there's also no real solution for it other than connect the disk back where it IS readable, backup the data, and then put the disk in the enclosure and reformat it while it is in the enclosure. (in which case it will be unreadable if you attempt to connect the drive later directly with SATA or a SATA adapter that doesn't do any strange conversions but alas).

It's a bit frustrating on the part of HDD enclosure manufacturers, but such is life.
 
Old 01-10-2019, 08:11 PM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,671

Rep: Reputation: 503Reputation: 503Reputation: 503Reputation: 503Reputation: 503Reputation: 503
Nice catch. Please mark this thread as solved.
 
Old 01-12-2019, 10:10 AM   #7
mrmazda
Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 956

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
Quote:
Originally Posted by cantremember_ View Post
Some external HDD enclosures silently changed the hard disk's sector size when connected through USB.
Emphasis on some. My 10 or 12 Rosewills have no such problem. They're all readable the same whether connected eSATA or USB2 or USB3, or if their HDs are removed and connected straight to SATA ports.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Which External Hard disk 1 TB suitable to transfer or copy file from Linux Fedora 8 OS ? The following External Hard Disk wil be suitable RAJIB BNG Linux - Hardware 2 09-23-2017 03:12 AM
External (swapable) CDROM/Floppy bays..? ryeman Linux - Laptop and Netbook 0 02-09-2004 11:02 PM
I need help with a Powerbook G3's expansion bays on Yellow Dog. The ZIP and DVD wont Teralon 9 Linux - Laptop and Netbook 1 01-20-2004 10:13 PM

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

All times are GMT -5. The time now is 05:27 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration