Unable to mount FAT16 partition (Invalid Argument)

Peter Erickson redlamb19 at gmail.com
Mon Mar 25 11:54:24 UTC 2019


Thanks for the response. I thought the same thing so I tried testing it. 
It appears that mount/mount_msdosfs has no issues mounting a FAT16 
filesystem on a GPT partition. Unfortunately, I'm not sure how good of a 
test it is since the only way I knew to create a FAT16 partition was to 
use FreeBSD.

# dd if=/dev/zero of=msdos_test.dd bs=1M count=300
300+0 records in
300+0 records out
314572800 bytes transferred in 0.487578 secs (645173955 bytes/sec)
# mdconfig -f msdos_test.dd
md0
# gpart create -s GPT md0
md0 created
# gpart add -t ms-basic-data md0
md0p1 added
# newfs_msdos -F 16 /dev/md0p1
newfs_msdos: trim 7 sectors to adjust to a multiple of 9
/dev/md0p1: 614112 sectors in 19191 FAT16 clusters (16384 bytes/cluster)
BytesPerSec=512 SecPerClust=32 ResSectors=1 FATs=2 RootDirEnts=512 
Media=0xf0 FATsecs=75 SecPerTrack=9 Heads=128 HiddenSecs=0 
HugeSectors=614313
# file -s /dev/md0p1
/dev/md0p1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "BSD4.4  ", 
sectors/cluster 32, root entries 512, sectors/FAT 75, sectors/track 9, 
heads 128, sectors 614313 (volumes > 32 MB), serial number 0xe250e15, 
unlabeled, FAT (16 bit)
# mount -t msdosfs /dev/md0p1 /mnt
# df
Filesystem   1K-blocks    Used    Avail Capacity  Mounted on
/dev/ada0s1a  28434140 6778000 19381412    26%    /
devfs                1       1        0   100%    /dev
/dev/md0p1      307088      32   307056     0%    /mnt

On 3/25/19 4:34 AM, Polytropon wrote:
> On Sun, 24 Mar 2019 20:42:30 -0500, Peter Erickson wrote:
>> # mount -t msdosfs /dev/ada1p5 /mnt
>> mount_msdosfs: /dev/ada1p5: Invalid argument
> 
> I have no idea if this applies, but I can imagine that FAT and GPT
> don't work well together. GPT is "too new", and even on "Windows"
> where GPT can be used, NTFS is used instead of FAT16. A FAT filesystem
> is usually created on a DOS primary partition (a slice). A GPT
> partition is something else...
> 
> Sidenote: For testing, always use -o ro or -r to make sure no
> writes are allowed (or tried). Sometimes this allows you to mount
> even damaged file systems. Try one of these:
> 
> 	# mount -t msdosfs -r /dev/ada1p5 /mnt
> 
> 	# mount_msdosfs -o ro /dev/ada1p5 /mnt
> 
> The use of "mount -t msdosfs" and "mount_msdosfs" should be equivalent.
> See "man mount_msdosfs" for details.
> 
> 
> 
>> FWIW, knoppix has no issues mounting the partition, but I'd really be
>> interested in getting this to work on FreeBSD.
>>
>> knoppix # mount | grep /dev/sdb5
>> /dev/sdb5 on /mnt type vfat
>> (rw,relatime,fmask=0022,dmask=0022,codepage=850,iocharset=utf8,shortname=mixed,errors=remount-ro)
>>
>> Based on the info from knoppix, I tried to mount the partition under
>> FreeBSD using mount_msdosfs directly and specifying the locale
>> (en_US.UTF-8) and codepage (CP850) , but the result was the same -
>> "Invalid argument."
> 
> Locale and codepage shouldn't have an effect on the basic mount
> operation. Both are fairly standard and should be covered by the
> defaults anyway.
> 
> 
> 
> 


More information about the freebsd-questions mailing list