From owner-freebsd-questions@FreeBSD.ORG Tue Jul 8 04:39:16 2014 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80219521 for ; Tue, 8 Jul 2014 04:39:16 +0000 (UTC) Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com [IPv6:2607:f8b0:400e:c02::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 559D828A1 for ; Tue, 8 Jul 2014 04:39:16 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id z10so6541086pdj.1 for ; Mon, 07 Jul 2014 21:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mcUBN/OSbZ7MfEoBFh+3/UB7UJr0VxQHIaPmUyCg7vs=; b=tXpwLqNTHOFkZEFyipO0I9BWA4/84bZtrgnDqPMSjW7Q0qRDtBxTYhEA6cgptCUgIv iZXCTF39r3i+Ytz+aIPy9cKzdQjMPkQlaKMqsRQ/y9YJAa0ZmFRmsiTUNtYXz4gD2fRW I3tN/mpOUQ4+tCRaqpPcCEBD9T4CGCk+l/23KB3Y9EvrMEPLGNQ7OjOiXFOKWds0kj3y ODMqAJZ1tNgDYOXnBuQGacixRTmaGVyDMNDMI0gukCAG0aIkC2XB5LNaBHzXzfY+dzV6 Y/cDT8fMXQBy75sACTZtsitQyL0dcmZIO6KTzOP+ymU/hEmt2xY53ig6qmUQCgZaZXcH nGBw== MIME-Version: 1.0 X-Received: by 10.66.254.4 with SMTP id ae4mr8041949pad.99.1404794355748; Mon, 07 Jul 2014 21:39:15 -0700 (PDT) Sender: kob6558@gmail.com Received: by 10.66.88.227 with HTTP; Mon, 7 Jul 2014 21:39:15 -0700 (PDT) In-Reply-To: <1403792937.2308.16.camel@marcopolo.fritz.box> References: <1403792937.2308.16.camel@marcopolo.fritz.box> Date: Mon, 7 Jul 2014 21:39:15 -0700 X-Google-Sender-Auth: kSFvlMo5UuxbAmOhYO1v1_Czm-c Message-ID: Subject: Re: Cannot create files on exfat card / 10-stable From: Kevin Oberman To: Mathias Picker Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 04:39:16 -0000 On Thu, Jun 26, 2014 at 7:28 AM, Mathias Picker < Mathias.Picker@virtual-earth.de> wrote: > Am Mittwoch, den 25.06.2014, 13:48 -0700 schrieb Kevin Oberman: > > > Hi all, > > > > > > I just got my first exfat formatted sdxc card. > > > > > > If I mount it with (as root) mount.exfat /dev/da2s1 /mnt I can read the > > > content, create *directories*, but *not files*??? > > > > > > > > > root@marcopolo:/mnt # touch test1 > > > touch: test1: Invalid argument > > > root@marcopolo:/mnt # mkdir test1 > > > root@marcopolo:/mnt # touch test1/test > > > touch: test1/test: Invalid argument > > > root@marcopolo:/mnt # ll -d test1 > > > drwxr-xr-x 1 root wheel 131072 16 Feb 19:46 test1/ > > > root@marcopolo:/mnt # ll test1 > > > total 0 > > > > > > > > > > > > Shouldn't this work? > > > > > > I rebuilt fusefs-lib and fusefs-exfat with gcc48, same result... > > > > > > This is on a recent stable: > > > marcopolo% uname -a > > > FreeBSD marcopolo 10.0-STABLE FreeBSD 10.0-STABLE #14 r261827: Thu Feb > > > 13 13:13:01 CET 2014 mathiasp@marcopolo > :/usr/obj/usr/src/sys/GENERIC > > > amd64 > > > > > > The card is a Sandisk Extreme MicroSDXC 64Gb. Works fine in my phone. > > > > > > Any tips, hints, experiences? > > > > > > Thanks, Mathias > > > > I have no answer as I found this message in the archive while > > researching the root cause of the problem. > > > > Thanks, first feedback, now I finally know it's not just me... > > > > Workaround: After writing to the device on FreeBSD, put the card into > > a Windows system. (It will also be usable to write to the device.) > > Open an explorer (not Internet Explorer) window > > Right click on the ExFAT device > > Select "Properties" > > In the Properties window, select the "Tools" tab > > > > In the tools window click "Check now" > > > > In the disk check window click start > > > > No errors should be found, but the disk will now be writable on > > Windows. Note that the directories you appeared to be creating on > > FreeBSD will be gone. > > > > Eject the media and mount it on the FreeBSD system I t will be > > writable until it is re-mounted. > > :) Interesting approach, I switched to FAT for now, works well enough > for me... > > > > > > I believe the problem is that unmounting the file system fails to mark > > the fs as clean. You might notice that a message that the device was > > not cleanly dismounted is printed to the console and messages when the > > device is re-mounted on FreeBSD. There is no fsck for ExFAT, so I need > > to use Windows to do the same job. > > > > > > It looks like all that is needed is to clear the second bit of byte > > 106 of the VBR (block 0). I will try this some day when I am feeling > > brave. > > > > > > I'd love to see this fixed > > Me too! But way over my head. > > Again, thanks for the feedback! > > Mathias > > > I have learned a bit more by monitoring the dirty bit with dumpexfat (part of sysutils/exfat-utils) The second bit of Volume State is set for "dirty". If the system is shutdown, the dirty bit is not cleared. If I manually umount the filesystem, the bit is cleared and subsequent mount can be written to. I also noted that, even after the dirty mount of the filesystem, a manual unmount and mount restores the system to its normal condition. It appears that the device is not being correctly unmounted at shutdown. n any case, it is pretty quick to restore normal operations should you need to deal with and exfat filesystem. -- R. Kevin Oberman, Network Engineer, Retired E-mail: rkoberman@gmail.com