From nobody Sun Oct 20 18:57:13 2024 X-Original-To: freebsd-fs@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 4XWnk408Nhz5ZfqZ for ; Sun, 20 Oct 2024 18:57:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XWnk36dpSz4Xxb; Sun, 20 Oct 2024 18:57:15 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729450635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=JxDITke+UZ50WO/5W2Cocii2qkqlk0BABtb+smoK3Bo=; b=Wz59ZYafsKfEMZbfRoUSVclfT3FU4tGJDItDzEoqCPQQpbPxRi5eY0tfehN25ki7/y62Cc W0qRRVVL10fJqYZZsqGkIlWp6nTnMPd2VD0VpBSl/FCVuGYXldRtYeixtjqJY3nhDcQZ65 tVDnwhR/wSByoORwaXtdy3krrNr5AEvP2R7306SSLYwEAorX2n12XvFQyFASGpO0LiCkOk lzTDUGH/c2udAG7TdBP4b7XxuuT9Ty4t8NEMYphNYhZD5WMANp+NYaeI2RuLT4qw4AyJox wSZa8fTK29E5xd4zZzSBQ2qEpauO6jY8UZuSzyRdBWKB77cO88oGYLvJ9KG/9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729450635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=JxDITke+UZ50WO/5W2Cocii2qkqlk0BABtb+smoK3Bo=; b=TXRlHzadsVATYGU/aYdUbXe9GyBLvXX8VPI98li9qMQjdrSOrtKO1R2AXz49PCD1/EBqDx MlL2Q+ST1tJzUiaE4Wv4XHiB+KNgpkcXkH2N++K/X3ZmHHigLEgKggphAT8C4CFylkoIyT j8hJ82RsOTBPM9sFMG4a6KRXEUV6qzeMdUQNU1uYcWsy7wivhowSTjUT7UA7VbUQQlmP0k 83cfKiKZt5y0z+SDZlBGdX5A6EgF6qcftADeSd3UX8gUlx1pkHwLdPbhb1fv66jUcBdddQ xQ2Z7NVjbBkFj0Y4GDbHNd5XOQAsgMSryZwGTf3L3vcwWYMuGkgqephrptDwFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729450635; a=rsa-sha256; cv=none; b=Pno2VWudQUu8GtUWGCK6ORK3nmDgcnAXcvP7KX6YFy+D1P1XvW3XkwWfnDjMaL0oxBNkK6 sWirZBnyiEfguRSRDU6PEcm7i75N1FLc39i/1OJu2eCZ3/4oAlLtioua55g+sz6POo+YP+ /fvoVdwwqnO+lxBx5wWiEupWG7IU4PfCTMK1q6QfWWnFEtfNx3Bhj/h45T7mWVqP3q+KOT EoHDQN5Rk4l5TFU0VM5QyFnHJ1ivEgVAZ88pPGmZpqqAAZ5kLz6biV4zjat4vJqKB2sWDU ndbx2XO67NPR8oKkArA8kwSaxyA4zboBf9P55VZgGr5u3LvQMqFLgsRJvwJ6vw== Received: from [192.168.119.155] (p50806256.dip0.t-ipconnect.de [80.128.98.86]) (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 did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XWnk337DqzM6T; Sun, 20 Oct 2024 18:57:15 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: <4382b73c-41f7-4689-a1ee-945d0a9c6e12@FreeBSD.org> Date: Sun, 20 Oct 2024 20:57:13 +0200 List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Stefan Esser Subject: Re: FAT32 support on freebsd To: freebsd-fs@freebsd.org References: Content-Language: de-DE, en-US Autocrypt: addr=se@FreeBSD.org; keydata= xsBNBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAHNJ1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPsLAlAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJmvl9B BQkTLNNOAAoJEEfrte9a/fVEV1oH/jt+SjRqTHci6d1LiFDfbY0E2rfobZw5BhcQuCqxahS7 pcE1oLpUaoqWYPHslxhGTl7QSD2twMWcHLonZ1lgTJluMZqgTX9uvqEYDUtiH6G+IF7Qacat eUsAvwdycItPOr3p7WBt8U54GbnQdxpSUQ0OpD4twy7KAt/MPNLofVQSEea5DNQOH2dXILrf iRsNfFPsfTASOUXOTRyTYwm6Ys76LIdL9GA2iR5qw8G43FB02fiX76WQSjg+yKN9iP9racGg Pc8qkSPwHJr0s3OwJC4ndbCuSiaXddDbgOvdrqfSO0XCjo3ylyEBhmMVMpwkj8pLCKVGS73n Ncs6OujZXAzOwE0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAcLAhgQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJmvl9BBQkT LNNOABQJEEfrte9a/fVECRBH67XvWv31RCrvCACY7fjahcGj/57peFu0oIb4X9X78H6mgrAZ D5HCCCb2vWdNtSDTYQoYnKP2Fz9RUG8ETT9a6CtymYqQc72/dzjJmakRTlbYhliKJDZXGAYU g34VirGXCjYgWH7l+0CupOtt55R/ASnrnXX9R/7PLO+akObn9Cz/bNBnIbYnTjLNs7GMMQL4 uNSyqIByQ3LVsVDaCq3408fYKC0dtlv2VNQQzcXXwOgecwpS2UeqMflrSA7UfPh15WgkpnrN AnKCtS66eU1w2kTCsVEjGQEgLI5pP1HMNRHjnHncAFSpOfs1EZn0MfhiyB+4T+lrccGI8EZu ay791Tx4QdDKkdZGaV9A In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 20.10.24 um 20:07 schrieb Andreas Hecht: > My FAT32 formatted portable SSD "Western Digital My Passport 25F3" does not > seem to be supported by FreeBSD. Mounting the drive works fine but I can not > access the data stored within it: > > # mount -t msdosfs /dev/da0s1 /mnt > # cd /mnt > # ls -al > total 0 > > The 'ls -al' above should show a folder named 'data' stored in the > top level diretory of the drive. The folder does not show up but during > execution of 'ls -al' the following kernel message appears: > > getblkx: maxsize(66560) > maxbcachebuf(65536) > > I found that this particular drive uses 128 sectors per cluster. This > multiplied with 512 bytes per sector results in 65536 bytes per sector > which per FAT specification seems to be too much: > (https://www.cs.fsu.edu/~cop4610t/assignments/project3/spec/fatspec.pdf) > "Note however, that a value should never be used that results in a “bytes per > cluster” value (BPB_BytsPerSec * BPB_SecPerClus) greater than 32K (32 * 1024). > There is a misconception that values greater than this are OK." > > What makes me wonder is that the same drive works fine with Debian 12 and > NetBSD 10. Is FreeBSD supposed to support this drive? Shall I send a problem > report? Without knowing the exact details of your FAT32 partition, I do assume that the clusters are not aligned to a 4 KB boundary. The MSDOSFS in FreeBSD maps sectors of the FAT32 partition to pages in such a way that the first sector of a cluster may be in the middle of a VM page. That leads to cluster of 128 * 512 Bytes to require 17 instead of 16 pages in the buffer cache. The newfs_msdos command in FreeBSD has been modified to adjust the first sector in each data cluster to a multiple of the page size, which avoids this issue. You can mount your FAT32 file system if you add the following to your loader configuration file /boot/loader.conf: vfs.maxbcachebuf=131072 In fact, setting this value to 69632 (17 * 4096) should suffice ... I plan to remove this limit from FAT32, but setting vfs.maxbcachebuf should allow you to work with that drive. Beste Grüße, STefan