From nobody Sat Jan 13 07:22:42 2024 X-Original-To: freebsd-questions@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 4TBqct2k3gz56yGC for ; Sat, 13 Jan 2024 07:23:10 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from h1.out2.mxs.au (h1.out2.mxs.au [110.232.143.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TBqcq3Ybcz4Xqs for ; Sat, 13 Jan 2024 07:23:05 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nimnet.asn.au header.s=default header.b=Kr0LUaIW; dmarc=none; spf=pass (mx1.freebsd.org: domain of smithi@nimnet.asn.au designates 110.232.143.236 as permitted sender) smtp.mailfrom=smithi@nimnet.asn.au Received: from s121.syd3.hostingplatform.net.au (s121.syd3.hostingplatform.net.au [103.27.34.4]) by out2.mxs.au (Halon) with ESMTPS (TLSv1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 id 8eea27b5-b1e4-11ee-b49b-00163c1ebd60 for ; Sat, 13 Jan 2024 18:22:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nimnet.asn.au; s=default; h=Message-ID:From:CC:To:Subject: Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Nkxz59S3tngne9toCqrw1nqyBdYxfoNWAoPz6arg3Ak=; b=Kr0LUaIWtcXHhQvY12aKJEeDu+ Qofea9lWa85ql7nEvWAcB4ke7Sk0PryMUmxcYnrGn+bmlfHOi1hvZrE4tiG3HR7sIErEeQV4rLkOl EeVe81lP9UMFe/vDDk5k6zdUTC1RdriB/q10YM5VwHRFw6+PxttlpausVORNEeS64MNmtDs9UImYR cHT08lw+OSeNhO74tU5FkOcdK7lWUkzmefjDtSI3v4XLhHNuFDUYrC0+prF6dp1/9GhyI7n2JYtvN gFhWSKvEszceSNSSlAYpjktuySbgTkzw2PSG/WKAczUOQuBtR06Ve1JoDU6r8yqfzyP5SxakqG+1N uRxQivkw==; Received: from [1.145.92.168] (port=4483 helo=[10.180.130.209]) by s121.syd3.hostingplatform.net.au with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rOYLy-003O3p-0W; Sat, 13 Jan 2024 18:22:50 +1100 Date: Sat, 13 Jan 2024 18:22:42 +1100 User-Agent: K-9 Mail for Android In-Reply-To: <20240111014215.d25a19f3.freebsd@edvax.de> References: <746cd0fe-9de8-414b-8b5d-7030d423fa7f@dreamchaser.org> <85758e7a-f9bb-4568-a863-53c2439045ce@souji-thenria.net> <20240110233304.7a8b7f10.freebsd@edvax.de> <1d60d68a-3569-4054-a460-41c5dd422a42@dreamchaser.org> <20240111014215.d25a19f3.freebsd@edvax.de> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Problem mounting new Sandisk 1TB USB drive To: Polytropon ,freebsd@dreamchaser.org CC: FreeBSD Mailing List From: Ian Smith Message-ID: X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - s121.syd3.hostingplatform.net.au X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nimnet.asn.au X-Get-Message-Sender-Via: s121.syd3.hostingplatform.net.au: authenticated_id: smithi@nimnet.asn.au X-Authenticated-Sender: s121.syd3.hostingplatform.net.au: smithi@nimnet.asn.au X-Source: X-Source-Args: X-Source-Dir: X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[nimnet.asn.au:s=default]; R_SPF_ALLOW(-0.20)[+ip4:110.232.143.0/24]; MIME_GOOD(-0.10)[text/plain]; HAS_X_SOURCE(0.00)[]; RCVD_TLS_ALL(0.00)[]; HAS_X_ANTIABUSE(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_X_AS(0.00)[smithi@nimnet.asn.au]; DMARC_NA(0.00)[nimnet.asn.au]; ARC_NA(0.00)[]; HAS_X_GMSV(0.00)[smithi@nimnet.asn.au]; DKIM_TRACE(0.00)[nimnet.asn.au:+]; ASN(0.00)[asn:45638, ipnet:110.232.143.0/24, country:AU]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 4TBqcq3Ybcz4Xqs Late to the 'old and stupid' party =2E=2E=2E out of the pile, I'm respondin= g to this one since Gary gives it as reference in his PR revival at https://bugs=2Efreebsd=2Eorg/bugzilla/show_bug=2Ecgi?id=3D244461 On 11 January 2024 11:42:15 am AEDT, Polytropon wrote= : > On Wed, 10 Jan 2024 16:42:22 -0700, Gary Aitken wrote: > > On 1/10/24 15:33, Polytropon wrote: > > > On Wed, 10 Jan 2024 13:03:28 -0700, Gary Aitken wrote: (cutting mercilessly) > > > The stick is actually pre-formatted with exFAT=2E > > >=20 > > > Problem here: exFAT disguises itself as an NTFS partition, > > > but it does not have NTFS metadata and content, so ntfs-3g > > > cannot mount it, even though tools like gpart or fdisk > > > show a NTFS partition=2E It's worse than that, thanks again Microsoft! Reference: https://en=2Em= =2Ewikipedia=2Eorg/wiki/Partition_type MBR partition type 7 can be IFS, HPFS (both OS/2), NTFS or ExFAT (both MS)= =2E It's kinda understandable between HPFS and NTFS; well before FUSE there wa= s read safely / write maybe code for both that was largely identical=2E I u= sed it to read old OS/2 disks up to about FreeBSD 9=2E But overlaying NTFS with ExFAT was unforgivable really =2E=2E=2E as this t= hread adequately demonstrates=2E > > > So here is what you should check: > > >=20 > > > 1=2E /boot/loader=2Econf contains: > > >=20 > > > fuse_load=3D"YES" > > # Enable FUSE functionality for exfat filesystem mounting > > fuse_enable=3D"YES" > > fuse_load=3D"YES" >=20 > THe _enable settings belong to /etc/rc=2Econf; /boot/loader=2Econf > uses the _load settings=2E > > > 2=2E Mount device manually, read-only, perform checks, then > > > unmount again: > > >=20 > > > # mount=2Eexfat -o ro /dev/da0s1 /mnt/memstick > > > # df -f /mnt/memstick > > > # ls -R /mnt/memstick > > > # umount /mnt/memstick =20 > Should have been "df -h"=2E :-) >=20 > Intention: Compare "dmesg" entry (device reporting size) > with filesystem size, and then compare to what's written > on the device itself=2E =20 > > A series of mount=2Eexfat / umount / mount=2Eexfat on fbsd seemed to > > clear it up=2E > There are also fsck tools for most filesystems, and there > probably is one for exFAT, just in case=2E sysutils/exfat-utils : exfatfsck(8) also mkexfatfs(8), dumpexfat(8), exfatlabel(8)=2E > > > NB: mount=2Eexfat does not have a manpage or help option=2E > >=20 > > $ apropos exfat > > mount=2Eexfat-fuse(8) - mount an exFAT file system > Okay, thanks for that pointer=2E It's not obvious that you > need the manpage of "mount=2Eexfat-fuse" when you want to > know the options of "mount=2Eexfat" though=2E=2E=2E sysutils/fusefs-exfat is installed as mount=2Eexfat-fuse, with a symlink f= or /usr/local/sbin/mount=2Eexfat Unfortunately there's no such link for manpage mount=2Eexfat-fuse(8) > > > Why don't you simply run newfs on the stick, with the > > > filesystem *you* _want_ to use? You can use UFS it you > > > want to, works perfectly well=2E ;-) > >=20 > > I want to be able to read it from an android phone, and I was/am > > concerned reformatting may make it unreadable by the phone=2E I was pleasantly surprised to hear that Android reads/writes exfat=2E I in= stalled it for Ventoy, but can now directly write from the phone, ta! I als= o have some 64G USB2 sticks that become useful with exfat=2E > That's a trap to easily fall into: exFAT does not identify > itself as exFAT or FAT, but as NTFS, but it is not NTFS=2E Nor is it HPFS (in about 7 years of OS/2 in the nineties, I can't recall l= osing a single file to HPFS) ~~~~~~~ To address points Gary raises in the abovementioned PR: -> I would consider it a bug=2E Documenting ambiguous behavior does not ma= ke it any less of a problem=2E Agreed=2E -> It affects anyone who attempts to mount a usb stick with >32GB of stora= ge=2E Well, and smaller exfat media too=2E -> If gpart can tell that a partition is exFAT, it should report it as suc= h to avoid confusion It doesn't seem like a small 'if'=2E It means adding code to detect the real type in use - and there may be non= e before a makefs=2E And it's not binary; IFS and HPFS as well=2E Maybe there's some simple te= st to delineate between those four, some clear signature? I don't know; yo= u'd need to examine fsck (or analogous) code, test and present it to the gp= art maintainer=2E Good luck!