From nobody Sat Nov 29 10:32:09 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dJRLg0SrCz6HX4v for ; Sat, 29 Nov 2025 10:32:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dJRLf5mjxz45Cp for ; Sat, 29 Nov 2025 10:32:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-34372216275so2783752a91.2 for ; Sat, 29 Nov 2025 02:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1764412340; x=1765017140; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/xAlc9K8ABZ705YgqHF7y4Y7IKkfxtsFj+nG8HdDv6o=; b=2wKLCWLMtdT5TabTSx729zAlBiD1i3w94+M3RKsGhTXD4GfqRcOjqDQsBOuaAR3sZ0 llHg6rvjWsECAFzQo8ux63CQ/mmlJxRvokzu7wLvk/9cVfxeIWQKrcMCVBw0FzC29Fma e3c9Nx8QtaTNwCQVf3aXiVPeApjZ5Yt4uLS988Yi0piG+Fs+WhGbMQ8NmZ4PjidE7Yld Aw1iIYIto1fUpuGn5xVuBV0NBTg0n/DNgjK9HtVwZ//ww81bLp8izZKUQK1RzCMOw7KN P0WgyCC5X3w9WeSMdxsePCsE2PmSDFA850+hYLsZFbUkLY58oCN+gQmseC4xe1Q1BiHq 3LdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764412340; x=1765017140; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/xAlc9K8ABZ705YgqHF7y4Y7IKkfxtsFj+nG8HdDv6o=; b=Y/q3Hr35SwrMziEYCkqOQlA2V3yFkygaLBQr8yJBgfXqjub+IeIJZKHqSyDjJoHbfi 0QGAYn5fzUfBftHpR5wyo9UV5b7ItmvsHHy1NRGXcIySpK+V9KMatBNU+p5b5tubQf9G +LFJv4PQrbynmgZUqwhwLBa5yj9D+8NLHlXldiObrk2OmV3Sd9xLCW5MTfWmNDwz/nkD EOIzbZvgzKHS+BVS8CTPDYx9RFxAovop3JyneKCF+/LGS03S+9TeH+afawTDoph8LwCA EAGiY3jqpBW+IvAm6Lc5NHXoWM5xH+zIvzLBvQhsDXHM6Uf+kS7ILCYngHEbkPR4NO28 RzMw== X-Gm-Message-State: AOJu0YyYEGyRsrBMAHPUMzEcJyqmhmvvTO/qcA0hCUx6LZU9aIWwrZ9x BMPNPx9XUWYaaZRP5IjROtKcVwzwvgYmhMGqXqrfMuV/51N+TwifulKsAH61pBXal+dc/b/cICX U034enuyK6i+b9JHoRcm2esgfPyzbl5seSUdMLwuT0Wfwf9cuNHUmrocKuA== X-Gm-Gg: ASbGnctrpJB493etZXj6dECbWhD3/XwweXMVEg2lRN1lCVbcLb9MVGIU6cv7hxJ3e4j Tw8n9qcHwwaW2wkfHey2c7W2c6/CtkyhjWvgsJ332uJSBciOXCsMxTCfzsBnagQFedFoXb8Dmat qgdbFEb4f42UTryUKQg/ZHQdAaRBdjHK2tfGYsfqrv5qzGp9GKJW4ntuWh2xtow3hv6kHWCv/N5 8g9hX0IGFC2NnUVd4BaJmBKELU1TZ/EAsyPHbNkQH1wo7y4O3y5ia6hwnSBl4yqfthMScbPUGH3 JLpSQQ== X-Google-Smtp-Source: AGHT+IHH/Zg0/o7F/VMXY4bq2+/4XZ4vwAMqyEerlxEudADzBIASPwKCYiZHP4mCVOhdXAeLA4i3q4mTiZu99ltXYUg= X-Received: by 2002:a17:90b:4f4c:b0:340:be40:fe0c with SMTP id 98e67ed59e1d1-34733f5c930mr27278108a91.36.1764412340448; Sat, 29 Nov 2025 02:32:20 -0800 (PST) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <20251123151439.361dd84c@thor.sb211.local> <20251128062140.120e8369@hermann> <20251129095452.5905b7d5@hermann> In-Reply-To: <20251129095452.5905b7d5@hermann> From: Warner Losh Date: Sat, 29 Nov 2025 03:32:09 -0700 X-Gm-Features: AWmQ_blng5YeVXMgAAMlCp0k9kO__ixzU7Ur3EK-qcvCinw67nLkto9r_1YdVcU Message-ID: Subject: Re: freezing on unmountin ext2fs USB device To: FreeBSD User Cc: FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000ca40500644b9421b" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4dJRLf5mjxz45Cp --000000000000ca40500644b9421b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 29, 2025 at 1:59=E2=80=AFAM FreeBSD User wrote: > On Thu, 27 Nov 2025 23:33:50 -0700 > Warner Losh wrote: > > > On Thu, Nov 27, 2025, 10:22=E2=80=AFPM FreeBSD User > wrote: > > > > > On Tue, 25 Nov 2025 21:03:01 -0700 > > > Warner Losh wrote: > > > > > > > On Sun, Nov 23, 2025 at 7:15=E2=80=AFAM A FreeBSD User < > freebsd@walstatt-de.de> > > > > wrote: > > > > > > > > > Hello, > > > > > > > > > > running FreeBSD 16.0-CURRENT #4 master-n282101-c8cf5a99f82b: Sun > Nov 23 > > > > > 13:56:23 CET > > > > > 2025 amd64 I'm running into a serious problem when mounting an > ext2fs > > > > > formated USB Flash > > > > > device (512GB). The devince contains files written by a Linux > system, > > > > > mounting the USB Flash > > > > > via extended4fs, the size of the written datafiles is > 128GB. > Deleting > > > > > those files larger > > > > > than some 20GB results in an I/O error reported by FReeBSD (# sud= o > rm > > > > > /mnt/USB/filename). > > > > > Unmounting the ext2fs after deletion (sudo umount /mnt) results i= n > a > > > total > > > > > freeze of the box. > > > > > No crash, no core dump, nothing. I waited almost an hour hoping f= or > > > > > recover. I have to > > > > > physically switch off the box. > > > > > > > > > > I checked with other USB flash I have at hand, one Samsung 256 GB= , > ZFS > > > - > > > > > no problem, another > > > > > 128GB, UFS, no problem and several much smaller (4 - 64GB) with > FAT or > > > UFS > > > > > filesystems, all no > > > > > problem. > > > > > > > > > > I can not figure out whether it is the USB flash drive itself, > the > > > size or > > > > > the ext2fs itself > > > > > causing the problem. > > > > > > > > > > Does anybody see similar problems or do have an tip to > investigate > > > without > > > > > risking my box' > > > > > health switching it on/off on failure? > > > > > > > > > > > > > I've not seen this on the smaller tests I've been able to run. > > > > > > > > So can you share the error messages that you get when you say you > get I/O > > > > errors? I'd like to see if this is due to an error in ext2fs or on > the > > > USB > > > > drive. It's kinda sounding a little like the particular USB is > triggering > > > > some kind of issue that at the very least we should work around. > Given > > > that > > > > it's not happening on all ext2fs drives you try to access, I'm > leaning > > > > towards the drive, but you never know. > > > > > > > > Thanks > > > > > > Plugging the USB flash gives the following hardware information on th= e > > > console: > > > > > > [...] > > > ugen1.5: at usbus1 > > > umass0 on uhub6 > > > umass0: on usbus1 > > > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 > 00 10 > > > 00 00 > > > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error > > > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition > > > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 > (Invalid > > > command > > > operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable erro= r > > > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > > > da4: Removable Direct Access SPC-4 SCSI device > > > da4: Serial Number somer serial numbers > > > da4: 400.000MB/s transfers > > > da4: 475000MB (972800000 512 byte sectors) > > > da4: quirks=3D0x2 > > > [...] > > > > > > Trying to mount via: # mount -t ext2fs /dev/da4p1 /mnt/image > > > > > > [...] > > > (da4:umass-sim0:0:0:0): got CAM status 0x444 > > > (da4:umass-sim0:0:0:0): fatal error, failed to attach to device > > > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > > > da4: s/n some serial numbers detached > > > (da4:umass-sim0:0:0:0): Periph destroyed > > > > > > mount: /dev/da4p1: Device not configured > > > > > > > This has the classic hallmarks of a drive that loses its mind on > > SYNCHRONIZE CACHE. Normally, we detect that automatically, but sometime= s > we > > don't. Let's see if this drive is suffering from that. These instructio= ns > > are a bit long, but the shorter ones are harder to explain :). > > > > First, you'll need to find what this drive is. You'll need to use > > "usbconfig -v" to find the drive. Redirect that to a file, then search, > you > > should find something akin to > > > > ugen0.13: > Technology Corp.)> at usbus0, cfg=3D0 md=3DHOST spd=3DSUPER (5.0Gbps) p= wr=3DON > > (76mA) > > ugen0.13.0: umass1: > > > > The first line might not match, and the numbers will be different. But > > you'll need the vendor and product IDs from this drive. They are a few > > lines later and look akin to the following: > > ... > > idVendor =3D 0x090c > > idProduct =3D 0x1000 > > ... > > You'll find the required output as attachment, desinated usb_asolid.txt. > > The required identifications should be > > idVendor =3D 0x24a9 > idProduct =3D 0x205a > bcdDevice =3D 0x0110 > > > > > > Now, remove the drive and type in the following (with your vendor and > > product replacing mine): > > > > usbconfig add_dev_quirk_vplh 0x090c 0x1000 0x0000 > > 0xffff UQ_MSC_NO_SYNC_CACHE > > In my case in question it would be > > usbconfig add_dev_quirk_vplh 0x24a9 0x205a 0x0000 0xffff > UQ_MSC_NO_SYNC_CACHE > > right? > > > > > This will add a quirk to the usb quirk table. You should see > NO_SYNC_CACHE > > show up in the da4 probe quirk report when you plug the drive back in. > > > > If that fixes it, please let me know. "Hang on close" or "Periph goes > away > > on close" very often is due to this. umount will close the device. I ma= y > > have additional questions for you to help me add a quirk or a heuristic > to > > the code... I'm not yet sure, though, of the correlation to big files. = It > > may be something else, or it may be this. > > Do not see required state change in output: > > [...] > ugen1.5: at usbus1 > umass0 on uhub6 > umass0: on usbus1 > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 1= 0 > 00 00 > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid > command > operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable error > I would have expected a quirk line for umass0: [911991.296485] umass1 numa-domain 0 on uhub13 [911991.299036] umass1: on usbus0 [911991.305703] umass1: SCSI over Bulk-Only; quirks =3D 0x4000 Is what I get. I don't see the SCSI over Bulk-Only line either in your demsg. I wonder why. I think your device is at 0.6, so something like the following (confirm with usbconfig showing ugen0.4 as this device): usbconfig -d ugen0.6 power_off usbconfig -d ugne0.6 add_quirk UQ_MSC_NO_SYNC_CACHE usbconfig -d ugen0.6 power_on is what I did to generate the umass line above (but with 0.13 instead of 0.6). I wish there was a quirk for REPORT LUNS not being supported, but that warning is harmless. We'll ignore the error and go on to the next thing (I should fix the errors we're just going to ignore when they aren't supported, but I digress). If you can build a kernel, adding USB_DEBUG to it for the duration of testing would give us more information, including the line that I have and that you don't (maybe I should make that unconditional). > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > da4: Removable Direct Access SPC-4 SCSI device > da4: Serial Number 25010993010046 > da4: 400.000MB/s transfers > da4: 475000MB (972800000 512 byte sectors) > da4: quirks=3D0x2 > ugen1.5: at usbus1 (disconnected) > umass0: at uhub6, port 1, addr 4 (disconnected) > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > da4: s/n 25010993010046 detached > (da4:umass-sim0:0:0:0): Periph destroyed > umass0: detached > ugen1.5: at usbus1 > umass0 on uhub6 > umass0: on usbus1 > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 1= 0 > 00 00 > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid > command > operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable error > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > da4: Removable Direct Access SPC-4 SCSI device > da4: Serial Number 25010993010046 > da4: 400.000MB/s transfers > da4: 475000MB (972800000 512 byte sectors) > da4: quirks=3D0x2Tryping to mount > > [...] > > Trying to mount /dev/da4p1 (which is the supposed ext4fs/ext2fs partition > on the USB > flash device) results in: > > WARNING: R/W mount denied. Filesystem is not clean - run fsck > > and when trying to solve the problem via > > [...] > # /compat/linux/sbin/fsck.ext4 /dev/da4p1 > e2fsck 1.46.5 (30-Dec-2021) > /compat/linux/sbin/fsck.ext4: No such file or directory while trying to > open /dev/da4p1 > Possibly non-existent device? > > and on console > the following are the only new one? > (da4:umass-sim0:0:0:0): got CAM status 0x444 > (da4:umass-sim0:0:0:0): fatal error, failed to attach to device > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > da4: s/n 25010993010046 detached > (da4:umass-sim0:0:0:0): Periph destroyed > > > I think this special "low cost" device did not only lost its mind, it los= t > its head > also. > Yes. I kinda want to swap you for this: you send it to me and I'll send you one of my happy devices :) Warner > Regards, > > Oliver > > p.s. One note: > > # gpart show -l da4 > =3D> 40 972799920 da4 GPT (464G) > 40 972799920 1 (null) (464G) > > The device in question does have a GPT partition layout. I guess it > doesn't matter here, > but I'll add it anyway for the record. > > > > > Warner > > > > [...] > > > > > > [...] > > > # /compat/linux/sbin/fsck.ext4 /dev/da4p1 > > > e2fsck 1.46.5 (30-Dec-2021) > > > SINA was not cleanly unmounted, check forced. > > > Pass 1: Checking inodes, blocks, and sizes > > > Pass 2: Checking directory structure > > > Pass 3: Checking directory connectivity > > > Pass 4: Checking reference counts > > > Pass 5: Checking group summary information > > > Error writing file system info: Invalid argument > > > > > > XXXX: ***** FILE SYSTEM WAS MODIFIED ***** > > > > > > [...] > > > > > > detaching and attaching to another USB slot on the same (external) HU= B: > > > > > > [...] > > > ugen1.5: at usbus1 > > > umass0 on uhub6 > > > umass0: on usbus1 > > > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 > 00 10 > > > 00 00 > > > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error > > > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition > > > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 > (Invalid > > > command > > > operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable erro= r > > > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > > > da4: Removable Direct Access SPC-4 SCSI device > > > da4: Serial Number some serial numbers > > > da4: 400.000MB/s transfers > > > da4: 475000MB (972800000 512 byte sectors) > > > da4: quirks=3D0x2 > > > linux: jid 0 pid 5087 (fsck.ext4): linux_ioctl_fallback fd=3D3, > cmd=3D0x127c > > > ('\^R',124) is > > > not implemented linux: jid 0 pid 5087 (fsck.ext4): linux_ioctl_fallba= ck > > > fd=3D3, cmd=3D0x125e > > > ('\^R',94) is not implemented (da4:umass-sim0:0:0:0): got CAM status > 0x444 > > > (da4:umass-sim0:0:0:0): fatal error, failed to attach to device > > > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0 > > > da4: s/n some serial numbers detached > > > (da4:umass-sim0:0:0:0): Periph destroyed > > > > > > [...] > > > > > > I can not even mount the device on CURRENT (FreeBSD 16.0-CURRENT #1 > > > master-n282217-34d66b0c96d5: Fri Nov 28 05:15:56 CET 2025 amd64). > > > > > > Package used for linux operation: emulators/linux-rl9 > > > > > --000000000000ca40500644b9421b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Nov 29,= 2025 at 1:59=E2=80=AFAM FreeBSD User <freebsd@walstatt-de.de> wrote:
On Thu, 27 Nov 2025 23:33:50 -0700
Warner Losh <imp@bsd= imp.com> wrote:

> On Thu, Nov 27, 2025, 10:22=E2=80=AFPM FreeBSD User <freebsd@walstatt-de.de>= ; wrote:
>
> > On Tue, 25 Nov 2025 21:03:01 -0700
> > Warner Losh <imp@bsdimp.com> wrote:
> >=C2=A0
> > > On Sun, Nov 23, 2025 at 7:15=E2=80=AFAM A FreeBSD User <<= a href=3D"mailto:freebsd@walstatt-de.de" target=3D"_blank">freebsd@walstatt= -de.de>
> > > wrote:
> > >=C2=A0
> > > > Hello,
> > > >
> > > > running FreeBSD 16.0-CURRENT #4 master-n282101-c8cf5a99= f82b: Sun Nov 23
> > > > 13:56:23 CET
> > > > 2025 amd64 I'm running into a serious problem when = mounting an ext2fs
> > > > formated USB Flash
> > > > device (512GB). The devince contains files written by a= Linux system,
> > > > mounting the USB Flash
> > > > via extended4fs, the size of the written datafiles is &= gt; 128GB. Deleting
> > > > those files larger
> > > > than some 20GB results in an I/O error reported by FRee= BSD (# sudo rm
> > > > /mnt/USB/filename).
> > > > Unmounting the ext2fs after deletion (sudo umount /mnt)= results in a=C2=A0
> > total=C2=A0
> > > > freeze of the box.
> > > > No crash, no core dump, nothing. I waited almost an hou= r hoping for
> > > > recover. I have to
> > > > physically switch off the box.
> > > >
> > > > I checked with other USB flash I have at hand, one Sams= ung 256 GB, ZFS=C2=A0
> > -=C2=A0
> > > > no problem, another
> > > > 128GB, UFS, no problem and several much smaller (4 - 64= GB) with FAT or=C2=A0
> > UFS=C2=A0
> > > > filesystems, all no
> > > > problem.
> > > >
> > > > I can not figure out whether it is the USB flash drive = itself, the=C2=A0
> > size or=C2=A0
> > > > the ext2fs itself
> > > > causing the problem.
> > > >
> > > > Does anybody see similar problems or do have an tip to = investigate=C2=A0
> > without=C2=A0
> > > > risking my box'
> > > > health switching it on/off on failure?
> > > >=C2=A0
> > >
> > > I've not seen this on the smaller tests I've been ab= le to run.
> > >
> > > So can you share the error messages that you get when you sa= y you get I/O
> > > errors? I'd like to see if this is due to an error in ex= t2fs or on the=C2=A0
> > USB=C2=A0
> > > drive. It's kinda sounding a little like the particular = USB is triggering
> > > some kind of issue that at the very least we should work aro= und. Given=C2=A0
> > that=C2=A0
> > > it's not happening on all ext2fs drives you try to acces= s, I'm leaning
> > > towards the drive, but you never know.
> > >
> > > Thanks=C2=A0
> >
> > Plugging the USB flash gives the following hardware information o= n the
> > console:
> >
> > [...]
> > ugen1.5: <ASolid USB> at usbus1
> > umass0 on uhub6
> > umass0: <ASolid USB, class 0/0, rev 3.20/1.10, addr 4> on u= sbus1
> > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00= 00 00 10
> > 00 00
> > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
> > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition
> > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (= Invalid
> > command
> > operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable = error
> > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
> > da4: <ASolid USB > Removable Direct Access SPC-4 SCSI devic= e
> > da4: Serial Number somer serial numbers
> > da4: 400.000MB/s transfers
> > da4: 475000MB (972800000 512 byte sectors)
> > da4: quirks=3D0x2<NO_6_BYTE>
> > [...]
> >
> > Trying to mount via:=C2=A0 # mount -t ext2fs /dev/da4p1 /mnt/imag= e
> >
> > [...]
> > (da4:umass-sim0:0:0:0): got CAM status 0x444
> > (da4:umass-sim0:0:0:0): fatal error, failed to attach to device > > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
> > da4: <ASolid USB >=C2=A0 s/n some serial numbers=C2=A0 deta= ched
> > (da4:umass-sim0:0:0:0): Periph destroyed
> >
> > mount: /dev/da4p1: Device not configured
> >=C2=A0
>
> This has the classic hallmarks of a drive that loses its mind on
> SYNCHRONIZE CACHE. Normally, we detect that automatically, but sometim= es we
> don't. Let's see if this drive is suffering from that. These i= nstructions
> are a bit long, but the shorter ones are harder to explain :).
>
> First, you'll need to find what this drive is. You'll need to = use
> "usbconfig -v" to find the drive. Redirect that to a file, t= hen search, you
> should find something akin to
>
> ugen0.13: <Flash Drive Silicon Motion, Inc. - Taiwan (formerly Feiy= a
> Technology Corp.)> at usbus0, cfg=3D0 md=3DHOST spd=3DSUPER (5.0Gbp= s) pwr=3DON
> (76mA)
> ugen0.13.0: umass1: <ASolid USB, class 0/0, rev 3.00/11.00, addr 12= >
>
> The first line might not match, and the numbers will be different. But=
> you'll need the vendor and product IDs from this drive. They are a= few
> lines later and look akin to the following:
> ...
>=C2=A0 =C2=A0idVendor =3D 0x090c
>=C2=A0 =C2=A0idProduct =3D 0x1000
> ...

You'll find the required output as attachment, desinated usb_asolid.txt= .

The required identifications should be

=C2=A0 idVendor =3D 0x24a9
=C2=A0 idProduct =3D 0x205a
=C2=A0 bcdDevice =3D 0x0110


>
> Now, remove the drive and type in the following (with your vendor and<= br> > product replacing mine):
>
> usbconfig add_dev_quirk_vplh 0x090c 0x1000 0x0000
> 0xffff UQ_MSC_NO_SYNC_CACHE

In my case in question it would be

usbconfig add_dev_quirk_vplh 0x24a9 0x205a 0x0000 0xffff UQ_MSC_NO_SYNC_CAC= HE

right?

>
> This will add a quirk to the usb quirk table. You should see NO_SYNC_C= ACHE
> show up in the da4 probe quirk report when you plug the drive back in.=
>
> If that fixes it, please let me know. "Hang on close" or &qu= ot;Periph goes away
> on close" very often is due to this. umount will close the device= . I may
> have additional questions for you to help me add a quirk or a heuristi= c to
> the code... I'm not yet sure, though, of the correlation to big fi= les. It
> may be something else, or it may be this.

Do not see required state change in output:

[...]
ugen1.5: <ASolid USB> at usbus1
umass0 on uhub6
umass0: <ASolid USB, class 0/0, rev 3.20/1.10, addr 4> on usbus1
(probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 = 00 00
(probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI status: Check Condition
(probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid co= mmand
operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable error
<= /blockquote>

I would have expected a quirk line for umas= s0:

[911991.296485] umass1 numa-domain 0 on uhub13
[= 911991.299036] umass1: <Samsung Flash Drive, class 0/0, rev 3.00/11.00, = addr 12> on usbus0
[911991.305703] umass1: =C2=A0SCSI over Bulk-Only;= quirks =3D 0x4000<NO_SYNCHRONIZE_CACHE>

Is wh= at I get. I don't see the SCSI over Bulk-Only line either in your demsg= . I wonder why.

I think your device is at 0.6, so = something like the following (confirm with usbconfig showing ugen0.4 as thi= s device):

usbconfig -d ugen0.6 power_off
usbconfig -d ugne0.6 add_quirk UQ_MSC_NO_SYNC_CACHE
usbconfig -= d ugen0.6 power_on

is what I did to generate the u= mass line above (but with 0.13 instead of 0.6). I wish there was a quirk fo= r REPORT LUNS not being supported, but that warning is harmless. We'll = ignore the error and go on to the next thing (I should fix the errors we= 9;re just going to ignore when they aren't supported, but I digress). I= f you can build a kernel, adding USB_DEBUG to it for the duration of testin= g would give us more information, including the line that I have and that y= ou don't (maybe I should make that unconditional).
=C2=A0
da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
da4: <ASolid USB > Removable Direct Access SPC-4 SCSI device
da4: Serial Number 25010993010046
da4: 400.000MB/s transfers
da4: 475000MB (972800000 512 byte sectors)
da4: quirks=3D0x2<NO_6_BYTE>
ugen1.5: <ASolid USB> at usbus1 (disconnected)
umass0: at uhub6, port 1, addr 4 (disconnected)
da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
da4: <ASolid USB >=C2=A0 s/n 25010993010046 detached
(da4:umass-sim0:0:0:0): Periph destroyed
umass0: detached
ugen1.5: <ASolid USB> at usbus1
umass0 on uhub6
umass0: <ASolid USB, class 0/0, rev 3.20/1.10, addr 5> on usbus1
(probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00 00 00 10 = 00 00
(probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI status: Check Condition
(probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid co= mmand
operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable error
da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
da4: <ASolid USB > Removable Direct Access SPC-4 SCSI device
da4: Serial Number 25010993010046
da4: 400.000MB/s transfers
da4: 475000MB (972800000 512 byte sectors)
da4: quirks=3D0x2<NO_6_BYTE>Tryping to mount

[...]

Trying to mount /dev/da4p1 (which is the supposed ext4fs/ext2fs partition o= n the USB
flash device) results in:

WARNING: R/W mount denied.=C2=A0 Filesystem is not clean - run fsck

and when trying to solve the problem via

[...]
# /compat/linux/sbin/fsck.ext4 /dev/da4p1
e2fsck 1.46.5 (30-Dec-2021)
/compat/linux/sbin/fsck.ext4: No such file or directory while trying to ope= n /dev/da4p1
Possibly non-existent device?

and on console

the following are the on= ly new one?
=C2=A0
(da4:umass-sim0:0:0:0): got CAM status 0x444
(da4:umass-sim0:0:0:0): fatal error, failed to attach to device
da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
da4: <ASolid USB >=C2=A0 s/n 25010993010046 detached
(da4:umass-sim0:0:0:0): Periph destroyed


I think this special "low cost" device did not only lost its mind= , it lost its head
also.

Yes. I kinda want to swap you for= this: you send it to me and I'll send you one of my happy devices :)

Warner
=C2=A0
Regards,

Oliver

p.s. One note:

# gpart show -l da4
=3D>=C2=A0 =C2=A0 =C2=A0 =C2=A040=C2=A0 972799920=C2=A0 da4=C2=A0 GPT=C2= =A0 (464G)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A040=C2=A0 972799920=C2=A0 =C2=A0 1=C2=A0 (= null)=C2=A0 (464G)

The device in question does have a GPT partition layout. I guess it doesn&#= 39;t matter here,
but I'll add it anyway for the record.

>
> Warner
>
> [...]
> >
> > [...]
> > # /compat/linux/sbin/fsck.ext4 /dev/da4p1
> > e2fsck 1.46.5 (30-Dec-2021)
> > SINA was not cleanly unmounted, check forced.
> > Pass 1: Checking inodes, blocks, and sizes
> > Pass 2: Checking directory structure
> > Pass 3: Checking directory connectivity
> > Pass 4: Checking reference counts
> > Pass 5: Checking group summary information
> > Error writing file system info: Invalid argument
> >
> > XXXX: ***** FILE SYSTEM WAS MODIFIED *****
> >
> > [...]
> >
> > detaching and attaching to another USB slot on the same (external= ) HUB:
> >
> > [...]
> > ugen1.5: <ASolid USB> at usbus1
> > umass0 on uhub6
> > umass0: <ASolid USB, class 0/0, rev 3.20/1.10, addr 6> on u= sbus1
> > (probe0:umass-sim0:0:0:0): REPORT LUNS. CDB: a0 00 00 00 00 00 00= 00 00 10
> > 00 00
> > (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
> > (probe0:umass-sim0:0:0:0): SCSI status: Check Condition
> > (probe0:umass-sim0:0:0:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (= Invalid
> > command
> > operation code) (probe0:umass-sim0:0:0:0): Error 22, Unretryable = error
> > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
> > da4: <ASolid USB > Removable Direct Access SPC-4 SCSI devic= e
> > da4: Serial Number some serial numbers
> > da4: 400.000MB/s transfers
> > da4: 475000MB (972800000 512 byte sectors)
> > da4: quirks=3D0x2<NO_6_BYTE>
> > linux: jid 0 pid 5087 (fsck.ext4): linux_ioctl_fallback fd=3D3, c= md=3D0x127c
> > ('\^R',124) is
> > not implemented linux: jid 0 pid 5087 (fsck.ext4): linux_ioctl_fa= llback
> > fd=3D3, cmd=3D0x125e
> > ('\^R',94) is not implemented (da4:umass-sim0:0:0:0): got= CAM status 0x444
> > (da4:umass-sim0:0:0:0): fatal error, failed to attach to device > > da4 at umass-sim0 bus 0 scbus11 target 0 lun 0
> > da4: <ASolid USB >=C2=A0 s/n some serial numbers detached > > (da4:umass-sim0:0:0:0): Periph destroyed
> >
> > [...]
> >
> > I can not even mount the device on CURRENT (FreeBSD 16.0-CURRENT = #1
> > master-n282217-34d66b0c96d5: Fri Nov 28 05:15:56 CET 2025 amd64).=
> >
> > Package used for linux operation: emulators/linux-rl9
> >=C2=A0

--000000000000ca40500644b9421b--