Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to exFAT partition do not persist #13

Closed
jazzzz opened this issue Nov 22, 2015 · 10 comments
Closed

Changes to exFAT partition do not persist #13

jazzzz opened this issue Nov 22, 2015 · 10 comments

Comments

@jazzzz
Copy link

jazzzz commented Nov 22, 2015

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.

@xunmengdeganjue
Copy link

hi jazzzz,
Can you show your mount options.

@relan
Copy link
Owner

relan commented Nov 23, 2015

Let's first define the sequence of particular steps (with some diagnostic) that reproduce the issue:

sudo exfatfsck /dev/sdb1
mkdir /tmp/sd
sudo mount.exfat-fuse /dev/sdb1 /tmp/sd
echo hello > /tmp/sd/test
sync /tmp/sd/test
sudo umount /tmp/sd
sudo exfatfsck /dev/sdb1
sudo mount.exfat-fuse /dev/sdb1 /tmp/sd
cat /tmp/sd/test

Please run those commands and paste here the full output.

@jazzzz
Copy link
Author

jazzzz commented Nov 23, 2015

@relan

exfatfsck 1.1.1
Checking file system on /dev/sdb1.
File system version           1.0
Sector size                 512 bytes
Cluster size                128 KB
Volume size                  59 GB
Used space                   56 GB
Available space            3273 MB
Totally 470 directories and 7435 files.
File system checking finished. No errors found.
FUSE exfat 1.2.2
sync: ignoring all arguments
exfatfsck 1.1.1
Checking file system on /dev/sdb1.
File system version           1.0
Sector size                 512 bytes
Cluster size                128 KB
Volume size                  59 GB
Used space                   56 GB
Available space            3273 MB
Totally 470 directories and 7435 files.
File system checking finished. No errors found.
FUSE exfat 1.2.2
cat: /tmp/sd/test: No such file or directory

@jazzzz
Copy link
Author

jazzzz commented Nov 23, 2015

@xunmengdeganjue /dev/sdb1 on /tmp/sd type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

@relan
Copy link
Owner

relan commented Nov 23, 2015

Please remove this line in fuse/main.c to enable additional logging:

#define exfat_debug(format, ...)

Compile and install mount.exfat-fuse. Then run

sudo mount.exfat-fuse /dev/sdb1 /tmp/sd -d

This command won't detach from your terminal. It will produce a lot of logging, please post it all here after you run those commands from another terminal instance:

echo hello > /tmp/sd/test
sync /tmp/sd/test
cat /tmp/sd/test
sudo umount /tmp/sd

@jazzzz
Copy link
Author

jazzzz commented Nov 23, 2015

FUSE exfat 1.2.2
FUSE library version: 2.9.4
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.23
flags=0x0003f7fb
max_readahead=0x00020000
DEBUG: [fuse_exfat_init].
   INIT: 7.19
   flags=0x00000031
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 10853
getattr /
DEBUG: [fuse_exfat_getattr] /.
   unique: 2, success, outsize: 120
unique: 3, opcode: LOOKUP (1), nodeid: 1, insize: 47, pid: 10853
LOOKUP /.Trash
getattr /.Trash
DEBUG: [fuse_exfat_getattr] /.Trash.
   unique: 3, error: -2 (No such file or directory), outsize: 16
unique: 4, opcode: LOOKUP (1), nodeid: 1, insize: 52, pid: 10853
LOOKUP /.Trash-1000
getattr /.Trash-1000
DEBUG: [fuse_exfat_getattr] /.Trash-1000.
   unique: 4, error: -2 (No such file or directory), outsize: 16
unique: 5, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 24712
getattr /
DEBUG: [fuse_exfat_getattr] /.
   unique: 5, success, outsize: 120
unique: 6, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 24712
LOOKUP /test
getattr /test
DEBUG: [fuse_exfat_getattr] /test.
   unique: 6, error: -2 (No such file or directory), outsize: 16
unique: 7, opcode: CREATE (35), nodeid: 1, insize: 61, pid: 24712
create flags: 0x8241 /test 0100664 umask=0002
DEBUG: [fuse_exfat_create] /test 0100664.
   create[94314759843824] flags: 0x8241 /test
getattr /test
DEBUG: [fuse_exfat_getattr] /test.
   NODEID: 2
   unique: 7, success, outsize: 160
unique: 8, opcode: FLUSH (25), nodeid: 2, insize: 64, pid: 24712
flush[94314759843824]
DEBUG: [fuse_exfat_flush] /test.
   unique: 8, success, outsize: 16
unique: 9, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 10854
getattr /
DEBUG: [fuse_exfat_getattr] /.
   unique: 9, success, outsize: 120
unique: 10, opcode: GETXATTR (22), nodeid: 2, insize: 68, pid: 24712
   unique: 10, error: -38 (Function not implemented), outsize: 16
unique: 11, opcode: WRITE (16), nodeid: 2, insize: 86, pid: 24712
write[94314759843824] 6 bytes to 0 flags: 0x8001
DEBUG: [fuse_exfat_write] /test (6 bytes).
   write[94314759843824] 6 bytes to 0
   unique: 11, success, outsize: 24
unique: 12, opcode: FLUSH (25), nodeid: 2, insize: 64, pid: 24712
flush[94314759843824]
DEBUG: [fuse_exfat_flush] /test.
   unique: 12, success, outsize: 16
unique: 13, opcode: RELEASE (18), nodeid: 2, insize: 64, pid: 0
release[94314759843824] flags: 0x8001
DEBUG: [fuse_exfat_release] /test.
   unique: 13, success, outsize: 16
unique: 14, opcode: GETATTR (3), nodeid: 2, insize: 56, pid: 26733
getattr /test
DEBUG: [fuse_exfat_getattr] /test.
   unique: 14, success, outsize: 120
unique: 15, opcode: OPEN (14), nodeid: 2, insize: 48, pid: 26733
open flags: 0x8000 /test
DEBUG: [fuse_exfat_open] /test.
   open[94314759843824] flags: 0x8000 /test
   unique: 15, success, outsize: 32
unique: 16, opcode: READ (15), nodeid: 2, insize: 80, pid: 26733
read[94314759843824] 4096 bytes from 0 flags: 0x8000
DEBUG: [fuse_exfat_read] /test (4096 bytes).
   read[94314759843824] 6 bytes from 0
   unique: 16, success, outsize: 22
unique: 17, opcode: GETATTR (3), nodeid: 2, insize: 56, pid: 26733
getattr /test
DEBUG: [fuse_exfat_getattr] /test.
   unique: 17, success, outsize: 120
unique: 18, opcode: FLUSH (25), nodeid: 2, insize: 64, pid: 26733
flush[94314759843824]
DEBUG: [fuse_exfat_flush] /test.
   unique: 18, success, outsize: 16
unique: 19, opcode: RELEASE (18), nodeid: 2, insize: 64, pid: 0
release[94314759843824] flags: 0x8000
DEBUG: [fuse_exfat_release] /test.
   unique: 19, success, outsize: 16
unique: 20, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26736
getattr /
DEBUG: [fuse_exfat_getattr] /.
   unique: 20, success, outsize: 120
unique: 21, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 26736
statfs /
DEBUG: [fuse_exfat_statfs].
   unique: 21, success, outsize: 96
unique: 22, opcode: FORGET (2), nodeid: 2, insize: 48, pid: 0
FORGET 2/1
DELETE: 2
unique: 23, opcode: FORGET (2), nodeid: 1, insize: 48, pid: 0
FORGET 1/1
unique: 24, opcode: DESTROY (38), nodeid: 0, insize: 40, pid: 0
DEBUG: [fuse_exfat_destroy].
   unique: 24, success, outsize: 16

@relan
Copy link
Owner

relan commented Nov 23, 2015

The log looks perfectly OK. This makes me think that the issue is somewhere else. You've said this SD card works fine under Windows. Was it the same PC, card reader, USB cable and USB port as with Ubuntu?

Could you test a different SD card on this Ubuntu PC to ensure that this behavior persists?

Could you test the problematic SD card on a different GNU/Linux PC with a different card reader and USB cable?

@xunmengdeganjue
Copy link

You can try to add a option umask=000 to your mount command,like following command line:

   mount.exfat -o umask=000 /dev/sd* /tmp/sd

or

   mount -t exfat -o umask=000 /dev/sd* /tmp/sd

the "*" in the command line represent the real number of you disk.
The day before yesterday,when I porting the exfat module into the OpenWRT I meet the problem too.I just add this option and the USB-storage can be wrote.

@jazzzz
Copy link
Author

jazzzz commented Nov 23, 2015

The log looks perfectly OK. This makes me think that the issue is somewhere else. You've said this SD card works fine under Windows. Was it the same PC, card reader, USB cable and USB port as with Ubuntu?

It was another PC with the same card reader.

Could you test a different SD card on this Ubuntu PC to ensure that this behavior persists?
Could you test the problematic SD card on a different GNU/Linux PC with a different card reader and USB cable?

I will try as soon as I can.

@relan
Copy link
Owner

relan commented May 24, 2016

No reply in 6 months, closing. Feel free to reopen if you have any new info.

@relan relan closed this as completed May 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants