From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4677AC433B4 for ; Tue, 11 May 2021 23:33:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06647616EA for ; Tue, 11 May 2021 23:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbhEKXes (ORCPT ); Tue, 11 May 2021 19:34:48 -0400 Received: from sandeen.net ([63.231.237.45]:49568 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbhEKXes (ORCPT ); Tue, 11 May 2021 19:34:48 -0400 Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 95ABB615D71; Tue, 11 May 2021 18:33:22 -0500 (CDT) To: Namjae Jeon Cc: linux-fsdevel , Namjae Jeon , Pavel Reichl , chritophe.vu-brugier@seagate.com, Hyeoncheol Lee References: <372ffd94-d1a2-04d6-ac38-a9b61484693d@sandeen.net> From: Eric Sandeen Subject: Re: problem with exfat on 4k logical sector devices Message-ID: <276da0be-a44b-841e-6984-ecf3dc5da6f0@sandeen.net> Date: Tue, 11 May 2021 18:33:39 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 5/11/21 4:21 PM, Namjae Jeon wrote: >> Hi Namjae - > Hi Eric, >> >> It seems that exfat is unhappy on 4k logical sector size devices: > Thanks for your report! > We have got same report from Christophe Vu-Brugier. And he sent us > the patch(https://github.com/exfatprogs/exfatprogs/pull/164) to fix it > yesterday.(Thanks Christophe!), I will check it today Oh, good timing! ;) gI'll try to look at that in more depth. It does seem to make everything work for me, and resolves a couple other misunderstandings I may have had, and they seem to match with the spec. For example, I now see that boot sector signature does go at the end of 512 for the primary boot sector, and at the end of $SECTOR_SIZE for the extended boot sector. One other thing that I ran across is that fsck seems to validate an image against the sector size of the device hosting the image rather than the sector size found in the boot sector, which seems like another issue that will come up: # fsck/fsck.exfat /dev/sdb exfatprogs version : 1.1.1 /dev/sdb: clean. directories 1, files 0 # dd if=/dev/sdb of=test.img 524288+0 records in 524288+0 records out 268435456 bytes (268 MB) copied, 1.27619 s, 210 MB/s # fsck.exfat test.img exfatprogs version : 1.1.1 checksum of boot region is not correct. 0, but expected 0x3ee721 boot region is corrupted. try to restore the region from backup. Fix (y/N)? n Right now the utilities seem to assume that the device they're pointed at is always a block device, and image files are problematic. Also, as an aside, it might be useful to have a "set sector size" commandline option at least for testing, or to create 4k images that could be transferred to a 4k device. Thanks, -Eric