Code Monkey home page Code Monkey logo

exfat's People

Contributors

dsd avatar edwardbetts avatar kusumi avatar leeminghao avatar m4rkusxxl avatar nhunsperger avatar noctis-akm avatar pablomh avatar phhusson avatar relan avatar samm-git avatar vasi avatar wjt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exfat's Issues

Question, possible bug with flushing the filesystem

Currently I'm using the exfat fuse driver on a Raspberry Pi derivative device. We have got a local SATA hard drive which contains an exfat filesystem.

If I run the exfatfsck on the /dev/sda1 whilst it is mounted and I'm writing to the disk some random autogenerated files, I assume what I'm seeing is the errors due to some information not yet written back to the disk which is of course fair enough.

But I then unmount the disk (ready to power it off) and run the exfatfsck again but still get the same errors. If I try sync'ing it doesn't make any difference....

Only thing that will make the errors go away is to reboot the system completely...

Is this what you'd expect? I thought once unmounted all outstanding writes should have been made and therefore there should be nothing left to write to the disk... Is it possible that there is some further caching that is giving me false positives?

Gordon

timezone / daylight saving not taken into account on exfat V1.2.3

exfat V 1.2.3

Camera, Win7 and Linux are in same timezone (Central European + Daylight savings), thus UTC+2:00

Exfat formatted SD card is used.

Pictures taken by camera and files saved from Win7 show on the Windows computer the correct modified time for the file and the picture. File time stamp of the pictures agree with EXIF time data.

Same files show 1 hour difference on the Linux machine:

e.g.
-rwx------ 1 georg georg 33 2016-06-14 15:19:12.000000000 +0200 File created at local time 1419 on Win7.txt

identify -verbose DSC00937.JPG

...
Properties:
date:create: 2016-06-13T22:54:06+02:00 <== wrong
date:modify: 2016-06-13T22:54:06+02:00 <== wrong
exif:BrightnessValue: -1706/2560
exif:ColorSpace: 1
exif:ComponentsConfiguration: 1, 2, 3, 0
exif:CompressedBitsPerPixel: 1/1
exif:Compression: 6
exif:Contrast: 0
exif:CustomRendered: 0
exif:DateTime: 2016:06:13 21:54:07
exif:DateTimeDigitized: 2016:06:13 21:54:07 <== correct
exif:DateTimeOriginal: 2016:06:13 21:54:07 <== correct

Expected behaviour:

Linux shall display modified file timestamp without this one hour gap.

I also tried to mount with the option tz=UCT and time_offset=60. No change in behavior.

The same test were repeated for a FAT formatted SD card.

In this case two hour difference (probably somewhat correct reflecting +2:00 between UTC and local time). Mounting the fat with tz=UTC ==> no change, Mounting with time_offset=120 alleviates the difference.

Exfat is the more advanced file system. The current implementation either does not correct for timezone or for daylight saving. It should respect both.

Thank you for having a look into it.

Please at least add an option to update checksums anyway in exfatfsck

Hello, would it be technically possible to implement an option to update the vbr checksum anyway in exfatfsck (it’s not about correcting errors, but just letting exfatfuse and other tools from other projects go while knowing risks)

ERROR: invalid VBR checksum 0x459076eb (expected 0xd7d66df4).

If I understand things correctly, the vbr checksum‘s value is part of the data being checksummed, isn’t it ?

Support fast space allocation?

I have recently bought an IODD-2541 USB disk enclosure which should allow me to expose files as virtual disk devices. It supports FAT32/exFAT and NTFS, but since NTFS sounds overkill and less supported for Linux I decided to use the exFAT.

Due to the design, files must be contiguously allocated. When I used truncate -s 20G disk.vhd, it took a while before all bytes were written to the SSD. This could probably be explained by the requirement to initialize extended part with zeroes (\0).

Proposal: a method to request allocation some sectors without writing zeroes to new blocks.

I am fully aware of the security issues from exposing possibly deleted data, but am willing to risk that for creating "empty" disk images. The undelying SSD does not have confidential data and the test images are just like that, test images.

Possible mechanism 1:
The Linux-specific fallocate(2) function combined with the FALLOC_FL_NO_HIDE_STALE mode could probably be used here. Originally proposed in April 2012 (see https://lwn.net/Articles/492959/, https://lwn.net/Articles/492920/). Apparently still in use via out-of-tree patches in production according to the ext4 maintainer, writing in September 2015:

However, this patch is in
active use in practically every single data center kernel for Google,
and it's in use in at least one other very large publically traded
company that uses cluster file systems such as Hadoopfs. And if
someone wants a copy of the FALLOC_FL_NO_HIDE_STALE patch for ext4,
I'm happy to give it to them.

Unfortunately the FUSE layer rejects such flags, so more work would be needed:

static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
                loff_t length)
{
    ...
    if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
        return -EOPNOTSUPP;

Possible mechanism 2:
Introduce an ioctl that could preallocate some blocks. (Restricting it to those who have CAP_SYS_RAWIO.)

Possible mechanism 3:
Introduce a separate utility that can allocate such file on an offline (unmounted) image.

Hopefully I have shown enough research and made the intent clear. Until then I have to waste some SSD write cycles and wait somewhat longer.

Directory renaming when only the case differs

As explained in your reply to the directory renaming issue here:
https://groups.google.com/forum/#!topic/exfat/rEbVXYhttQw
I don't understand why you have not highlighted this issue in the README file shipped with the package or just mentioned this in a BUGS file that could have been distributed along with the source code or binary package. I have just lost a 219 GB folder just because of, well...

Thanks for contributing to the open source movement, Andrew.

umount failed when format without partition

I'm using exfat 1.2.3 on soc board with microSD card.
Format card with command "mkfs.exfat /dev/mmcblk0", and the mount point is "/sdcard",
"umount /sdcard" will block. I try to trace the reason, it's blocked in system call "umount", and trace into kernel space, it's blocked in "fs/fuse/dev.c" wait_event_interruptible function.
But format with "mkfs.exfat /dev/mmcblk0p1", then "umount /sdcard" is ok.
So, is this a bug, which can't handle mmcblk0 umount?

please help!!

Hi sir... I want to resize .img file on kali linux, I have downloaded and successfully mounted an exFat system on my laptop, but i resize2fs is not working, nothing happen and i cannot stop that

resize2fs 1.42.12 (29-Aug-2014)

I got this and it don't stop :(

How do I uninstall the program

Hello, this is not a issue, but a question. How do I uninstall the program? In the README file explains how to install the program, but in my case I need to uninstall it, and I don't know how to do that.

preserving permissions: Function not implemented

I hope this is the right place for posting this.

I am using iPython which writes data on a portable USB drive which is exFat formatted (under CentOS 7). iPython uses shutil.copy2() which in turn should work similar to cp -r preserving file metadata. The problem is that calling this function (or cp -r) raises an exception. Is there any way of configuring the exfat driver to silently ignore the fact that it doesn't handle metadata?

I've tried to reproduce the problem with the latest master version. If you try cp -r file1 file2 on the exFat drive, you should be able to get this error message:

cp: preserving permissions for ‘file2’: Function not implemented

Android Dual Boot Patcher: exFAT driver issue?

Dual Boot Patcher (Android) is using exFAT driver 1.2.6 and I have some issues with using Samsung EVO 64GB external sdcard.
Might be possible, that the write issues are related to exFAT driver problems?
I have no issue, if I format the card with FAT32 format.
Did format to exFAT filesystem under Windows 7.

Including the kmsg.log relevant part here, if you see any signs related to the exFAT driver:

[   12.334167] mblog: 1 fstab entries for the external SD
[   12.334350] mblog: [Attempt 1/10] Finding and mounting external SD
[   12.334472] mblog: Matching devices against pattern: /devices/platform/msm_sdcc.2/mmc_host/mmc2*
[   12.338012] mblog: /default.prop contains fuse-exfat override: true
[   12.428955] mblog: Using fuse-exfat: 1
[   12.462677] mblog: Running executable: /sbin/fsck.exfat
[   12.464721] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   12.464904] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   12.465087] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   12.465179] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   12.465332] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   12.465484] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   12.465576] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   12.465698] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   12.465850] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   12.466003] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   13.065521] [SSP] Updated 88487 bytes / 107440 bytes
[   13.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   13.758789] max77693-muic max77693-muic: func:max77693_muic_usb_detect info->muic_data->sw_path:0
[   14.104248] [SSP] Updated 103374 bytes / 107440 bytes
[   14.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   14.863281] [SSP] Firmware download is success.(107440 bytes)
[   15.078796] [SSP]: debug_work_func(0) - Sensor state: 0x0, RC: 0, MS: 0
[   15.078887] [SSP] : debug_work_func firmware downloading state = 3
[   15.148773] msm_thermal: Max frequency reset for cpu0
[   15.149139] msm_thermal: Max frequency reset for cpu1
[   15.149536] msm_thermal: Max frequency reset for cpu2
[   15.149902] msm_thermal: Max frequency reset for cpu3
[   15.158782] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   16.158843] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   17.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   17.868804] [SSP] forced_to_download_binary, DL state = 4
[   17.871063] [SSP] MCU device ID = 85, reading ID = 85
[   17.871276] [SSP] Sensor Posision A : 3, G : 3, M: 5, P: 0
[   17.871948] ssp_enable, enable = 1, old enable = 1
[   17.872833] [SSP]: Proximity Threshold - 0, 0
[   17.873291] [SSP]: set_hw_offset: x: 0, y: 0, z: 0
[   17.873443] ssp_sensorhub_report_notice: reset
[   17.873504] [SSP] forced_to_download_binary, DL state = 5
[   17.874084] [SSP] MCU Firm Rev : New = 14111200
[   18.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   19.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   20.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   21.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   22.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   23.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   24.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   25.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   25.758819] max77693-muic max77693-muic: func:max77693_muic_dock_usb_detect info->muic_data->sw_path:0
[   26.078826] [SSP]: debug_work_func(0) - Sensor state: 0x3fff, RC: 0, MS: 0
[   26.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   27.158782] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   27.905670] [SSP]: MSG From MCU - Init
[   27.905670] Gyro Temp Init
[   27.905670] CheckLightLux Init
[   27.905670] AD 6 1 0 1
[   28.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   28.798797] max77693-muic max77693-muic: func:max77693_muic_mhl_detect cable_type:0
[   29.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   30.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   31.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   32.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   33.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   34.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   35.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   36.158782] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   37.078796] [SSP]: debug_work_func(1) - Sensor state: 0x3fff, RC: 0, MS: 0
[   37.158782] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   38.158782] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   39.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   39.881530] mblog: Command output: exfatfsck 1.2.6
[   39.881622] mblog: Command output: Checking file system on /dev/block/mmcblk1.
[   39.881774] mblog: Command output: File system version           1.0
[   39.881896] mblog: Command output: Sector size                 512 bytes
[   39.881988] mblog: Command output: Cluster size                128 KB
[   39.882110] mblog: Command output: Volume size                  60 GB
[   39.882202] mblog: Command output: Used space                   36 GB
[   39.882324] mblog: Command output: Available space              24 GB
[   39.882415] mblog: Command output: Totally 1589 directories and 16564 files.
[   39.882568] mblog: Command output: File system checking finished. No errors found.
[   39.883026] mblog: Running executable: /sbin/mount.exfat
[   39.884948] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   39.885101] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   39.885253] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   39.885345] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   39.885498] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   39.885620] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   39.885711] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   39.885864] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   39.885986] mblog: Command output: __bionic_open_tzdata_path: ANDROID_DATA not set!
[   39.886077] mblog: Command output: __bionic_open_tzdata_path: ANDROID_ROOT not set!
[   39.962768] mblog: mount.exfat returned: 0
[   39.962860] mblog: Successfully mounted /dev/block/mmcblk1 (fuse-exfat) at /raw/extsd
[   39.963073] mblog: Successfully mounted partitions
[   39.963378] mblog: Successfully mounted fstab (excluding /data)
[   39.963653] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/boot      /boot          emmc    defaults                                                                                      recoveryonly
[   39.963897] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/recovery  /recovery      emmc    defaults                                                                                      recoveryonly
[   39.964050] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/apnhlos   /firmware      vfat    ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0  wait
[   39.964263] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/mdm       /firmware-mdm  vfat    ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0  wait
[   39.964447] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/efs       /efs           ext4    nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic                        wait,check,notrim
[   39.964660] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/userdata  /data          f2fs    nosuid,nodev,noatime,rw,inline_xattr                                                          wait,check,formattable,encryptable=footer
[   39.964874] mblog: -> /data entry
[   39.964965] mblog: fstab: /dev/block/platform/msm_sdcc.1/by-name/userdata  /data          ext4    nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic                        wait,check,formattable,encryptable=footer
[   39.965179] mblog: -> /data entry
[   39.965240] mblog: fstab: /devices/platform/msm_sdcc.2/mmc_host/mmc2*      auto           auto    defaults                                                                                      voldmanaged=sdcard1:auto,encryptable=userdata
[   39.965484] mblog: fstab: /devices/platform/msm_hsusb_host/usb*            auto           auto    defaults                                                                                      voldmanaged=usb:auto
[   39.965698] mblog: /raw/data: Has 2 fstab entries
[   39.965820] mblog: Attempting to mount(/dev/block/platform/msm_sdcc.1/by-name/userdata, /raw/data, f2fs, 1030, inline_xattr)
[   39.965942] mblog: /dev/block/platform/msm_sdcc.1/by-name/userdata: Waiting up to 20 seconds for block device
[   39.972137] F2FS-fs (mmcblk0p29): Magic Mismatch, valid(0xf2f52010) - read(0x94890)
[   39.972259] F2FS-fs (mmcblk0p29): Can't find valid F2FS filesystem in 1th superblock
[   39.972717] F2FS-fs (mmcblk0p29): Magic Mismatch, valid(0xf2f52010) - read(0x100000)
[   39.972778] F2FS-fs (mmcblk0p29): Can't find valid F2FS filesystem in 2th superblock
[   39.972930] F2FS-fs (mmcblk0p29): Magic Mismatch, valid(0xf2f52010) - read(0x94890)
[   39.973052] F2FS-fs (mmcblk0p29): Can't find valid F2FS filesystem in 1th superblock
[   39.973114] F2FS-fs (mmcblk0p29): Magic Mismatch, valid(0xf2f52010) - read(0x100000)
[   39.973266] F2FS-fs (mmcblk0p29): Can't find valid F2FS filesystem in 2th superblock
[   39.973571] mblog: Failed to mount /dev/block/platform/msm_sdcc.1/by-name/userdata (f2fs) at /raw/data: Invalid argument
[   39.973693] mblog: Attempting to mount(/dev/block/platform/msm_sdcc.1/by-name/userdata, /raw/data, ext4, 1030, noauto_da_alloc,journal_async_commit,errors=panic)
[   39.973846] mblog: /dev/block/platform/msm_sdcc.1/by-name/userdata: Waiting up to 20 seconds for block device
[   39.987640] EXT4-fs (mmcblk0p29): 4 orphan inodes deleted
[   39.987731] EXT4-fs (mmcblk0p29): recovery complete
[   39.994873] EXT4-fs (mmcblk0p29): mounted filesystem with ordered data mode. Opts: noauto_da_alloc,journal_async_commit,errors=panic
[   39.995025] mblog: Successfully mounted /dev/block/platform/msm_sdcc.1/by-name/userdata (ext4) at /raw/data
[   39.995178] mblog: Successfully mounted partitions
[   39.998687] mblog: Boot UI is missing. Skipping...
[   40.012573] mblog: Policy version: 30
[   40.043334] SELinux:  Android master kernel running Android M policy in compatibility mode.
[   40.158782] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   40.231262] mblog: Assigning /raw/extsd/multiboot/extsd-slot-rr574/system.img to loop device /dev/block/loop1
[   40.272338] EXT4-fs (loop1): mounted filesystem with ordered data mode. Opts: 
[   40.512237] mblog: Assigning /raw/extsd/multiboot/extsd-slot-rr574/system.img to loop device /dev/block/loop2
[   40.513977] EXT4-fs (loop2): recovery complete
[   40.514068] EXT4-fs (loop2): mounted filesystem with ordered data mode. Opts: 
[   40.560974] mblog: /system/bin/fsck_msdos: SELinux label is: u:object_r:fsck_exec:s0
[   40.561157] mblog: Failed to bind mount /wrapped/fsck_msdos to /system/bin/fsck_msdos: Invalid argument
[   40.563171] mblog: /system/bin/fsck_msdos_mtk: Failed to stat: No such file or directory
[   40.565216] mblog: /system/bin/fsck.exfat: SELinux label is: u:object_r:fsck_exec:s0
[   40.565429] mblog: Failed to bind mount /wrapped/fsck.exfat to /system/bin/fsck.exfat: Invalid argument
[   40.566711] mblog: /system/bin/mount.exfat: SELinux label is: u:object_r:system_file:s0
[   40.566894] mblog: Failed to bind mount /wrapped/mount.exfat to /system/bin/mount.exfat: Invalid argument
[   40.567077] mblog: /wrapped: Failed to remount read-only: Invalid argument
[   40.567291] mblog: JSON error on line -1: unable to open /raw/data/media/0/MultiBoot/extsd-slot-rr574/config.json: No such file or directory
[   40.567443] mblog: /raw/data/media/0/MultiBoot/extsd-slot-rr574/config.json: Failed to load config for ROM extsd-slot-rr574
[   40.567565] mblog: Enable appsync: 0
[   40.583160] mblog: /data/security/spota: Mounted read-only tmpfs over spota directory
[   40.597381] mblog: Policy version: 30
[   40.634063] mblog: Received notification to stop uevent thread
[   40.634368] mblog: Received notification to stop property service
[   40.711242] mblog: Launching real init ...
[   40.713409] init: init started!
[   40.859283] init: (Initializing SELinux enforcing took 0.15s.)
[   40.874023] init: init second stage started!
[   40.874511] init: property_set("ro.boot.warranty_bit", "1") failed
[   41.024291] init: (Loading properties from /default.prop took 0.00s.)
[   41.025939] init: (Parsing /init.multiboot.rc took 0.00s.)
[   41.026092] init: (Parsing /init.environ.rc took 0.00s.)
[   41.026489] init: (Parsing /init.usb.rc took 0.00s.)
[   41.027435] init: (Parsing init.qcom.power.rc took 0.00s.)
[   41.028533] init: (Parsing init.qcom.usb.rc took 0.00s.)
[   41.028656] init: (Parsing /init.qcom.rc took 0.00s.)
[   41.029174] init: (Parsing /init.usb.configfs.rc took 0.00s.)
[   41.029327] init: (Parsing /init.zygote32.rc took 0.00s.)
[   41.029541] init: (Parsing /init.trace.rc took 0.00s.)
[   41.030029] init: (Parsing /init.superuser.rc took 0.00s.)
[   41.030181] init: (Parsing /init.cm.rc took 0.00s.)
[   41.030273] init: (Parsing /init.rc took 0.01s.)
[   41.030487] init: SELinux: Could not get canonical path /adb_keys restorecon: No such file or directory.
[   41.030792] init: Starting service 'ueventd'...
[   41.031555] init: Waiting for /dev/.coldboot_done...
[   41.033111] ueventd: ueventd started!
[   41.158813] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   41.542388] power_supply sec-fuelgauge: driver failed to report `status' property: 4294967274
[   41.545745] max77693_get_charger_state: CHG_DTLS : 0x 8
[   41.546325] max77693_get_health_state: reg_data(0x3)
[   41.546966] max77693_get_vbus_state: VBUS is invalid. CHGIN < CHGIN_UVLO
[   41.548034] max77693_get_health_state: vbus_state : 0x0, chg_dtls : 0x8
[   41.548156] max77693_get_health_state: vbus is under
[   41.549835] max77693_get_input_current: CHG_CNFG_09(0x17)
[   41.549987] power_supply sec-charger: driver failed to report `power_now' property: 4294967274
[   41.575622] ueventd: Coldboot took 0.53s.
[   41.577148] init: Waiting for /dev/.coldboot_done took 0.55s.
[   41.660522] keychord: using input dev pmic8xxx_pwrkey for fevent
[   41.660614] keychord: using input dev max77693-muic for fevent
[   41.660736] keychord: using input dev gpio-keys for fevent
[   41.666534] init: write_file: Unable to open '/proc/sys/kernel/hung_task_timeout_secs': No such file or directory
[   41.666778] init: write_file: Unable to open '/proc/sys/kernel/sched_tunable_scaling': No such file or directory
[   41.666931] init: write_file: Unable to open '/proc/sys/kernel/sched_latency_ns': No such file or directory
[   41.667114] init: write_file: Unable to open '/proc/sys/kernel/sched_wakeup_granularity_ns': No such file or directory
[   41.667266] init: write_file: Unable to open '/proc/sys/kernel/sched_compat_yield': No such file or directory
[   41.668914] init: write_file: Unable to write to '/dev/cpuctl/cpu.shares': Invalid argument
[   41.671630] init: write_file: Unable to open '/proc/sys/abi/swp': No such file or directory
[   41.687652] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/apnhlos,target=/firmware,type=vfat)=0
[   41.695129] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/mdm,target=/firmware-mdm,type=vfat)=0
[   41.696228] loop: Write error at byte offset 0, length 4096.
[   41.696319] Buffer I/O error on device loop1, logical block 0
[   41.696441] lost page write due to I/O error on loop1
[   41.696533] EXT4-fs error (device loop1): ext4_find_entry:941: inode #486: comm init: reading directory lblock 0
[   41.696685] Aborting journal on device loop1-8.
[   41.696807] loop: Write error at byte offset 1075802112, length 4096.
[   41.696899] Buffer I/O error on device loop1, logical block 262647
[   41.697021] lost page write due to I/O error on loop1
[   41.697113] JBD2: Error -5 detected when updating journal superblock for loop1-8.
[   41.697235] EXT4-fs (loop1): Remounting filesystem read-only
[   41.699707] sec-fuelgauge 11-0036: 0x02(0xb4), 0x03(0x20), 0x04(0x3f), 0x05(0x77), 0x06(0x00), 0x07(0x00), 0x08(0x00), 0x09(0x12), 0x0a(0x00), 0x0b(0x00), 0x0c(0x6c), 0x0d(0x1e), 
[   41.703247] sec-fuelgauge 11-0036: 0x14(0x00), 0x15(0xff), 0x16(0xfe), 0x17(0xda), 0x18(0x7d), 0x19(0x00), 0x1a(0x01), 0x1b(0xff), 
[   41.703399] sec-fuelgauge 11-0036: sec_fg_get_atomic_capacity: old : 31, current : 31
[   41.703979] max77693_get_input_current: CHG_CNFG_09(0x17)
[   41.706115] EXT4-fs (mmcblk0p10): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[   41.706329] fs_mgr: check_fs(): mount(/dev/block/platform/msm_sdcc.1/by-name/efs,/efs,ext4)=0: Success
[   41.713043] sec-battery sec-battery: sec_bat_get_battery_info:Vnow(3602mV),Inow(460mA),SOC(31%),Tbat(358)
[   41.713195] sec-battery sec-battery: sec_bat_monitor_work: Status(Discharging), mode(None), Health(Good), Cable(1), siop_level(100)
[   41.713958] max77693-muic max77693-muic: func:max77693_muic_monitor_status, ST1:0x3f, ST2:0x0 CABLE:0
[   41.768859] fs_mgr: check_fs(): unmount(/efs) succeeded
[   41.769012] fs_mgr: Running /system/bin/e2fsck on /dev/block/platform/msm_sdcc.1/by-name/efs
[   41.770507] e2fsck: executing /system/bin/e2fsck failed: I/O error
[   41.770538] 
[   41.770690] e2fsck: e2fsck terminated by exit(255)
[   41.770690] 
[   41.775634] EXT4-fs (mmcblk0p10): mounted filesystem with ordered data mode. Opts: noauto_da_alloc,journal_async_commit,errors=panic
[   41.775817] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/efs,target=/efs,type=ext4)=0
[   41.776458] init: Untracked pid 204 killed by signal 6
[   41.778106] init: Starting service 'logd'...
[   41.780456] init: cannot execve('/system/bin/logd'): I/O error
[   41.780883] init: Service 'logd' (pid 221) exited with status 127
[   41.781036] init: Service 'logd' (pid 221) killing any children in process group
[   41.783905] init: property_set("ro.product.name", "jfltexx") failed
[   41.794708] init: (Loading properties from /system/build.prop took 0.01s.)
[   41.795166] EXT4-fs (loop1): previous I/O error to superblock detected
[   41.795257] loop: Write error at byte offset 0, length 4096.
[   41.795410] Buffer I/O error on device loop1, logical block 0
[   41.795471] lost page write due to I/O error on loop1
[   41.795623] EXT4-fs error (device loop1): ext4_find_entry:941: inode #1957: comm init: reading directory lblock 0
[   41.795745] init: (Loading properties from /vendor/build.prop took 0.00s.)
[   41.795898] init: (Loading properties from /factory/factory.prop took 0.00s.)
[   41.797546] init: Starting service 'logd'...
[   41.798309] init: Starting service 'vold'...
[   41.799652] init: cannot execve('/system/bin/logd'): I/O error
[   41.799957] init: Not bootcharting.
[   41.800048] init: cannot execve('/system/bin/vold'): I/O error
[   41.800811] init: Service 'logd' (pid 222) exited with status 127
[   41.800903] init: Service 'logd' (pid 222) killing any children in process group
[   41.801300] init: Service 'vold' (pid 223) exited with status 127
[   41.801452] init: Service 'vold' (pid 223) killing any children in process group
[   42.158996] synaptics_rmi4_i2c 3-0020: synaptics_init_power_on: until lcd does not turn on.
[   42.555084] init: SELinux: Could not set context for /data/security/spota:  Read-only file system
[   42.563323] init: SELinux: Could not get canonical path /data/user/0 restorecon: No such file or directory.
[   42.563751] init: Starting service 'exec 0 (/system/bin/tzdatacheck)'...
[   42.564605] init: cannot execve('/system/bin/tzdatacheck'): I/O error
[   42.564971] init: Service 'exec 0 (/system/bin/tzdatacheck)' (pid 224) exited with status 127
[   42.590393] SELinux:  Context u:object_r:cpk_efs_file:s0 is not valid (left unmapped).
[   42.595306] EXT4-fs (loop1): previous I/O error to superblock detected
[   42.595489] loop: Write error at byte offset 0, length 4096.
[   42.595550] Buffer I/O error on device loop1, logical block 0
[   42.595703] lost page write due to I/O error on loop1
[   42.595794] EXT4-fs error (device loop1): ext4_find_entry:941: inode #486: comm init: reading directory lblock 0
[   42.600250] init: Starting service 'sysinit'...
[   42.600952] init: (Loading properties from /data/local.prop took 0.00s.)
[   42.601074] init: cannot execve('/system/bin/sysinit'): I/O error
[   42.601287] init: Starting service 'logd'...
[   42.602020] init: Service 'sysinit' (pid 225) exited with status 127
[   42.602508] init: Starting service 'logd-reinit'...
[   42.603240] init: cannot execve('/system/bin/logd'): I/O error
[   42.603820] init: Service 'logd-reinit' (pid 228) exited with status 127
[   42.604553] init: cannot execve('/system/bin/logd'): I/O error
[   42.605010] init: Service 'logd' (pid 227) exited with status 127
[   42.605102] init: Service 'logd' (pid 227) killing any children in process group

Attaching full last_kmsg.txt file for full reference.
last_kmsg.txt

Changes to exFAT partition do not persist

I have a microSD card exFAT formatted, I can mount it and write on it: delete files, copy files on it, I can see the change applied, the LED on the card reader blinks when writing, but if I unmount and remount the card, all my changes are gone! The SD card has the same content as before.

This is on Linux 4.2.0 from Ubuntu 15.10. I tried with the package exfat-fuse 1.1.0-2 included with Ubuntu 15.10, and also tried 1.2.2 from sources.

I have posted my issue on Ask Ubuntu, thinking it would be a known issue, with no satisfying answer. Another user had the same issue and suggested it could be a corrupted card, but it works fine on Android and Windows, and nothing in the kernel logs suggest it can be the case, so I am not really convinced.

More informative error message for fuse_loop(3) failure

FUSE's man pages describe fuse_loop(3) as follows:

fuse_loop() is the main loop of a FUSE program. This function looks for FUSE requests from the kernel and responds to them using the struct fuse_operation present in the structure fuse. It will return only if something goes wrong or if the kernel sends a FUSE_DESTROY opcode to libfuse.

It seems that a failure of this function suggests a general failure of the FUSE filesystem. However, fuse-exfat currently reports "FUSE loop failure" to stderr. It seems like it would be better to use a more general error message that users not familiar with FUSE internals can understand. Maybe something as simple as "FUSE filesystem crashed".

Thanks for your time,
Michael

Wrong filename hash when upcase table is compressed

The upcase table can be compressed. When this is the case
the upcase conversion will not work and file hashes will not be compatible
with a driver that handles the compressed upcase table correctly.
Something like the below patch will fix it:


--- fuse-exfat-1.1.0/libexfat/node.c    2014-07-08 15:40:12.000000000 +0200
+++ fuse-exfat-1.1.0.ch/libexfat/node.c 2016-02-08 19:34:37.265341043 +0100
@@ -247,6 +247,7 @@
    uint16_t reference_checksum = 0;
    uint16_t actual_checksum = 0;
    uint64_t valid_size = 0;
+   int i, j, k, ucsize;

    *node = NULL;

@@ -398,6 +399,35 @@
                        le32_to_cpu(upcase->start_cluster));
                goto error;
            }
+           /* handle compressed upcase table */
+           for (ucsize = 0, i = 0; i < ef->upcase_chars; i++) {
+               if (le16_to_cpu(ef->upcase[i]) != 0xffff ||
+                   (i+1 >= ef->upcase_chars))
+                   ucsize++;
+               else {
+                   ucsize += le16_to_cpu(ef->upcase[i+1]);
+                   i++;
+               }
+           }
+           if (ucsize <= 0x10000) {
+               le16_t *u =  (le16_t *)malloc(ucsize * sizeof(le16_t));
+               for (i = 0, j = 0; i < ef->upcase_chars; i++) {
+                   if (le16_to_cpu(ef->upcase[i]) != 0xffff ||
+                       (i+1 >= ef->upcase_chars)) {
+                       u[j++] = ef->upcase[i];
+                   } else {
+                       k = le16_to_cpu(ef->upcase[i+1]);
+                       i++;
+                       while (k--) {
+                           le16_t v = cpu_to_le16(j);
+                           u[j++] = v;
+                       }
+                   }
+               }
+               ef->upcase_chars = ucsize;
+               free(ef->upcase);
+               ef->upcase = u;
+           }
            break;

manual not installed by default

Default make install target doesn't include manual pages. I guess this is because no-installman option for automake in configure.ac. Would you consider including manual pages too in make install target?

Heap buffer overflow in exfatfsck in verify_vbr_checksum()

This input file can trigger a heap overflow in exfatfsck:
https://crashes.fuzzing-project.org/exfatfsck-heap-overflow-write-verify_vbr_checksum

This was found while fuzzing with the tool american fuzzy lop.

Here is the stack trace from address sanitizer:

==7351==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000ef91 at pc 0x00000044390b bp 0x7ffdeb0bf9d0 sp 0x7ffdeb0bf188
WRITE of size 110 at 0x60200000ef91 thread T0
    #0 0x44390a in __interceptor_pread64 (/mnt/ram/exfat/exfatfsck.asan+0x44390a)
    #1 0x4e89f5 in verify_vbr_checksum /f/exfat-utils-1.1.1/libexfat/mount.c:107:6
    #2 0x4e89f5 in exfat_mount /f/exfat-utils-1.1.1/libexfat/mount.c:220
    #3 0x4dd537 in main /f/exfat-utils-1.1.1/fsck/main.c:163:6
    #4 0x7f403c332f9f in __libc_start_main /var/tmp/portage/sys-libs/glibc-2.20-r2/work/glibc-2.20/csu/libc-start.c:289
    #5 0x437006 in _start (/mnt/ram/exfat/exfatfsck.asan+0x437006)

0x60200000ef91 is located 0 bytes to the right of 1-byte region [0x60200000ef90,0x60200000ef91)
allocated by thread T0 here:
    #0 0x4bdfd2 in __interceptor_malloc (/mnt/ram/exfat/exfatfsck.asan+0x4bdfd2)
    #1 0x4e8959 in exfat_mount /f/exfat-utils-1.1.1/libexfat/mount.c:211:21

SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 __interceptor_pread64
Shadow bytes around the buggy address:
  0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c047fff9df0: fa fa[01]fa fa fa 00 00 fa fa 00 07 fa fa fd fd
  0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==7351==ABORTING

unable to re-partition exfat sd card

Hi there,

I have a samsung 128 mb sd card that I had attached to my samsung s5 phone (which is not rooted).
I plugged in my Samsung S5 to my mac and used a "adb shell sm partition disk:179,128 mixed 50" command to partition the card to 50 % adoptable storage and 50 % standard SD.

Recently I received an error message on my phone advising that the 'adopted' internal part of the sd card had become corrupted.

I am not in a position where I need to recover the data on the SD card, I would just like to re-partition the SD card and start again from scratch. It doesn't appear that any app is allowing me to do so.

I've tried on various devices eg...
On a rooted android device (not my phone) I tried running the app Aparted to re-partition the sd card.
On a my mac I've tried running disk doctor for re-partitioning to no avail.
I've also attempted to run g-parted and fdisk from a virtual ubuntu partition to no avail,
and also attempted to use the mini partition tool on a Windows machine to no avail.

I've tried running a exfat fsk this has not found any issues.
It detects the first partition /dev/sdb1 though fails to recognise the /dev/sdb2 and /dev/sdb3 partitions.

osboxes@osboxes:~$ sudo exfatfsck /dev/sdb1
exfatfsck 1.2.4
Checking file system on /dev/sdb1.
File system version 1.0
Sector size 512 bytes
Cluster size 128 KB
Volume size 60 GB
Used space 9670 MB
Available space 50 GB
Totally 1207 directories and 3966 files.
File system checking finished. No errors found`

Even though I can see the partition I can't seem to make changes.

Disk /dev/sdb: 119.8 GiB, 128579534848 bytes, 251131904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 752570F2-9E31-4886-B607-C4B575E548BD

Device Start End Sectors Size Type
/dev/sdb1 2048 125566975 125564928 59.9G Microsoft basic data
/dev/sdb2 125566976 125599743 32768 16M unknown
/dev/sdb3 125599744 251131870 125532127 59.9G unknown

Any assistance would be much appreciated.

Thank you.

license

I know I had a discussion with you previously about licensing. But I've lost that history. I am wondering of the possibility of re-license under a less restrictive license like BSD? Why was GPLvX chosen? I would very much like to port this to a proprietary RTOS but can't because of the GPL barrier. We are, however, allowed to use BSD licensed source. Thoughts? I'd be OK with a "no way in hell" answer, but if that is the case I'd appreciate feedback on what is the pull for GPLvX. Thanks!

Complete migration from Google Code

Google Code was used for hosting for many years but it has many drawbacks and becomes more and more obsolete. Let's hope GitHub will be a better home for the project.

  • Choose branching policy.
  • File issues.
  • Close the site at Google Code.
  • Announce hosting change.
  • Make a release with download links pointing here.

Large files appear corrupted under Linux, unless using Windows 7

Using Git exfat fuse dated July 14 2016, I'm seeing few (if any) hangs while mounting now. Also no apparent hangs while using /bin/ls on the exfat filesystem.

However the following errors still exist where I cannot copy or view files larger than a certain size, and the files will appear corrupted under Linux. Using Windows 7, I have no problems viewing or copying the same files.

Appears each large file (ie. JPEG, MP4) has a corrupt clusters. I did change from the default 64KB to 128KB cluster size to try to avert this issue without any success.

EXFAT FSCK OUTPUT
./exfatfsck /dev/sdd1
exfatfsck 1.2.4
Checking file system on /dev/sdd1.
File system version 1.0
Sector size 512 bytes
Cluster size 128 KB
Volume size 58 GB
Used space 21 GB
Available space 36 GB
ERROR: file '07141240_0006.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141300_0007.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141320_0008.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141340_0009.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141400_0010.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141533_0011.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141553_0012.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141608_0013.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141628_0014.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141648_0015.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141708_0016.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141728_0017.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141748_0018.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141808_0019.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141817_0020.MP4' has invalid cluster 0xfffffff7.
ERROR: file '07141843_0021.MP4' has invalid cluster 0xfffffff7.
Totally 4 directories and 22 files.
File system checking finished. ERRORS FOUND: 16.

SYSLOG: MOUNTING THE FILESYSTEM
Jul 14 20:16:07 localhost4 kernel: usb 1-1.3: new high-speed USB device number 15 using ehci-pci
Jul 14 20:16:07 localhost4 kernel: usb 1-1.3: New USB device found, idVendor=4255, idProduct=1000
Jul 14 20:16:07 localhost4 kernel: usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jul 14 20:16:07 localhost4 kernel: usb 1-1.3: Product: Storage
Jul 14 20:16:07 localhost4 kernel: usb 1-1.3: Manufacturer: Ambarella
Jul 14 20:16:07 localhost4 kernel: usb 1-1.3: SerialNumber: 123456789ABC
Jul 14 20:16:07 localhost4 kernel: usb-storage 1-1.3:1.0: USB Mass Storage device detected
Jul 14 20:16:07 localhost4 kernel: scsi host16: usb-storage 1-1.3:1.0
Jul 14 20:16:07 localhost4 mtp-probe[26233]: checking bus 1, device 15: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3"
Jul 14 20:16:07 localhost4 mtp-probe[26233]: bus: 1, device: 15 was not an MTP device
Jul 14 20:16:08 localhost4 kernel: scsi 16:0:0:0: Direct-Access AMBA Storage v1.0 PQ: 0 ANSI: 0
Jul 14 20:16:08 localhost4 kernel: sd 16:0:0:0: Attached scsi generic sg4 type 0
Jul 14 20:16:08 localhost4 kernel: sd 16:0:0:0: [sdd] 120946688 512-byte logical blocks: (61.9 GB/57.7 GiB)
Jul 14 20:16:08 localhost4 kernel: sd 16:0:0:0: [sdd] Write Protect is off
Jul 14 20:16:08 localhost4 kernel: sd 16:0:0:0: [sdd] Mode Sense: 8f 00 00 08
Jul 14 20:16:08 localhost4 kernel: sd 16:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Jul 14 20:16:09 localhost4 kernel: sdd: sdd1
Jul 14 20:16:09 localhost4 kernel: sd 16:0:0:0: [sdd] Attached SCSI removable disk

SYSLOG: ERROR DURING FILE COPY OPERATION
Jul 14 20:13:32 localhost4 kernel: scsi_io_completion: 4 callbacks suppressed
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 4e 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: 4 callbacks suppressed
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 85512
Jul 14 20:13:32 localhost4 kernel: buffer_io_error: 4 callbacks suppressed
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6593, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 4f 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 85768
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6625, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 50 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 86024
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6657, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 51 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 86280
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6689, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 52 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 86536
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6721, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 53 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 86792
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6753, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 54 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 87048
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6785, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 55 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 87304
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6817, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 56 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 87560
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6849, async page read
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:13:32 localhost4 kernel: sd 14:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 01 57 08 00 00 08 00
Jul 14 20:13:32 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 87816
Jul 14 20:13:32 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 6881, async page read

SYSLOG: ERROR DURING EXFAT FSCK
Jul 14 20:16:34 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:16:34 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 00 00 08 00 00 08 00
Jul 14 20:16:34 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 8
Jul 14 20:16:34 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:16:34 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 00 00 08 00 00 08 00
Jul 14 20:16:34 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 8
Jul 14 20:16:34 localhost4 kernel: Buffer I/O error on dev sdd, logical block 1, async page read
Jul 14 20:16:47 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:16:47 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 00 80 20 00 00 40 00
Jul 14 20:16:47 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 32800
Jul 14 20:16:47 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:16:47 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 00 9a f0 00 00 10 00
Jul 14 20:16:47 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 39664
Jul 14 20:16:47 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
Jul 14 20:16:47 localhost4 kernel: sd 16:0:0:0: [sdd] tag#0 CDB: opcode=0x28 28 00 00 00 9a 08 00 00 08 00
Jul 14 20:16:47 localhost4 kernel: blk_update_request: I/O error, dev sdd, sector 39432
Jul 14 20:16:47 localhost4 kernel: Buffer I/O error on dev sdd1, logical block 833, async page read
Jul 14 20:17:34 localhost4 kernel: udevd[1640]: worker [26251] /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3/1-1.3:1.0/host16/target16:0:0/16:0:0:0/block/sdd/sdd1 is taking a long time

Segfault on mount.exfat

Hi there.

If i'm trying to run mount.exfat on Android 6.0.1 (Snapdragon 808, msm8992, 64-bit) then i'm getting a SEGFAULT.

139|root@h815:/ # mount.exfat
Segmentation fault

http://www.hastebin.com/gupacebuja.vhdl

Where does it happen?
utf.c: int utf8_to_utf16(le16_t* output, const char* input, size_t outsize, size_t insize)
=> while (inp - input < insize && *inp)

If i'm changing

const char* inp = input;
to
const char* inp = NULL;

then it completes the while loop and crashes on

*outp = cpu_to_le16(0);

If i remove that line then it runs through till the return.

Hope that helps in any way.

The module can't work on the OpenWrt

After i has ported the exfat to the openwrt,I found that it can not work on my openwrt system.The operating steps and the error information as bellow:
root@puma:/# mkexfatfs /dev/sdb1
mkexfatfs 1.2.2
Creating... done.
Flushing... done.
File system created successfully.
root@openwrt:/#mkdir -p /mnt/exfat
root@openwrt:/# mount.exfat-fuse /dev/sdb1 /mnt/exfat/
FUSE exfat 1.2.2
ERROR: exFAT file system is not found.

fsync failed: Input/output error

Just made a fresh install. sudo mount.exfat-fuse /dev/sda1 /mnt/exfat execution remained at FUSE expat 1.2.3 several minutes and finally it threw WARN: volume was not unmounted cleanly.
ERROR: fsync failed: Input/output error.

Mount error: unknown entry type 0xca

KaOS (2016)
KDE Plasma 5.6.1
framework 5.20.0
Qt 5.6.0
Kenel 4.4.5-1
64-bit

gui mount KDE Dolphin:

An error occurred while accessing '119.7 GiB Removable Media', the system responded: The requested operation has failed: Error mounting /dev/sdb1 at /run/media/jimslinux/9C33-6BBD: Command-line mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,iocharset=utf8,namecase=0,errors=remount-ro,umask=0077" "/dev/sdb1" "/run/media/jimslinux/9C33-6BBD"' exited with non-zero exit status 1: stdout:FUSE exfat 1.2.3
'
stderr: `ERROR: unknown entry type 0xca.
'

Create dir for card to mount to:

[root@jim-pc ~]# mkdir /media/newhd
[root@jim-pc ~]# mount /dev/sdb1 /media/newhd
FUSE exfat 1.2.3
ERROR: unknown entry type 0xca.

Enhancement: Support Windows filesystem attributes

Windows has file attributes, e.g. hidden or system, for VFAT, NTFS and exFAT.

With VFAT and NTFS they can be accessed (more or less easily) from Linux.

For NTFS getfattr seems to do the trick:

box:~ # getfattr -R --no-dereference -e hex -n system.ntfs_attrib_be /mnt
# file: mnt
system.ntfs_attrib_be=0x00000036

# file: mnt/file1
system.ntfs_attrib_be=0x00000022

# file: mnt/file2
system.ntfs_attrib_be=0x00000020

For VFAT one can probably hack something together with mtools.

Searching through the exFAT code, however, I didn't find any mention of support for Windows attributes.

Would it be possible to add support for this to fuse-exfat?

Reporting as exfat, but mount fails

I have a Sandisk 64G Ultra microsd card formated in an Android phone.
I tried to use Fedora 23 fuse-exfat to mount the device with mount -t exfat /dev/sdi1 /mnt/gn-sd/, and the system reports:

FUSE exfat 1.2.3

Yet, nothing was mounted. I tried this project exfat.git then, and got the same result:

FUSE exfat 1.2.4

and again, nothing was mounted.

lsblk -f gives me:

sdi `-sdi1   exfat             2B5D-7D8C

but sfdisk -l says:

Disk /dev/sdi: 59.5 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdi1 * 2048 124735487 124733440 59.5G c W95 FAT32 (LBA)

Suspecting of a damaged card, I run fsck /dev/sdi1:

fsck from util-linux 2.28
exfatfsck 1.2.3
Checking file system on /dev/sdi1.
File system version 1.0
Sector size 512 bytes
Cluster size 128 KB
Volume size 59 GB
Used space 37 GB
Available space 22 GB
Totally 8972 directories and 93747 files.
File system checking finished. No errors found.

So the thing seems right.

Thanks!

L.

Multiple files having the same name but a different case in different directories

I seem to be seeing an issue where multiple files having the same name (but with a different case) causes problems.

Reproduction steps:

# within a newly created exfat mount
git clone https://github.com/torvalds/linux.git
cd linux
git status

Expected result

Git reporting no changes

Actual result

	modified:   include/uapi/linux/netfilter/xt_CONNMARK.h
	modified:   include/uapi/linux/netfilter/xt_DSCP.h
	modified:   include/uapi/linux/netfilter/xt_MARK.h
	modified:   include/uapi/linux/netfilter/xt_RATEEST.h
	modified:   include/uapi/linux/netfilter/xt_TCPMSS.h
	modified:   include/uapi/linux/netfilter_ipv4/ipt_ECN.h
	modified:   include/uapi/linux/netfilter_ipv4/ipt_TTL.h
	modified:   include/uapi/linux/netfilter_ipv6/ip6t_HL.h
	modified:   net/netfilter/xt_DSCP.c
	modified:   net/netfilter/xt_HL.c
	modified:   net/netfilter/xt_RATEEST.c
	modified:   net/netfilter/xt_TCPMSS.c

Now the pattern I saw here was that the problematic file names all appear with different cases within the linux code base here. I've tried recreating a few with the correct case and it appears to simply invert the case of the other file in those tests.

I've tested this on exfat 1.2.5 + kernel 4.9 and exfat 1.2.4 + kernel 4.4 to reproduce these results.

repair VBR

exfat as a internal partition can not be repaired from OS X or Linux. Adding a repair capability would be appreciated.

In my case the exfat VBR is affected. The ssd partition in question can be mounted and looks fine. But exfatfsck stops at the checksum and does not act about.

Here the tools (from current git) output:
exfatfsck 1.2.3
ERROR: invalid VBR checksum 0x55dbf46 (expected 0x79e6f9c3).

Failed to build in Mac OS X 10.10.5

I've installed automake.
However, I failed to build in configure step.
Here is the message I got:

./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for ranlib... ranlib
checking for ar... ar
checking the archiver (ar) interface... ar
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
./configure: line 4080: syntax error near unexpected token FUSE,' ./configure: line 4080:PKG_CHECK_MODULES(FUSE, fuse)'

Does not compile with Kernel 4.5 (rc1)?

Tried to compile the latest git (Dec 19, 2015) with Kernel 4.5-rc1.

DKMS make.log for exfat-1.2.9+20151110 for kernel 4.5.0-040500rc1-generic (x86_64)
Fri Jan 29 19:12:27 CET 2016
make: Entering directory '/usr/src/linux-headers-4.5.0-040500rc1-generic'
LD /var/lib/dkms/exfat/1.2.9+20151110/build/built-in.o
CC [M] /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_core.o
CC [M] /var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.o
/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.c:1379:2: error: unknown field ‘follow_link’ specified in initializer
.follow_link = exfat_follow_link,
^
/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.c:1379:17: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.follow_link = exfat_follow_link,
^
/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.c:1379:17: note: (near initialization for ‘exfat_symlink_inode_operations.create’)
scripts/Makefile.build:258: recipe for target '/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.o' failed
make[1]: *** [/var/lib/dkms/exfat/1.2.9+20151110/build/exfat_super.o] Error 1
Makefile:1391: recipe for target 'module/var/lib/dkms/exfat/1.2.9+20151110/build' failed
make: *** [module/var/lib/dkms/exfat/1.2.9+20151110/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.5.0-040500rc1-generic'

Switch from SCons to a better build system

I'm fed up with the amount of Python code required to make SCons work properly. A new build system should do more job out-of-the box and be available in the most popular Unix-like systems.

Autotools look like a perfect choice.

Build on OpenBSD?

Hi.

I am missing the build instructions for OpenBSD. And a installable package would be nice... :)

Best regards
swatting

Error while doing ./configure --prefix=/usr

Hi ,

I was installing fuse-exfat and got the below error while installing, I did the following things to install,

I installed the below packages:

* git
* autoconf
* automake
* pkg-config
* fuse-devel (or libfuse-dev)
* gcc
* make

I got the source code, changed directory and compiled as below:

    git clone https://github.com/relan/exfat.git
    cd exfat
    autoreconf --install
    ./configure --prefix=/usr

while ./configure --prefix=/usr , I got the error as below,

[root@Cloud exfat]# ./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking for ranlib... ranlib
checking for ar... ar
checking the archiver (ar) interface... ar
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FUSE... no
configure: error: Package requirements (fuse) were not met:

No package 'fuse' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables FUSE_CFLAGS
and FUSE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Please help to resolve the issue.

Repairing functionality in fsck

Current implementation of fsck utility is very simple and can only check file systems. Repairing is not supported but many people want it. It's a very complex task that will hardly ever be done by myself. Volunteers are welcome!

Support shortname mount option like vfat

The linux vfat filesystem supports a mount option -o shortname=mode. From mount(8):

   shortname=mode
          Defines the behavior for  creation  and  display  of  filenames
          which  fit  into  8.3  characters.   If  a long name for a file
          exists, it will always be the preferred one for display.  There
          are four modes:

          lower  Force the short name to lower case upon display; store a
                 long name when the short name is not all upper case.

          win95  Force the short name to upper case upon display; store a
                 long name when the short name is not all upper case.

          winnt  Display the short name as is; store a long name when the
                 short name is not all lower case or all upper case.

          mixed  Display the short name as is; store a long name when the
                 short  name  is  not  all  upper case.  This mode is the
                 default since Linux 2.6.32.

It would be nice to support at least the lower option.

[Help] Recovering data based on list of flawed sectors.

Hello,

Note: I was trying to find an email address for this kind of support, but as the Readme file requests it, I am opening a new issue.

TL;DR: Ask help for a tool which can indicate which file (or none) belongs to a sector/block/whatever.

Couple of years ago, one of my HDD was becoming faulty; so I unplugged it, and few days later, I did a recover of its data using GNU's ddrescue. Inside this HDD, only one partition with an exFAT FS, covering almost the whole support (inside an MBR partition table, IIRC).
As a result, I have two files, the first as a RAW data file, a (almost) perfect copy of the partition which I can mount using loop devices (working nicely), and the second as a ddrescue's log file, which contents a list of faulty sectors when trying to recover data from the HDD.

Based on this logfile, I have something like 4 MiB of bad sectors on a 1.4 TiB FS; but the problem is I don't know if those bad sectors were holding data, or were deleted files.

I guess I am looking for a tool which can "reverse" the searching process, and then tells us “this sectors belongs to file "/path/to/file"” or “no content on this sector”. As my final objective, I want to get the list of broken files, and finaly recover the other data from this RAW image to another safe device.

I guess I could try to implement myself this tool, but I don't know the "protocol" behind exFAT, hence my request for support, please.

Hope to hear from you soon.

Here a little paste from the logfile:

# Rescue Logfile. Created by GNU ddrescue version 1.19
# Command line: ddrescue --input-position=0 --direct --preallocate --retry-passes=3 --verbose /dev/sdc1 wd_1500G.dd wd_1500G.logfile
# Start time:   2015-07-28 02:31:56
# Current time: 2015-07-28 02:32:02
# Retrying bad sectors... Retry 1 (forwards)
# current_pos  current_status
0x93B04F1400     -
#      pos        size  status
0x00000000  0x93B04F1000  +
0x93B04F1000  0x00001000  -
0x93B04F2000  0x00006000  +
0x93B04F8000  0x00001000  -
../..
0x93B055A000  0x00001000  -
0x93B055B000  0x59C2E3C000  +
0xED73397000  0x00001000  -
../..
0xED73DC1000  0x00001000  +
0xED73DC2000  0x00001000  -
0xED73DC3000  0x6FDCF3D000  +

unable to cleanup a node with 1 references.

Empty, but previously used and rm -rf'd via fuse-exfat SDXC card, mounted with following command:

# mount.exfat-fuse /dev/sd2i /mnt 
FUSE exfat 1.2.3
# echo $?
0
# pgrep -lf fuse                                                               
19864 mount.exfat-fuse /dev/sd2i /mnt

In another terminal as non-root user, I do:

$ touch /mnt/a                                                                 
$ rm -f /mnt/a
rm: /mnt/a: Resource temporarily unavailable

Back in the other shell, where I mounted sd-card I see:

# BUG: unable to cleanup a node with 1 references.
# pgrep -lf fuse | wc -l
       0
# dmesg | grep fuse
fuse: device close without umount

This is on:

# sysctl -n kern.version                                                       
OpenBSD 6.0-beta (GENERIC.MP) #2123: Wed May 25 14:04:11 MDT 2016
    [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

v1.2.4, missing directories that Windows 7 shows

related: dorimanx/exfat-nofuse/issues/87 (but different results)

I have an SDXC card where a Cygwin "find" under Windows 7 shows many more directories than Linux's find with exfat-fuse v1.2.4. exfatfsck does not pass, but aborts (separate issue), yet exfat-fuse sees more files than exfat-nofuse in the same directory.

diff -u between Windows's/Cygwin's "find" and exfat on Linux:

--- filelist-windows7.txt   2016-07-18 23:26:13.099195140 +0200
+++ filelist-exfat-fuse.txt 2016-07-18 22:53:32.343360700 +0200
@@ -2413,33 +2413,6 @@
 ./DCIM/12760612/DSC02565.JPG
 ./DCIM/12760612/DSC02566.ARW
 ./DCIM/12760612/DSC02566.JPG
-./DCIM/12960617
-./DCIM/12960617/DSC02578.ARW
[...]
-./DCIM/12960617/DSC02590.ARW
-./DCIM/12960617/DSC02590.JPG
 ./DCIM/13160619
 ./DCIM/13160619/DSC02605.ARW
 ./DCIM/13160619/DSC02605.ARW.xmp
@@ -2974,296 +2947,6 @@
 ./DCIM/13560709/DSC02941.ARW
 ./DCIM/13560709/DSC02941.JPG
 ./DCIM/13660710
-./DCIM/13760715
-./DCIM/13760715/DSC02945.ARW
-./DCIM/13760715/DSC02945.JPG
[...]
-./DCIM/13960716/DSC03076.JPG
-./DCIM/13960716/DSC03077.ARW
-./DCIM/13960716/DSC03077.JPG
-./DCIM/13960716/DSC03078.ARW
-./DCIM/13960716/DSC03078.JPG
-./MP_ROOT
-./MP_ROOT/100ANV01
-./MP_ROOT/101ANV01
-./MP_ROOT/102ANV01
-./MP_ROOT/103ANV01
-./MP_ROOT/104ANV01
[...]
-./MP_ROOT/137ANV01
-./MP_ROOT/138ANV01
-./MP_ROOT/139ANV01
 ./PRIVATE
 ./PRIVATE/AVCHD
 ./PRIVATE/AVCHD/BDMV

v1.2.4, missing files with optional entries

I have a SONY SXS 32G card writed by sony video camera.
My machine is win7 64bit, ubuntu 14.04.1 LTS 32bit and exfat-fuse 1.2.4.
The card in sony card speed reader US30, I found 15 files in \XDROOT\Clip by win7,
C:\Users\hp>dir g:\xdroot\clip
驱动器 G 中的卷没有标签。 ** no label
卷的序列号是 446B-09C9

g:\xdroot\clip 的目录

2014/03/11 01:14

.
2014/03/11 01:14 ..
2014/03/11 01:16 180,334,128 966_0001.MXF
2014/03/11 01:16 1,847,296 966_0001R01.BIM
2014/03/11 01:17 95,263,280 966_0002.MXF
2014/03/11 01:16 2,520 966_0001M01.XML
2014/03/11 01:17 2,338,816 966_0002R01.BIM
2014/03/11 01:18 100,910,652 966_0003.MXF
2014/03/11 01:17 2,243 966_0002M01.XML
2014/03/11 01:18 2,093,056 966_0003R01.BIM
2014/03/11 01:18 92,534,332 966_0004.MXF
2014/03/11 01:18 2,520 966_0003M01.XML
2014/03/11 01:18 1,921,024 966_0004R01.BIM
2014/03/11 01:20 55,682,560 966_0005.MXF
2014/03/11 01:18 2,520 966_0004M01.XML
2014/03/11 01:20 2,166,784 966_0005R01.BIM
2014/03/11 01:20 2,227 966_0005M01.XML
15 个文件 535,103,958 字节
2 个目录 31,393,841,152 可用字节

but I mount the card to ubuntu 14.04.1, the files number in same dir changes to 10.

root@usbweb:/# ls /mnt/XDROOT/Clip/ -lai
total 14848
4 drwxrwxrwx 1 root root 524288 3月 11 2014 .
2 drwxrwxrwx 1 root root 524288 3月 11 2014 ..
6 -rwxrwxrwx 1 root root 2520 3月 11 2014 966_0001M01.XML
5 -rwxrwxrwx 1 root root 1847296 3月 11 2014 966_0001R01.BIM
8 -rwxrwxrwx 1 root root 2243 3月 11 2014 966_0002M01.XML
7 -rwxrwxrwx 1 root root 2338816 3月 11 2014 966_0002R01.BIM
10 -rwxrwxrwx 1 root root 2520 3月 11 2014 966_0003M01.XML
9 -rwxrwxrwx 1 root root 2093056 3月 11 2014 966_0003R01.BIM
12 -rwxrwxrwx 1 root root 2520 3月 11 2014 966_0004M01.XML
11 -rwxrwxrwx 1 root root 1921024 3月 11 2014 966_0004R01.BIM
14 -rwxrwxrwx 1 root root 2227 3月 11 2014 966_0005M01.XML
13 -rwxrwxrwx 1 root root 2166784 3月 11 2014 966_0005R01.BIM

missing MXF file with video content, I can use them in win7.

root@usbweb:/home/sc/exfat/fsck# exfatfsck /dev/sdb1
exfatfsck 1.2.4
Checking file system on /dev/sdb1.
File system version 1.0
Sector size 2 KB
Cluster size 512 KB
Volume size 30 GB
Used space 606 MB
Available space 29 GB
WARN: unknown entry type 0xe1.
WARN: unknown entry type 0xe1.
WARN: unknown entry type 0xe1.
WARN: unknown entry type 0xe1.
WARN: unknown entry type 0xe1.
Totally 10 directories and 13 files.
File system checking finished. No errors found.

v1.2.4 "BUG: invalid cluster number 0." with crashes in exfatfsck and when reading from directory

This is a gdb session of a Sony-camera-written SDXC card (w/ Linux exfat, too) where exfatfsck complains. Windows 7 CHKDSK finds nothing to fault with the media.

exfatfsck 1.2.4
WARN: volume was not unmounted cleanly.
Checking file system on /dev/sdi1.
File system version           1.0
Sector size                 512 bytes
Cluster size                128 KB
Volume size                  59 GB
Used space                   57 GB
Available space            2593 MB
BUG: invalid cluster number 0.

Program received signal SIGABRT, Aborted.
(gdb) bt fu
#0  0x00007ffff7a4bc37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
        resultvar = 0
        pid = 10106
        selftid = 10106
#1  0x00007ffff7a4f028 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x64f530, sa_sigaction = 0x64f530}, sa_mask = {__val = {0, 140737488345600, 140737351947559, 21474836481, 0, 72062084411294464, 140737347960112, 4223971, 140737488345600, 140737488345984, 140737351976149, 1, 0, 15, 255, 
              2}}, sa_flags = -10176, sa_restorer = 0x4072cd}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x0000000000402b84 in exfat_bug (format=format@entry=0x4073e3 "invalid cluster number %u") at log.c:50
        ap = {{gp_offset = 16, fp_offset = 48, overflow_arg_area = 0x7fffffffd980, reg_save_area = 0x7fffffffd8c0}}
        aq = {{gp_offset = 8, fp_offset = 48, overflow_arg_area = 0x7fffffffd980, reg_save_area = 0x7fffffffd8c0}}
#3  0x0000000000401816 in c2s (cluster=cluster@entry=0, ef=0x7fffffffdb80) at cluster.c:42
No locals.
#4  0x000000000040189d in exfat_c2o (ef=ef@entry=0x7fffffffdb80, cluster=cluster@entry=0) at cluster.c:52
No locals.
#5  0x0000000000403fa3 in opendir (ef=ef@entry=0x7fffffffdb80, it=it@entry=0x7fffffffda00, dir=0x64f530, dir=0x64f530) at node.c:109
No locals.
#6  0x000000000040471c in exfat_cache_directory (ef=ef@entry=0x7fffffffdb80, dir=dir@entry=0x64f530) at node.c:533
        it = {cluster = 0, offset = 0, contiguous = 0, chunk = 0x65d1e0 "X?\335\367\377\177"}
        rc = <optimized out>
        node = <optimized out>
        current = 0x0
#7  0x0000000000402f80 in exfat_opendir (ef=ef@entry=0x7fffffffdb80, dir=0x64f530, it=it@entry=0x7fffffffdaa0) at lookup.c:36
        rc = <optimized out>
#8  0x0000000000401578 in dirck (ef=ef@entry=0x7fffffffdb80, path=path@entry=0x63baa0 "/DCIM/13460623") at main.c:94
        parent = 0x64f530
        node = <optimized out>
        it = {parent = 0x64f530, current = 0x0}
        rc = <optimized out>
        path_length = <optimized out>
        entry_path = 0x650160 "/DCIM/13460623/"
#9  0x0000000000401593 in dirck (ef=ef@entry=0x7fffffffdb80, path=path@entry=0x63b490 "/DCIM") at main.c:111
        parent = 0x63afb0
        node = 0x64f530
        it = {parent = 0x63afb0, current = 0x64f530}
        rc = <optimized out>
        path_length = <optimized out>
        entry_path = 0x63baa0 "/DCIM/13460623"
#10 0x0000000000401593 in dirck (ef=ef@entry=0x7fffffffdb80, path=path@entry=0x4072cf "") at main.c:111
        parent = 0x62ba80
        node = 0x63afb0
        it = {parent = 0x62ba80, current = 0x63afb0}
        rc = <optimized out>
        path_length = <optimized out>
        entry_path = 0x63b490 "/DCIM"
#11 0x000000000040122f in fsck (ef=0x7fffffffdb80) at main.c:128
No locals.
#12 main (argc=<optimized out>, argv=<optimized out>) at main.c:165
        opt = <optimized out>
        spec = 0x7fffffffe138 "/dev/sde1"
        ef = {dev = 0x60b0b0, sb = 0x60b860, upcase = 0x7ffff7fb3010, root = 0x62ba80, cmap = {start_cluster = 2, size = 486990, chunk = 0x62bcf0, chunk_size = 486990, dirty = false}, label = '\000' <repeats 90 times>, zero_cluster = 0x60ba70, dmask = 0, fmask = 0, 
          uid = 1000, gid = 1000, ro = 1, noatime = false}

Zalman VE-200 cannot read images from the _ISO directory created by fuse-exfat

I'm attempting to format a disk for use in a Zalman VE-200 (which loads ISOs from a folder on the first partition), the folder works when the disk is formatted to exFat using windows - but not with mkfs.exfat.

format.sh;

#!/bin/bash
set -e
DSK=/dev/sdb
sudo dd if=/dev/zero of=${DSK} bs=512 count=4000
sudo sgdisk --zap-all ${DSK} || /bin/true
sleep 1
echo "# partitioning ${DSK}"
sudo parted -s ${DSK} mklabel msdos
sudo parted -s ${DSK} mkpart primary ntfs 2048s 100%
sudo mkfs.exfat -n multipass -p 2048 ${DSK}1
sleep 1
sudo partprobe ${DSK}
sudo fdisk -l ${DSK}
sudo dumpexfat ${DSK}1

format output:

2048000 bytes (2.0 MB) copied, 0.37823 s, 5.4 MB/s
Creating new GPT entries.
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
# partitioning /dev/sdb
mkexfatfs 1.1.1
Creating... done.
Flushing... done.
File system created successfully.
Disk /dev/sdb: 59.6 GiB, 64023257088 bytes, 125045424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x14075162

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 125044735 125042688 59.6G  7 HPFS/NTFS/exFAT
dumpexfat 1.1.1
Volume label               multipass
Volume serial number      0x6ceeb113
FS version                       1.0
Sector size                      512
Cluster size                  131072
Sectors count              125042688
Free sectors               125037312
Clusters count                488432
Free clusters                 488427
First sector                    2048
FAT first sector                 128
FAT sectors count               3968
First cluster sector            4096
Root directory cluster             4
Volume state                  0x0000
FATs count                         1
Drive number                    0x80
Allocated space                   0%

dump from disk formatted by windows:

dumpexfat 1.1.1
Volume label                        
Volume serial number      0xa8788af7
FS version                       1.0
Sector size                      512
Cluster size                  131072
Sectors count              125042688
Free sectors               125035264
Clusters count                488424
Free clusters                 488419
First sector                    2048
FAT first sector                2048
FAT sectors count               3840
First cluster sector            6144
Root directory cluster             4
Volume state                  0x0002
FATs count                         1
Drive number                    0x80
Allocated space                   0%

The only difference of note between them seems to be FAT first sector - win : 2048 mkfs : 128

any hints on where to go from here?

File written under Linux does not show up on Windows

Problem

A file that is created on an exFAT medium under Linux doesn't show up in the Windows Explorer.

Not sure whether this is related to #13.

Versions

  • Windows 8.1
  • openSUSE 13.1, x86_64
    • exfat 1.2.3

Reproducing

  1. Created filesystem with Windows 8.1

  2. Created test file testwin.txt under Windows 8.1

  3. Mounted with Linux

    mount.exfat /dev/loop0 /mnt/mnt/
    cat /mnt/mnt/testwin.txt
    (expected contents)
    joe /mnt/mnt/testlin.txt
    cat /mnt/mnt/testlin.txt
    (expected contents)
    umount /mnt/mnt
    sync
  4. Mounted with Windows

    • testwin.txt is there as expected
    • testlin.txt is not shown
  5. Executed file system check with Windows

    • now both files are there as expected with the expected contents

Expectation

Both files should already be there after Step 4.

ERROR: invalid VBR checksum 0xZZZZZZZZ (expected 0xYYYYYYYY).

Hi,

I tried to mount EXFAT formatted drive under FreeBSD, but it failed with this error:
ERROR: invalid VBR checksum 0xZZZZZZZZ (expected 0xYYYYYYYY).

The exfatfsck gave me same error without any chance to fix it.

The solution was to comment this line below in mount.c and recompile EXFAT:

1:56|w530|vermaden /usr/ports/obj/usr/ports/sysutils/fusefs-exfat/work/exfat-1.2.4/libexfat % diff -u mount.c mount.c.VERMOD.c 
--- mount.c     2017-02-12 01:56:34.945134727 +0100
+++ mount.c.VERMOD.c    2017-02-12 01:56:27.335136016 +0100
@@ -137,7 +137,7 @@
                {
                        exfat_error("invalid VBR checksum 0x%x (expected 0x%x)",
                                        le32_to_cpu(((const le32_t*) sector)[i]), vbr_checksum);
-                       return false;
+                       // return false;
                }
        return true;
 }

Filesystem was mounted correctly and works without any other errors.

Please provide this feature with some 'force' flag or 'debug' flag.

Regards,
vermaden

The question about exFAT specification.

I am a student and interested in exFAT.
I want to understand the mechanism of exFAT in more detail, but i can't find the officially released exFAT specification.
You complete this great implementation.
Can you tell me what is you according to and do you have any recommended document of exFAT?
Thank you!!!

Automount and install from source code.

OS - Ubuntu 14.04. I remove previous version exfat by command 'sudo apt-get remove exfat-fuse exfat-utils'. Then compiling from source by instruction. Mount exfat partitions work correctly, but only if i mount manually. Automount capability lost. How return this capability?
2016-02-08 01 06 22

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.