vermaden / automount

Simple devd(8) based automounter for FreeBSD
66 stars 20 forks source link

Cannot mount ExFAT anymore #43

Closed probonopd closed 1 year ago

probonopd commented 2 years ago

Looks like I cannot mount ExFAT anymore, because automount thinks it's msdosfs.

I suspect this somehow might have to do with quarterly updates of FreeBSD packages and/or updating my FreeBSD 13.1 system, although I am not entirely sure.

FreeBSD% tail /var/log/automount.log
(...)
/dev/da0p1: filesystem mount retry: 1/3
/dev/da0p1: filesystem mount retry: 2/3
/dev/da0p1: filesystem mount retry: 3/3
/dev/da0p1: mount FAIL: 'mount_msdosfs -o ro -o longnames -m 775 -M 775 -D cp437 -L en_US.UTF-8 -u 0 -g 0 -o noatime  /dev/da0p1 /media/Ventoy'

Hopefully useful debugging information:

FreeBSD% sudo sh -x /usr/local/sbin/automount da0p1 attach
(...)
+ __check_block_device /dev/da0p1
+ fstyp /dev/da0p1
+ __guess_fs_type /dev/da0p1
+ unset FS_TYPE
+ file -r -b -L -s /dev/da0p1
+ sed -E 's/label:\ \".*\"//g'
+ local 'FS_TYPE=DOS/MBR boot sector'
+ unset FS_TYPE
+ file -k -r -b -L -s /dev/da0p1
+ sed -E 's/label:\ \".*\"//g'
+ local 'FS_TYPE=DOS/MBR boot sector
-  DOS/MBR boot sector
-  DOS/MBR boot sector, ExFAT Filesystem version 1.0, (1<<8) sectors per cluster, sectors 250002056, serial number 0xec092ca6 DOS executable (COM), boot code
- data'
+ return 32
+ FS_TYPE=32
+ OPTS='-o noatime'
+ sysctl -n kern.osrelease
+ LARGE=''
+ FS_CHECK_CMD=fsck_msdosfs
+ FS_CHECK_ARGS='-C -y'
+ FS_MOUNT_CMD=mount_msdosfs
+ FS_MOUNT_ARGS='-o longnames -m 775 -M 775 -D cp437 -L en_US.UTF-8 -u 0 -g 0 -o noatime  /dev/da0p1 /media/Ventoy'
FreeBSD% fstyp /dev/da0p1
exfat
FreeBSD% dd if=/dev/da0p1 conv=sync count=1 bs=1k 2> /dev/null | strings 
EXFAT
vermaden commented 2 years ago

Can you send me the first 1MB of that device?

# dd < /dev/da0 > FILE bs=1m count=1

Thanks.

probonopd commented 2 years ago

Here we go FILE.zip

vermaden commented 2 years ago

Thank You.

I will look into it tomorrow hopefully.

Regards.

lispstudent commented 1 year ago

I am experiencing same issue. I am trying to mount a Sony NW-A105 via USB (exFAT).

It works fine via cli: sudo jmtpfs -o allow_other /media/phone.

vermaden commented 1 year ago

The jmtpfs is used to mount MTP devices - not exFAT devices.

vermaden commented 1 year ago

... and I need to look into that ZIP file ... hopefully sooner then later :)

probonopd commented 1 year ago

Friendly ping @vermaden.

I think somehting is going wrong here:

+ __check_block_device /dev/da0s1
+ fstyp /dev/da0s1
+ __guess_fs_type /dev/da0s1
+ unset FS_TYPE
+ file -r -b -L -s /dev/da0s1
+ sed -E 's/label:\ \".*\"//g'
+ local 'FS_TYPE=DOS/MBR boot sector'
+ unset FS_TYPE
+ file -k -r -b -L -s /dev/da0s1
+ sed -E 's/label:\ \".*\"//g'
+ local 'FS_TYPE=DOS/MBR boot sector
-  DOS/MBR boot sector
-  DOS/MBR boot sector, ExFAT Filesystem version 1.0, (1<<8) sectors per cluster, sectors 121993216, serial number 0xc64b7c5e DOS executable (COM), boot code
- data'
+ return 32
+ FS_TYPE=32
+ OPTS='-o noatime'
+ sysctl -n kern.osrelease
+ LARGE=''
+ FS_CHECK_CMD=fsck_msdosfs
+ FS_CHECK_ARGS='-C -y'
+ FS_MOUNT_CMD=mount_msdosfs
+ FS_MOUNT_ARGS='-o longnames -m 775 -M 775 -D cp437 -L en_US.UTF-8 -u 0 -g 0 -o noatime  /dev/da0s1 /media/Ventoy'

This is what I get when I run the commands manually:

% fstyp /dev/da0s1
exfat

% file -r -b -L -s /dev/da0s1
DOS/MBR boot sector

% file -k -r -b -L -s /dev/da0s1
DOS/MBR boot sector
-  DOS/MBR boot sector
-  DOS/MBR boot sector, ExFAT Filesystem version 1.0, (1<<8) sectors per cluster, sectors 121993216, serial number 0xc64b7c5e DOS executable (COM), boot code
- data
vermaden commented 1 year ago

Sorry for being really late on this one.

Implemented along with several other fixes/features.

Please test:

Regards, vermaden

probonopd commented 1 year ago

Works great for me, thank you very much @vermaden :+1:

vermaden commented 1 year ago

Updated.

Thanks.