Solved Cannot mount FAT32 msdosfs USB disk

Hi,
I am new to FreeBSD and use it at work. We use a stripped version of FreeBSD11.4-RELEASE (the person that stripped it is not around) and so, do not hesitate to tell me what "might" be missing or what "might" be different in our stripped version.

I need to mount a FAT32 usb stick.
The device's and it's partition is automatically present when plugged, in /dev/da0 and the partition /dev/da0s1 and even present here /dev/msosfs/[partition name].

While using mount_msdosfs(8) or mount(2) with -t msdosfs (which is the same thing if I understand correctly), I get this error output:
mount_msdosfs: /dev/da0s1: Operation not supported on device

I have tried with different FAT32 formatting from Windows and Ubuntu, nothing changed.
I have tried it on a virtual machine from the original FreeBSD11.3-STABLE and there it's working perfectly fine.
Do you have any ideas what is missing/wrong about our FreeBSD installation/compilation ?

More info about the partition in question:
Code:
# file -s /dev/da0s1
/dev/da0s1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "MSDOS5.0", sectors/cluster 16, reserved sectors 4598, Media descriptor 0xf8, sectors/track 63, heads 255, hidden sectors 2048, sectors 20480000 (volumes > 32 MB), FAT (32 bit), sectors/FAT 9989, reserved 0x1, serial number 0x8c6dae87, unlabeled

Thanks in advance for your response.
 
We use a stripped version of FreeBSD11.4-RELEASE (the person that stripped it is not around) and so, do not hesitate to tell me what "might" be missing or what "might" be different in our stripped version.
The biggest thing you're "missing" is the fact that 11.4 has been end-of-life for quite some time. The entire 11 branch is end-of-life, the entire 12 branch is end-of-life too. So you're massively behind.

 
Yes you are right and it's a problem. We are in the process of updating our equipment. This FreeBSD version is used on embedded hardware. We cannot ask for every client to send back their equipment to reboot it and update it in the process. I do not know how I can ask some help. I totally understand we are behind but it's not a choice I have.
 
You cannot mount a slice. Look well at the gpart show -p output and you will see a letter at the end of the partition name.
 
You cannot mount a slice. Look well at the gpart show -p output and you will see a letter at the end of the partition name.
Could you describe more about what you are referring to ? slice ? letter ?

This is the output I got for gpart show -p:
Code:
...
=>       63  120164289    da0  MBR  (57G)
         63       1985         - free -  (993K)
       2048   20480000  da0s1  fat32lba  (9.8G)
   20482048   99682304         - free -  (48G)
 
Hi,
I am new to FreeBSD and use it at work. We use a stripped version of FreeBSD11.4-RELEASE (the person that stripped it is not around) and so, do not hesitate to tell me what "might" be missing or what "might" be different in our stripped version.

I need to mount a FAT32 usb stick.
The device's and it's partition is automatically present when plugged, in /dev/da0 and the partition /dev/da0s1 and even present here /dev/msosfs/[partition name].

While using mount_msdosfs(8) or mount(2) with -t msdosfs (which is the same thing if I understand correctly), I get this error output:
mount_msdosfs: /dev/da0s1: Operation not supported on device

I have tried with different FAT32 formatting from Windows and Ubuntu, nothing changed.
I have tried it on a virtual machine from the original FreeBSD11.3-STABLE and there it's working perfectly fine.
Do you have any ideas what is missing/wrong about our FreeBSD installation/compilation ?

More info about the partition in question:
Code:
# file -s /dev/da0s1
/dev/da0s1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "MSDOS5.0", sectors/cluster 16, reserved sectors 4598, Media descriptor 0xf8, sectors/track 63, heads 255, hidden sectors 2048, sectors 20480000 (volumes > 32 MB), FAT (32 bit), sectors/FAT 9989, reserved 0x1, serial number 0x8c6dae87, unlabeled

Thanks in advance for your response.
Simple and dumb question.
Is the partition actually formatted? Isn't it just a partition (in FreeBSD world, slice for MBR scheme) is created?
Maybe the partition goes into /dev/msdosfs/ if it has any of proper *FAT* partition type.
 
I finally found the problem. As said in my original post, we stripped a FreeBSD version.
Hardened for security and light because embedded in specific hardware.
The USB stick partition was totally fine and well formatted, it was not the issue.

For mount_msdosfs(8) to run properly, it needs /boot/kernel/msdosfs.ko and /boot/kernel/msdosfs_iconv.ko.
Check if your system have them installed and activated.


Those file were stripped because not used for our needs.
Even if you compiled the FreeBSD kernel with mount_msdosfs.c like me, the commands mount -t msdosf or mount_msdosfs will not check for the missing kernel modules, thus not return an error about it.

The good thing is, since those are.ko (kernel modules) files, you don't have to recompile the kernel to add them.
If you run in the same situation, you will need to reinstall your FreeBSD boot partition because the /boot/kernel directory may be read only even as root.
 
the commands mount -t msdosf or mount_msdosfs will not check for the missing kernel modules, thus not return an error about it
Are you sure?
I am quite certain that there would be something logged by kernel in /var/log/messages and dmesg.
 
Back
Top