usb harddisk not working

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

usb harddisk not working

Christoph Harder
Hello everybody,

I'm/we're running FreeBSD 12.1-RELEASE-p10 GENERIC amd64 on an PC Engines APU.4D4 Board with a Transcend MSA230S SSD as main hard drive which is detected as ada0.
I would like to attach a hdd case that contains a Western Digital 14TB hard disk (already partitioned and formatted with a single ufs partition).
However the disk is not always detected, sometimes connecting it to another usb port (2 ports are available) works but not always.
Especially after a reboot the drive is not detected properly (I'm not 100% certain, but I believe it never was detected correctly after a reboot). When the disk is detected it is listed as da0.
The hdd case does seem to contain a JMicron usb controller, it's a icybox case with space for two 3.5" disks, but currently only contains the one WD hdd.

I've enabled automount like described in section 17.4.2. Automounting Removable Media of the handbook.
The same settings work flawlessly on other devices (same board, same os version) with external seagate hdds (though they are ready made solutions, not hdd cases that are made to be filled with drives by the user).

/etc/devd.conf
# automount
notify 100 {
        match "system"          "GEOM";
        match "subsystem"       "DEV";
        action "/usr/sbin/automount -c";
};

/etc/rc.conf
# automount
autofs_enable="YES"

dmesg
uhub0: 4 ports with 4 removable, self powered
uhub1: 2 ports with 2 removable, self powered
lo0: link state changed to UP
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1
uhub2 on uhub1
uhub2: <vendor 0x0438 product 0x7900, class 9/0, rev 2.00/0.18, addr 2> on usbus1
ugen0.2: <JMicron JMS56x Series> at usbus0
umass0 on uhub0
umass0: <MSC Bulk-Only Transfer> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x8100
umass0:2:0: Attached to scbus2
uhub2: 4 ports with 4 removable, self powered
igb0: link state changed to UP
intsmb0: <AMD FCH SMBus Controller> at device 20.0 on pci0
smbus0: <System Management Bus> on intsmb0
Security policy loaded: MAC/ntpd (mac_ntpd)
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 3 more tries remain
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 2 more tries remain
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 1 more tries remain
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 0 more tries remain
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Error 5, Retries exhausted
(probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
(probe0:umass-sim0:0:0:0): Retrying command, 3 more tries remain

camcontrol devlist
<TS64GMSA230S 02J0S86A>            at scbus0 target 0 lun 0 (ada0,pass0)

usbconfig
ugen0.1: <0x1022 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <AMD EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen0.2: <JMicron JMS56x Series> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (2mA)

/dev
shows ada0 but not da0. It also shows the following usb devices
lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen0.1@ -> usb/0.1.0
lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen0.2@ -> usb/0.2.0
lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen1.1@ -> usb/1.1.0
lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen1.2@ -> usb/1.2.0
crw-r--r--  1 root  operator  0x45 Nov 21 13:10 usbctl

I hope you can give me some hints and tips on how to get this disk working properly.

By the way, do you have any information about settings that reduce the power consumption of external disk drives?
We expect the disks to be mostly idle, but at the moment the power consumption looks pretty high (higher than the APU board itself), even when it is not currently accessed.
Especially information about usb power saving states and power consumption in combination with automount would be appreciated.

Thank you in advance.
-Christop Harder
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Ralf Mardorf-5
On Sat, 21 Nov 2020 13:35:46 +0100, Christoph Harder wrote:
>By the way, do you have any information about settings that reduce the
>power consumption of external disk drives? We expect the disks to be
>mostly idle, but at the moment the power consumption looks pretty high
>(higher than the APU board itself), even when it is not currently
>accessed. Especially information about usb power saving states and
>power consumption in combination with automount would be appreciated.

Hi,

this is a can of worms. Don't open this can! If you have good luck
regarding the controller of the USB casing, it at least does avoid
one issue, it never goes into standby mode, so you don't need to
experience IO errors, unless something is defekt. You might not be able
to enable stand by mode for the drive itself through the USB controller
(not the same as an USB controller's stand by mode or stand by of your
computer's USB ports via the operating system), but you can remove the
drive and connect it directly to a computer to do so and after that
assemble it back to the USB casing. However, the best thing you could
do is to connect the drive when needed and to disconnect it when it's
not needed. Stay a way from fishy USB controllers and don't use energy
saving tools for USB ports, this is asking for trouble. If at all, use
the drive's stand by feature, but as already pointed out before, you
might not be able to enable or disable it through the USB controller.

My guess is, that the USB controller of your external casing comes
already with kind of fish firmware.

I'm very picky when buying an external USB casing, since I experienced
way to often IO errors with most cases I purchased.

Since your case isn't working, return it and get your money back! Most
cases' controllers' firmware is crap!

My 2 Cents based on experiences made the hardest way
Ralf
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Polytropon
In reply to this post by Christoph Harder
On Sat, 21 Nov 2020 13:35:46 +0100, Christoph Harder wrote:

> I'm/we're running FreeBSD 12.1-RELEASE-p10 GENERIC amd64
> on an PC Engines APU.4D4 Board with a Transcend MSA230S SSD
> as main hard drive which is detected as ada0.
> I would like to attach a hdd case that contains a Western
> Digital 14TB hard disk (already partitioned and formatted
> with a single ufs partition).
> However the disk is not always detected, sometimes connecting
> it to another usb port (2 ports are available) works but not
> always.
> Especially after a reboot the drive is not detected properly
> (I'm not 100% certain, but I believe it never was detected
> correctly after a reboot). When the disk is detected it is
> listed as da0.
> The hdd case does seem to contain a JMicron usb controller,
> it's a icybox case with space for two 3.5" disks, but currently
> only contains the one WD hdd.
>
> I've enabled automount like described in section 17.4.2.
> Automounting Removable Media of the handbook.
> The same settings work flawlessly on other devices (same board,
> same os version) with external seagate hdds (though they are
> ready made solutions, not hdd cases that are made to be filled
> with drives by the user).

From the configuration you could show, it looks to be setup
correctly. But there is something that is a little bit
suspicious, combined with your initial description of "works
sometimes, but not always".

It is the following part:



> usbconfig
> ugen0.1: <0x1022 XHCI root HUB> at usbus0, cfg=0 md=HOST
> spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
> ugen1.1: <AMD EHCI root HUB> at usbus1, cfg=0 md=HOST
> spd=HIGH (480Mbps) pwr=SAVE (0mA)
> ugen1.2: <vendor 0x0438 product 0x7900> at usbus1, cfg=0 md=HOST
> spd=HIGH (480Mbps) pwr=SAVE (100mA)
> ugen0.2: <JMicron JMS56x Series> at usbus0, cfg=0 md=HOST
> spd=SUPER (5.0Gbps) pwr=ON (2mA)
>
> /dev
> shows ada0 but not da0. It also shows the following usb devices
> lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen0.1@ -> usb/0.1.0
> lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen0.2@ -> usb/0.2.0
> lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen1.1@ -> usb/1.1.0
> lrwxr-xr-x  1 root  wheel        9 Nov 21 13:10 ugen1.2@ -> usb/1.2.0
> crw-r--r--  1 root  operator  0x45 Nov 21 13:10 usbctl

The "chain of command" in USB mass storage basically is this:
ugen -> umass -> pass -> da. If you don't have a da device
associated, nothing can be mounted, nothing will happen.

By the way, I use a similar approach here:

% dmesg
[...]
ugen4.3: <JMicron> at usbus4
umass1: <MSC Bulk-Only Transfer> on usbus4
da3 at umass-sim1 bus 1 scbus4 target 0 lun 0
da3: <WDC WD20 EFAX-68FB5N0 > Fixed Direct Access SCSI-2 device
da3: 40.000MB/s transfers
da3: 1907729MB (488378646 4096 byte sectors: 255H 63S/T 30400C)

% camcontrol devlist
[...]
<WDC WD20 EFAX-68FB5N0 >           at scbus4 target 0 lun 0 (pass4,da3)

% usbconfig
[...]
ugen4.3: <USB to ATAATAPI bridge JMicron> at usbus4,
        cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON

The corresponding "chain of command" devices appear in /dev
as expected. Sometimes it requires a few seconds after
powering on the device.



> I hope you can give me some hints and tips on how to get
> this disk working properly.

There's another thing I'd like to mention just to be sure:
In case there is a UFS filesystem on the disk, automount
won't be possible if the filesystem is not clean. So in case
it did not get dismounted properly, the "chain of command"
(as mentioned above) will be intact, but you'll only receive
en entry in your system log file that the filesystem is not
clean. So when in doubt, manually run fsck on the device.

But leaving this problem aside, it looks like there is
something wrong in your combination of hardware that stops
the "chain of command" to be established properly. This could
be a wiring thing, but in my experience with cheap USB disk
enclosings, it's probably a version of the firmware (the
part that does "USB plug <---> SATA disk") that is not
working properly and according to the standard. This can
also explain the "works here, but not there" and "works
sometimes, but not always".



> By the way, do you have any information about settings that
> reduce the power consumption of external disk drives?

You're entering a dangerous forest, stranger. ;-)

No, seriously: This is a quite complicated topic, and very
much dependent on brand, model, firmware version, kind of
connection, and so on. Obtaining some of the information
can be achieved using smartctl, others require the tools
of the manufacturer, and may or may not work depending on
the kind of connection to the device.





--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Ralf Mardorf-5
On Sat, 21 Nov 2020 20:44:25 +0100, Polytropon wrote:
>This could be a wiring thing, but in my experience with cheap USB disk
>enclosings, it's probably a version of the firmware (the part that
>does "USB plug <---> SATA disk") that is not working properly and
>according to the standard. This can also explain the "works here, but
>not there" and "works sometimes, but not always".

Hahaha,

IIRC we already agreed off-list regarding USB enclosures and the
firmware a while ago.

I can not remember that we discussed wiring issues.

IMO it's super-very-most-unlikely a wiring issue. I can't imagine a
reasonable wiring issue.

What the OP describes is the common (I like your wording) "works here,
but not there" and "works sometimes, but not always" firmware issue.

In the beginning I disassembled the drives and connected them to my PC
to test, if the drives are broken. Nowadays I don't even test the
drives, I directly return such USB enclosures. I even don't waste time
to test another USB port ;), let alone another computer.

Regards,
Ralf
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Ralf Mardorf-5
In reply to this post by Polytropon
On Sat, 21 Nov 2020 20:44:25 +0100, Polytropon wrote:
>So when in doubt, manually run fsck on the device.

I "only" need to run fsck for an external drive's hfs+ partition used
to share data between an iPad and a Linux PC. Without running fsck I
get IO errors as if the drive is broken. I never made this experience
with other file systems or when using hfs+ with just one operating
system.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Ralf Mardorf-5
On Sat, 21 Nov 2020 21:42:16 +0100, Ralf Mardorf wrote:
>On Sat, 21 Nov 2020 20:44:25 +0100, Polytropon wrote:
>>So when in doubt, manually run fsck on the device.  
>
>I "only" need to run fsck for an external drive's hfs+ partition used
>to share data between an iPad and a Linux PC. Without running fsck I
>get IO errors as if the drive is broken. I never made this experience
>with other file systems or when using hfs+ with just one operating
>system.

Oops,

I didn't finish the mail. What I want to point out is, that if the ufs
partition is used with FreeBSD and no other operating system, but
unclean, then probably something similar to a power loss happened,
probably something caused by the USB controller's firmware.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Polytropon
In reply to this post by Ralf Mardorf-5
On Sat, 21 Nov 2020 21:26:13 +0100, Ralf Mardorf wrote:

> On Sat, 21 Nov 2020 20:44:25 +0100, Polytropon wrote:
> >This could be a wiring thing, but in my experience with cheap USB disk
> >enclosings, it's probably a version of the firmware (the part that
> >does "USB plug <---> SATA disk") that is not working properly and
> >according to the standard. This can also explain the "works here, but
> >not there" and "works sometimes, but not always".
>
> Hahaha,
>
> IIRC we already agreed off-list regarding USB enclosures and the
> firmware a while ago.
>
> I can not remember that we discussed wiring issues.
>
> IMO it's super-very-most-unlikely a wiring issue. I can't imagine a
> reasonable wiring issue.

I wanteed to mention this because I experienced that once:
It was a USB enclosure with the came it came with - worked
sometimes, on some systems, but was hard to predict _where_
it would work _when_. Turned out, after removing the
original USB cable and using a different one, the disk
worked everywhere every time. :-)

I called this "wiring issue" because the only thing involved
is the wires in the USB cable. There _might_ be wiring
problems within the enclosure (PCB to disk), but that doesn't
seem to happen that often. Still a possibility.



> In the beginning I disassembled the drives and connected them to my PC
> to test, if the drives are broken. Nowadays I don't even test the
> drives, I directly return such USB enclosures. I even don't waste time
> to test another USB port ;), let alone another computer.

In the past, I also solved "broken disk" issues by removing
them from the enclosure and attaching them to my trusted
JMicron universal adapter (for SATA, PATA, mini-PATA), using
the original power supply. So far, that worked on _every_
computer's _every_ USB port. :-)



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Christoph Harder
Hello,

thank you for the fast feedback.

Regarding power saving I suspected as much and won't persue it further.

I'll try to change the usb cable, maybe I'm "lucky" and it works.

Best regards,
Christoph



Am 21.11.2020 um 22:13 schrieb Polytropon:

> On Sat, 21 Nov 2020 21:26:13 +0100, Ralf Mardorf wrote:
>> On Sat, 21 Nov 2020 20:44:25 +0100, Polytropon wrote:
>>> This could be a wiring thing, but in my experience with cheap USB disk
>>> enclosings, it's probably a version of the firmware (the part that
>>> does "USB plug <---> SATA disk") that is not working properly and
>>> according to the standard. This can also explain the "works here, but
>>> not there" and "works sometimes, but not always".
>>
>> Hahaha,
>>
>> IIRC we already agreed off-list regarding USB enclosures and the
>> firmware a while ago.
>>
>> I can not remember that we discussed wiring issues.
>>
>> IMO it's super-very-most-unlikely a wiring issue. I can't imagine a
>> reasonable wiring issue.
>
> I wanteed to mention this because I experienced that once:
> It was a USB enclosure with the came it came with - worked
> sometimes, on some systems, but was hard to predict _where_
> it would work _when_. Turned out, after removing the
> original USB cable and using a different one, the disk
> worked everywhere every time. :-)
>
> I called this "wiring issue" because the only thing involved
> is the wires in the USB cable. There _might_ be wiring
> problems within the enclosure (PCB to disk), but that doesn't
> seem to happen that often. Still a possibility.
>
>
>
>> In the beginning I disassembled the drives and connected them to my PC
>> to test, if the drives are broken. Nowadays I don't even test the
>> drives, I directly return such USB enclosures. I even don't waste time
>> to test another USB port ;), let alone another computer.
>
> In the past, I also solved "broken disk" issues by removing
> them from the enclosure and attaching them to my trusted
> JMicron universal adapter (for SATA, PATA, mini-PATA), using
> the original power supply. So far, that worked on _every_
> computer's _every_ USB port. :-)
>
>
>

signature.asc (321 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

Polytropon
In reply to this post by Ralf Mardorf-5
On Sat, 21 Nov 2020 21:54:20 +0100, Ralf Mardorf wrote:

> On Sat, 21 Nov 2020 21:42:16 +0100, Ralf Mardorf wrote:
> >On Sat, 21 Nov 2020 20:44:25 +0100, Polytropon wrote:
> >>So when in doubt, manually run fsck on the device.  
> >
> >I "only" need to run fsck for an external drive's hfs+ partition used
> >to share data between an iPad and a Linux PC. Without running fsck I
> >get IO errors as if the drive is broken. I never made this experience
> >with other file systems or when using hfs+ with just one operating
> >system.
>
> Oops,
>
> I didn't finish the mail. What I want to point out is, that if the ufs
> partition is used with FreeBSD and no other operating system, but
> unclean, then probably something similar to a power loss happened,
> probably something caused by the USB controller's firmware.

Exactly according to my own experience:

I once had a USB disk enclosure with disk that would randomly
disconnect, which is not good for a mounted UFS filesystem and
caused said unclean dismounting, resulting in the inability for
a new automatic re-mount. The disk itself was not the reason,
it worked fine after extraction, and installation in a different
enclosure.

Other than firmware issues, device power (voltage drop due to
insufficient current supply) could be a problem. This _might_
involve faulty cables, but is not limited to that; it could
be cheap USB ports (one power controller for all, so overall
drawn current is added from all connected devices) on the
system board.

The use of fsck sould only be needed if there was an accidental
unclean dismount, preventing automatic re-mount. The system log
will contain the relevant information.



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: usb harddisk not working

tech-lists
In reply to this post by Christoph Harder
Hi,

I've found that it can take a little time for the usb/usb3
subsytem to finish its hw probing after boot. This causes
problems if there's attached usb3/zfs storage you want
automatically started on boot. The following lines in
/boot/loader.conf helped me:

kern.cam.boot_delay="20000" # 20s delay for usb3 to wake up
vfs.root_mount_always_wait=1 # give usb time to settle before zfs

--
J.

signature.asc (849 bytes) Download Attachment