fuse: mount failed: Invalid argument

3,743 views
Skip to first unread message

ja...@mutanti.com

unread,
Feb 14, 2011, 7:02:04 AM2/14/11
to ex...@googlegroups.com
hi, Ubuntu 10.10, installed deb file from ppa, but when i try to mount my exFAT USB disk drive I get this:

fuse: mount failed: Invalid argument

any ideas what is wrong ?

Stephan Aßmus

unread,
Feb 14, 2011, 7:12:26 AM2/14/11
to ex...@googlegroups.com
Hi,

Perhaps it easier to help you if you give the exact command line you
invoked, and also the device of the exFAT volume. You can see the device
graphically with the volume manager in the system panels.

Best regards,
-Stephan

ja...@mutanti.com

unread,
Feb 14, 2011, 7:29:16 AM2/14/11
to ex...@googlegroups.com
ok, sorry I wasn't sure exactly what output will be helpful. Here's the graphical stuff I suppose you wanted to see (although I'm not sure). Same this happens if I try on console: sudo mount /deb/sdb1 /mnt/storagejet or sudo mount.exfat-fuse /dev/sdb1 /mnt/storagejet

$ sudo mount.exfat-fuse /dev/sdb1 /mnt/storagejet/ -d
FUSE exfat 0.9.3

fuse: mount failed: Invalid argument

If you need any other log/output or whatever I will provide.

Stephan Aßmus

unread,
Feb 14, 2011, 7:57:26 AM2/14/11
to ex...@googlegroups.com
On 14.02.2011 13:29, ja...@mutanti.com wrote:
> ok, sorry I wasn't sure exactly what output will be helpful. Here's the
> graphical stuff I suppose you wanted to see (although I'm not sure).
> Same this happens if I try on console: sudo mount /deb/sdb1
> /mnt/storagejet or sudo mount.exfat-fuse /dev/sdb1 /mnt/storagejet
>
> $ sudo mount.exfat-fuse /dev/sdb1 /mnt/storagejet/ -d
> FUSE exfat 0.9.3
> fuse: mount failed: Invalid argument

I assume /mnt/storagejet exists. I don't know if the trailing / could be
a problem, and I would try to remove the -d option as well. After those
changes you end up with a command line that works for me.

Best regards,
-Stephan

ja...@mutanti.com

unread,
Feb 14, 2011, 8:20:59 AM2/14/11
to ex...@googlegroups.com
it's not the traling /.
it's not the -d option I put it just to see if it will bring more output.
the directory exists /mnt/storagejet exists.

Andrew Nayenko

unread,
Feb 15, 2011, 12:22:03 PM2/15/11
to ja...@mutanti.com, ex...@googlegroups.com
If there are symlinks in the mount point path, try to avoid them.
Could you strace the mount command?

> it's not the traling /.
> it's not the -d option I put it just to see if it will bring more output.
> the directory exists /mnt/storagejet exists.


--
 Andrew Nayenko <res...@gmail.com>

ja...@mutanti.com

unread,
Feb 16, 2011, 1:24:43 AM2/16/11
to ex...@googlegroups.com, ja...@mutanti.com
http://pastebin.com/rummdM7E - here's the strace, I hope I did it right, since it's the first time I make strace.

the command I ran was:

sudo strace mount.exfat-fuse /dev/sdb1 /mnt/storagejet

Andrew Nayenko

unread,
Feb 16, 2011, 3:20:05 AM2/16/11
to ja...@mutanti.com, ex...@googlegroups.com

mount arguments look OK...
Try to compile and run helloworld from FUSE documentation:
http://fuse.sourceforge.net/helloworld.html (copy-paste the code to a
file with hello.c name).
Compile:
gcc -Wall -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=25 -lfuse hello.c -o hello
Run:
./hello /mnt/storagejet
Did it work?


--
 Andrew Nayenko <res...@gmail.com>

ja...@mutanti.com

unread,
Feb 16, 2011, 6:38:02 AM2/16/11
to ex...@googlegroups.com, ja...@mutanti.com
here's the results, since hello did not produced any output, I'm pasting the part of mount command that looks to be interesting.

$ sudo ./hello /mnt/storagejet

$ mount
....
hello on /mnt/storagejet type fuse.hello (rw,nosuid,nodev)

Andrew Nayenko

unread,
Feb 16, 2011, 12:52:31 PM2/16/11
to ja...@mutanti.com, ex...@googlegroups.com

Very strange. Please show the output of
ls -l /dev/sdb*


--
 Andrew Nayenko <res...@gmail.com>

ja...@mutanti.com

unread,
Feb 17, 2011, 2:23:06 AM2/17/11
to ex...@googlegroups.com, ja...@mutanti.com
$ sudo ls -l /dev/sdb*
brw-rw---- 1 root disk 8, 16 2011-02-16 23:13 /dev/sdb
brw-rw---- 1 root disk 8, 17 2011-02-16 23:13 /dev/sdb1

and just in case

$ sudo fdisk /dev/sdb
Note: sector size is 4096 (not 512)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 1824 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xf90a7848

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1824   117209988    7  HPFS/NTFS
Partition 1 does not start on physical sector boundary.

and another one to avoid possible question

$ sudo mount -t ntfs /dev/sdb1 /mnt/storagejet
NTFS signature is missing.
Failed to mount '/dev/sdb1': Invalid argument
The device '/dev/sdb1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?

And just to clarify I am absolutely sure that the disk is formatted with exFAT. It's formatted under Windows7, also it's visible (read/write) under OSX 10.6.6. Hope this helps.


Andrew Nayenko

unread,
Feb 17, 2011, 1:20:07 PM2/17/11
to ja...@mutanti.com, ex...@googlegroups.com
Try to apply the attached patch to fuse-exfat source. If it still
won't work after this, I have no ideas what's wrong. :(

BTW, what's the HDD model?

--
 Andrew Nayenko <res...@gmail.com>

remove-blkdev-option.patch

ja...@mutanti.com

unread,
Feb 17, 2011, 1:23:42 PM2/17/11
to ex...@googlegroups.com, ja...@mutanti.com
it's transcend storagejet - http://www.transcendusa.com/products/ModDetail.asp?ModNo=248&LangNo=0&Func1No=&Func2No=

i'll try the patch tomorrow, since the ubuntu pc is at work.

ja...@mutanti.com

unread,
Feb 18, 2011, 2:03:21 AM2/18/11
to ex...@googlegroups.com, ja...@mutanti.com
IT'S WORKING. THANKS

Andrew Nayenko

unread,
Feb 19, 2011, 3:26:17 AM2/19/11
to ja...@mutanti.com, ex...@googlegroups.com
> IT'S WORKING. THANKS

That was just a dirty hack.

I think I've found the reason of the error. When fuseblk device is
mounted, it sets block size (512 bytes by default). Kernel requires
this size to be not less than device sector size and not more than
page size (set_blocksize() in fs/block_dev.c). In our case fuse-exfat
didn't specify blksize option and fuseblk defaulted to 512 bytes. But
your HDD sector size is 4 KB and for this reason set_blocksize()
returned -EINVAL.

Please check this new patch. It's intended to fix this issue
gracefully. Do not forget to revert previous patch.

--
 Andrew Nayenko <res...@gmail.com>

add-blksize-option.patch

ja...@mutanti.com

unread,
Feb 21, 2011, 2:47:08 AM2/21/11
to ex...@googlegroups.com, ja...@mutanti.com
I checked out the latest code from svn since I saw you comited the change there too. Everything is working fine, thanks again.

Andrew Nayenko

unread,
Feb 21, 2011, 1:47:26 PM2/21/11
to ja...@mutanti.com, ex...@googlegroups.com
> I checked out the latest code from svn since I saw you comited the change
> there too. Everything is working fine, thanks again.

Great! Thanks.


--
 Andrew Nayenko <res...@gmail.com>

Eugene Turkulevich

unread,
Mar 20, 2011, 9:37:37 AM3/20/11
to exFAT
hi, I have same problem, can you help me?

with 0.9.2 versions it was "invalid argument", with 0.9.4 (compiled
from source) it becomes:
failed to read 4 bytes from file at 65552 - on 512mb flash drive
and
failed to read 4 bytes from file at 1048592 - on 8gb flash drive
seems to me, it try to read outside the device size boundary

P.S.: I'm on OpenIndiana oi_148

Andrew Nayenko

unread,
Mar 21, 2011, 2:47:37 PM3/21/11
to ex...@googlegroups.com, Eugene Turkulevich

It's difficult to say anything from those errors. This is definitely not
an attempt to read beyond the device boundary because offsets are too
small. Most probably it failed to read the root directory.

1. What does Windows' chkdsk say about those volumes?
2. Did you create FS using Windows? If yes, which Windows version did
you use?
3. What are the exact sizes of those volumes in bytes?


--
Andrew Nayenko <res...@gmail.com>

Eugene Turkulevich

unread,
Mar 21, 2011, 3:09:09 PM3/21/11
to exFAT
oh, I apologize to not giving all the information.
first of all I have no Win and can't format flash drive with it. for
formatting I use latest version of Mac OS X: 10.6.6
and it is was just formatted drive with no information on it, with
512mb drive 'df' command (in Mac OS X terminal app) says that it has
size 1011328 blocks, 576 blocks used and 1010752 block free. dunno how
to discover more at this time.
I also discovered that error happens in cluster.c file, line 83 when
calling exfat_read_raw (I am not an expert in C code and in debugging
it, I just add several exfat_debug messages to find where error
appears and recompile).

what can I do next to find cause of problem?

Eugene Turkulevich

unread,
Mar 22, 2011, 2:36:26 AM3/22/11
to exFAT
I just have made an image (with dd command) from flash drive p1
partition (which is exFAT formatted) with size 517934592 bytes
then I made the device from this image with lofiadm -a 512m.img, it
becomes /dev/lofi/1 device
now I trying again to mount this image into existing folder with
command: pfexec mount.exfat /dev/lofi/1 /mnt/drive
and now picture is different:
it reads 4 bytes at offset 65552, then 32768 at 196608, then 1976 at
131072, then 5836 at 163840
and after this displays "fuse: mount failed: Invalid argument" error.
applying first patch (removing "blkdev" from default_options) make it
works.

but! only with disk image (not disk) and only with this "hack" (as you
mentioned before)

Eugene Turkulevich

unread,
Mar 22, 2011, 2:55:42 AM3/22/11
to exFAT
oh, and once more: when "failed to read 4 bytes from file at 65552"
error appears, pread function returns 4294967295 value.
it looks like maximum value of 4 bytes unsigned integer? or long?
(know nothing about modern types)

Andrew Nayenko

unread,
Mar 22, 2011, 5:41:28 PM3/22/11
to ex...@googlegroups.com, Eugene Turkulevich
pread() returns -1 (4294967295 and -1 are the same thing in memory for
4-byte values) when it fails (man pread). Never mind.

The problem is that pread() fails. Please apply the attached patch and
send me the output of mount command.

--
Andrew Nayenko <res...@gmail.com>

detailed-io-errors.patch

Andrew Nayenko

unread,
Mar 22, 2011, 5:27:22 PM3/22/11
to ex...@googlegroups.com, Eugene Turkulevich
Mac OS X often creates broken exFAT volumes which are unreadable even
under Windows. I'd recommend to use Windows or mkexfatfs to create exFAT FS.

I'll try to reproduce this issue.

--
Andrew Nayenko <res...@gmail.com>

Eugene Turkulevich

unread,
Mar 22, 2011, 6:04:08 PM3/22/11
to exFAT
it says:
BUG: failed to read 4 bytes from file at 65552: Invalid argument.
>  detailed-io-errors.patch
> 1KViewDownload

Andrew Nayenko

unread,
Mar 23, 2011, 3:48:47 PM3/23/11
to ex...@googlegroups.com, Eugene Turkulevich
> it says:
> BUG: failed to read 4 bytes from file at 65552: Invalid argument.

Looks like Solaris-specific (most probably block layer related) problem.
Try unaligned read of 4 bytes from exFAT partition:

sudo dd if=/dev/your_exfat_volume of=/dev/zero bs=4 count=1 skip=16388

Does this fail with the same error message?

Eugene Turkulevich

unread,
Mar 23, 2011, 5:55:10 PM3/23/11
to exFAT
oh, shame on me :) I had to remember solaris specific: when I start
trying perform dd with different block sizes I realize that I use /dev/
rdsk path instead of /dev/dsk (character device instead of block
device), and o'cos reading from character device with block size not
equal to real block size cause the error (result is undefined).

so, there is no read error!

but we still have "invalid argument" error, which can be healed only
with first patch (I checked this).
but as far as I understand this is not acceptable?

Andrew Nayenko

unread,
Mar 24, 2011, 2:57:53 AM3/24/11
to ex...@googlegroups.com, eugene.tu...@gmail.com
I didn't quite understand. What happens now when you try to mount an exFAT volume using proper block device?

Eugene Turkulevich

unread,
Mar 24, 2011, 3:00:55 AM3/24/11
to exFAT
when I try to mount using proper device it:
- without changes in 0.9.4 code - fails with "Invalid argument" error
- with patch1 (blkdev removed from default_options) - mounted without
errors and seems to be working (I try read/write and everything's
fine)

Andrew Nayenko

unread,
Mar 25, 2011, 3:52:40 AM3/25/11
to ex...@googlegroups.com, eugene.tu...@gmail.com
So, it looks like Solaris-specific problem. Further investigation will probably require digging into kernel code. I'm afraid I won't help you with it because I use GNU/Linux.

Eugene Turkulevich

unread,
Mar 25, 2011, 5:12:08 AM3/25/11
to exFAT
Ok, thanks a lot.
can you describe in brief what this option does and why this first
patch is not correct?
I will try explore ntfs3g code to compare...

Andrew Nayenko

unread,
Mar 25, 2011, 2:10:56 PM3/25/11
to ex...@googlegroups.com, Eugene Turkulevich
In Linux's FUSE (and probably in other FUSE implementation) blkdev
option indicates that FS is backed by a block device, which is obviously
the case for exFAT.

--
Andrew Nayenko <res...@gmail.com>

Reply all
Reply to author
Forward
0 new messages