Mounting a USB stick in FreeBSD

When mounting a USB stick or pen drive on a FreeBSD machine I always issue the following command:

mount -t msdosfs /dev/da0s1 /mnt

Something I have always wondered is what the option msdosfs stands for and more importantly, why it is necessary.

The "-t msdosfs" option specifies what the filesystem is on the USB stick, reformatting the system to something that supports full Unix attributes like ext3 would be better unless the USB stick is used to transfer files to and from a Windows machine.

  • msdosfs is the type of the filesystem ;

  • ms = microsoft

  • dos = disk operating system

  • fs = filesystem

  • and the "-t" flag is necessary for the o.s. to know how to interpret the control data on the beginning of the disk ;

good luck, and success !

alexandre botao
Alexandre V. R. Botao | Unix, C/C++, Shell, LDAP, SSL/TLS, SSH, Perl, Java, Python, Security, ...

@botao: I understand the acronym behind msdosfs and the fact that "-t" is required as an option for its suffix; my question was rather what the background is of this option, since it should be immaterial what operating system is used to transfer files between. Moreover, I regularly need to dos2unix files coming from USB sticks from Windows machines anyway, so the option seems so superfluous.

dos2unix(1) only tranlates carriage return + linefeed (Dos/Windows end of line) to linefeed only (Unix and MAC end of line), it does nothing with filesystems.

Windows cannot mount or read Unix filesystems unless it has had a utility installed to enable it to do so, so a USB stick to be used to transfer files between Windows and Unix is best formatted with a NTFS, FAT32 or DOS filesystem which both Linux and Windows can mount and read.

That makes sense, thank you for your response.

Should use vfat filesystem

@chompy: thanks, i will try that too.