From owner-freebsd-questions@freebsd.org Sat Nov 21 19:44:30 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D66D646F0A4 for ; Sat, 21 Nov 2020 19:44:30 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CdkQ53VJQz3LwW for ; Sat, 21 Nov 2020 19:44:29 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.30.201]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1M5Q2f-1khNkq2iYf-001RFS; Sat, 21 Nov 2020 20:44:25 +0100 Date: Sat, 21 Nov 2020 20:44:25 +0100 From: Polytropon To: Christoph Harder Cc: freebsd-questions Subject: Re: usb harddisk not working Message-Id: <20201121204425.86d9c6b1.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:OnfYITA3wDFElwVGq1g8qGrH2v+5ZT8Cr2ztCZwD2Rd3fzOlhNg mtpBaEaoWDUp8zHiU4NzyNPsePm1OV0y0sJS7ZKU21xVCWhrBnAgas2lwe1RkqpkIvmhOkS dwspTvVY9PTKvEO4RjqtpVOV9NsJEBX/D00xidOoXinKY2VKorC6afyMq/qdSolTYfBjOA3 ewhUjs4xDpFKJftQfU8+A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:ueekMlchE3k=:6P+ew53BXh7csWRCDt1Psh WTVfiJvjL0KUwNpHzC7dxoHTFtLMVsRdS5E7url0cNIpyOScNJCzBb3MbkrdCVt80a7IOJfKJ +qItLz0cdYhSUUiQK+lpEMr8E8KdLjJuBhQegNItxzy2CrAE+qXinyM1rShXZugRHLiJDIcZM kUzXNGvWN40eNzxueg/7rx25+Px3fFR94HGysCiCnI/2+NOHX9NeTRTwCqp8+VtxfQdxBT3N9 YIVilD6JgR8gVnVcFOlgoa3r57HwIr11wg18b4AHBrj2DPK3TM/x2e2Ent2uaSYP76ii+l9i3 mqOU6K58zyhVR33h0cyHfUOIEmTZW+3VUR1vv3dbKf6K4noch33SN6hmsMC2yiVH6DLKpqlht YqQxYnQ8vTUSuTEl9vbOCvufswftdocHNgSuU4S1j2brfGCWe+5h6QrT8Cqzg X-Rspamd-Queue-Id: 4CdkQ53VJQz3LwW X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.131) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [-0.60 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[arcor.de]; RECEIVED_SPAMHAUS_PBL(0.00)[94.222.30.201:received]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[212.227.126.131:from]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; SPAMHAUS_ZRD(0.00)[212.227.126.131:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.126.131:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.126.131:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2020 19:44:30 -0000 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: at usbus1, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=SAVE (0mA) > ugen1.2: at usbus1, cfg=0 md=HOST > spd=HIGH (480Mbps) pwr=SAVE (100mA) > ugen0.2: 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: at usbus4 umass1: on usbus4 da3 at umass-sim1 bus 1 scbus4 target 0 lun 0 da3: Fixed Direct Access SCSI-2 device da3: 40.000MB/s transfers da3: 1907729MB (488378646 4096 byte sectors: 255H 63S/T 30400C) % camcontrol devlist [...] at scbus4 target 0 lun 0 (pass4,da3) % usbconfig [...] ugen4.3: 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, ...