Problems mounting usb flash-drive

umount -v -t msdosfs /dev/da0s1 /media/da0s1
Why all the parameters on umount?

It looks like that device mounts correctly, are you asking why it doesn't unmount correctly?
If gpart shows a partition that is a dos fs, when it gets plugged in you wind up with /dev/da0s1. One
can also format the raw device so you only wind up with /dev/da0.
I have these lines in my /etc/fstab to make it a little simpler.
/dev/da0s1 /flash msdosfs rw,noauto 0 0 /dev/da0 /flash1 msdosfs rw,noauto 0 0

Then as root I simply "mount /flash1" (or /flash depending on what ls -ltr /dev/da0* says), do what I need to, then
I do umount /flash1 to unmount it.

A quick "man umount" n shows that "-t" is for type to unmount, but it looks like your syntax is wrong based on man page.
If it mounts successfully, then try
umount /dev/da0s1
or
umount /media/da0s1
or if it is the only msdosfs mounted try
umount -t msdosfs
 
Why all the parameters on umount?

It looks like that device mounts correctly, are you asking why it doesn't unmount correctly?
If gpart shows a partition that is a dos fs, when it gets plugged in you wind up with /dev/da0s1. One
can also format the raw device so you only wind up with /dev/da0.
I have these lines in my /etc/fstab to make it a little simpler.
/dev/da0s1 /flash msdosfs rw,noauto 0 0 /dev/da0 /flash1 msdosfs rw,noauto 0 0

Then as root I simply "mount /flash1" (or /flash depending on what ls -ltr /dev/da0* says), do what I need to, then
I do umount /flash1 to unmount it.

A quick "man umount" n shows that "-t" is for type to unmount, but it looks like your syntax is wrong based on man page.
If it mounts successfully, then try
umount /dev/da0s1
or
umount /media/da0s1
or if it is the only msdosfs mounted try
umount -t msdosfs

Code:
root@ozzie:~ # umount /dev/da0s1
umount: /dev/da0s1: unknown file system
root@ozzie:~ # umount /media/da0s1
umount: /media/da0s1: not a file system root directory
root@ozzie:~ # umount -t msdosfs
usage: umount [-fNnv] special ... | node ... | fsid ...
       umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]
 
Ok, so that supports my statement "problem unmounting, not mounting", correct?
When you mount it, can you access the device, list contents, add files, delete files? Note you may need to be root to do so.
After entering the mount command for da0s1, what does the command "mount" without any arguments show? Does it
actually show /dev/da0s1 mounted?
I know you show output of dmesg earlier, but to double check:
after the device is inserted, if you do "ls -ltr /dev/da*" is shows /dev/da0s1, yes?

Also, have you tried physically different devices? If so, none of them work?
 
Ok, so that supports my statement "problem unmounting, not mounting", correct?
When you mount it, can you access the device, list contents, add files, delete files? Note you may need to be root to do so.
After entering the mount command for da0s1, what does the command "mount" without any arguments show? Does it
actually show /dev/da0s1 mounted?
I know you show output of dmesg earlier, but to double check:
after the device is inserted, if you do "ls -ltr /dev/da*" is shows /dev/da0s1, yes?

Also, have you tried physically different devices? If so, none of them work?

Code:
root@ozzie:~ # mount -t msdosfs /dev/da0s1 /media/da0s1
root@ozzie:~ # mount
/dev/ada0s1a on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
/dev/da0s1 on /media/da0s1 (msdosfs, local)

Code:
root@ozzie:~ # ls -ltr /dev/da*
crw-r-----  1 root  operator  0x7a Mar 24 14:51 /dev/da0s1
crw-r-----  1 root  operator  0x79 Mar 24 14:51 /dev/da0

I haven't tried on other devices. The usb key is connected and ostensibly has files on it that I want it to have on it. But if I remove it without it dismounted properly, they might vanish. Yes, I could probably just unplug it, then if the files vanish, put them back on if no other solutions are suggested. My attitude just now is more that of a curious detective than a desperate/frustrated person pulling their hair out :-) ..though that person is in there to.. ..hehe.. ;-)
 
My attitude just now is more that of a curious detective than a desperate/frustrated person pulling their hair out :) ..though that person is in there to.. ..hehe.. ;-)
I'd have about 5 secs of hair pulling....

As for the files vanishing, etc. If you haven't actually written anything to device in a while (5 minutes would be 100's of years) they shouldn't vanish. Even after you unmount an USB device it may take a few secs (5 or so) to completely flush writes to the device. I typically do the umount command then wait a minute or so after it completes.

If you have enough space on your hard drive, I would create a temp directory and then copy the files from usb to the hard drive. That way you could actually verify the contents.

If the contents check out, then you don't need to worry about corrupting the USB device.

Just another couple questions:
you did a "mkdir /media/da0s1" at some point, yes? I think I saw that on one of the previous pages, just don't want to look.
Are you running a desktop environment of any kind, with maybe a file manager? Reason is sometimes they try to automount devices and
maybe causing issues.
 
Problems mounting usb flash-drive

Code:
root@ozzie:~ # mount -t msdosfs /dev/da0s1 /media/da0s1
root@ozzie:~ # mount
/dev/ada0s1a on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs, local, multilabel)
/dev/da0s1 on /media/da0s1 (msdosfs, local)

So, mount(8) is no longer a problem.

… if I remove it without it dismounted properly, they might vanish. …

When you next mount, you can:

mount_msdosfs -o sync /dev/da0s1 /media/da0s1

mount_msdosfs(8)

If -o sync is not specified at mount time, then you can sync at any time.

sync(8)
 
I'd have about 5 secs of hair pulling....

As for the files vanishing, etc. If you haven't actually written anything to device in a while (5 minutes would be 100's of years) they shouldn't vanish. Even after you unmount an USB device it may take a few secs (5 or so) to completely flush writes to the device. I typically do the umount command then wait a minute or so after it completes.

If you have enough space on your hard drive, I would create a temp directory and then copy the files from usb to the hard drive. That way you could actually verify the contents.

If the contents check out, then you don't need to worry about corrupting the USB device.

Just another couple questions:
you did a "mkdir /media/da0s1" at some point, yes? I think I saw that on one of the previous pages, just don't want to look.
Are you running a desktop environment of any kind, with maybe a file manager? Reason is sometimes they try to automount devices and
maybe causing issues.
well, tried this. created a new directory for files brought -back- from the usb. it started copying fine, but it said it would take an hour, so I stopped it. I figured it was obvious the files were there, no? well, I went ahead and took out the usb. plug it back in.. files gone. this is checking it with thunar because.. why not? it seems to be the default for freebsd. ..I'm using the xfce desktop, because.. it worked. I can still copy them back over again, but it'll probably take that hour all over again, and the biggest files weren't copied. trying the solutions of others now..
 
mount: /media/usb: No such file or directory

BTW, i think that /media directory is something from ports. The typically /mnt directory exists by default.

So it (*can) be mount -t msdosfs /dev/da0s1 /mnt.

*It doesn't matter in the functionality where you mount it, only the directory have to exist.
 
well, tried this. created a new directory for files brought -back- from the usb. it started copying fine, but it said it would take an hour, so I stopped it. I figured it was obvious the files were there, no? well, I went ahead and took out the usb. plug it back in.. files gone. this is checking it with thunar because.. why not? it seems to be the default for freebsd. ..I'm using the xfce desktop, because.. it worked. I can still copy them back over again, but it'll probably take that hour all over again, and the biggest files weren't copied. trying the solutions of others now..
well, now I know why not to use thunar, or rather, to trust it. I use the mount command suggested by grahamperrin, and lo and behold, the files appear! (both in command line, -and- in thunar!) -ok, will get back to this later..
 
mikethe1wheelnut
Sometimes things like Thunar and other file managers do "automount" stuff. Basically if you browse to the directory, they mount it, otherwise they don't.
That's why I have entries in /etc/fstab and have a term window open to do mount and umount commands.

fun stuff, eh?
 
well, tried unmounting again, this time using -o ..

Code:
root@ozzie:~ # mount_msdosfs -o sync /dev/da0s1 /media/da0s1
root@ozzie:~ # umount_msdosfs -o sync /dev/da0s1 /media/da0s1
umount_msdosfs: Command not found.
root@ozzie:~ # umount
usage: umount [-fNnv] special ... | node ... | fsid ...
       umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]
root@ozzie:~ # umount -o sync /dev/da0s1 /media/da0s1
umount: illegal option -- o
usage: umount [-fNnv] special ... | node ... | fsid ...
       umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]
root@ozzie:~ # umount sync /dev/da0s1 /media/da0s1
umount: sync: statfs: No such file or directory
umount: sync: unknown file system
umount: unmount of /media/da0s1 failed: Device busy
umount: unmount of /media/da0s1 failed: Device busy
root@ozzie:~ # umount sync /dev/da0s1 /media/da0s1
umount: sync: statfs: No such file or directory
umount: sync: unknown file system
umount: unmount of /media/da0s1 failed: Device busy
umount: unmount of /media/da0s1 failed: Device busy
root@ozzie:~ # umount /dev/da0s1 /media/da0s1
umount: unmount of /media/da0s1 failed: Device busy
umount: unmount of /media/da0s1 failed: Device busy
root@ozzie:~ # umount  /media/da0s1
umount: unmount of /media/da0s1 failed: Device busy
root@ozzie:~ # umount /dev/da0s1 
umount: unmount of /media/da0s1 failed: Device busy
those last "Device busy" errors occurred after I closed thunar..
 
BTW, i think that /media directory is something from ports. The typically /mnt directory exists by default.

So it (*can) be mount -t msdosfs /dev/da0s1 /mnt.

*It doesn't matter in the functionality where you mount it, only the directory have to exist.
well, this is encouraging:
Code:
root@ozzie:~ # mount -t msdosfs /dev/da0s1 /mnt
root@ozzie:~ # umount -t msdosfs /dev/da0s1
root@ozzie:~ #
..my understanding now is that to get the big file saved, I have to put an exFAT file system on the usb key.. (..I find this surprising, that freebsd can't save large files "by default" to such a key..)
 
… "Device busy" errors occurred after I closed thunar.

If there's no visible reason for prevention of unmount, try killing gvfsd-trash. It's not recommended, but re: <https://forums.freebsd.org/posts/545125> I sometimes choose to kill when it's troublesome with ZFS. (Troublesome also with some other types of file system? I don't know.)

Thunar​


A notification from Thunar to not remove the media or disconnect the drive persists long after unmount by Thunar:

1648336237410.png

– and so on:

2022-03-26 23-16 Thunar.gif
 
The limit of FAT32 (known as msdosfs on FreeBSD) is 4 GB.

To omit that limitation exFAT was created.

Could somebody please confirm that you can't format a usb-key with exFAT using FreeBSD? I have searched and found nothing. Seems you have to use either windows or linux, then install separate software on FreeBSD in order to read it. Could be useful for future visitors to this thread to have this confirmed yay or nay. :-)
 
Could somebody please confirm that you can't format a usb-key with exFAT using FreeBSD? …

Not so.

I created an ms-basic-data partition on a hard disk drive, created an exFAT file system in the partition, used mount.exfat-fuse(8) to mount the file system, …

The screenshot there showed mkexfatfs.

Code:
% pkg provides mkexfatfs             
Name    : exfat-utils-1.3.0
Desc    : Utilities to create, check, label and dump exFAT filesystem
Repo    : FreeBSD
Filename: usr/local/sbin/mkexfatfs
usr/local/man/man8/mkexfatfs.8.gz
% pkg search -o exfat-utils
sysutils/exfat-utils           Utilities to create, check, label and dump exFAT filesystem
%

sysutils/exfat-utils
 
Back
Top