Re: Problem mounting new Sandisk 1TB USB drive

From: Polytropon <freebsd_at_edvax.de>
Date: Wed, 10 Jan 2024 22:33:04 UTC
On Wed, 10 Jan 2024 13:03:28 -0700, Gary Aitken wrote:
> The stick has been plugged into an android phone since it was first
> tried on the fbsd and ubuntu systems, before I installed ntfs-3g.
> Mounting it on ubuntu, I see two suspect files, 'Install SanDisk Software.dmg' and 'Install SanDisk Software.exe', plus a pdf that
> says to run the appropriate file to get "valuable software..."
> I'm thinking / hoping neither of those got automagically run, since
> it's never been plugged into a microsoft or mac system.  I've since
> renamed them away.

This observation leads to the following assumption:

The stick is actually pre-formatted with exFAT.

Problem here: exFAT disguises itself as an NTFS partition,
but it does not have NTFS metadata and content, so ntfs-3g
cannot mount it, even though tools like gpart or fdisk
show a NTFS partition.

So here is what you should check:

1. /boot/loader.conf contains:

	fuse_load="YES"

   Reboot if neccessary.

2. Mount device manually, read-only, perform checks, then
   unmount again:

	# mount.exfat -o ro /dev/da0s1 /mnt/memstick
	# df -f /mnt/memstick
	# ls -R /mnt/memstick
	# umount /mnt/memstick

3. Create /etc/fstab entry if desired.

NB: mount.exfat does not have a manpage or help option.

Perform this easily with root privileges, just to make sure
you don't run into any permission problems for files involved.
Also check "dmesg" output in case the system would log a
severe filesystem inconsistency or error that could prevent
mounting.



> However, something, I assume the android phone, automagically set
> up a bunch of directories, which are empty: Android, AudioBooks,
> DCIM, Pictures, Videos, etc.

It wouldn't probably have been able to do this if the
stick was formatted with NTFS...



> Doesn't seem like any of that should have affected the formatting,
> Although at some point after I can get it to mount I'd like to
> know how to prevent the auto directory setup from happening.

Why don't you simply run newfs on the stick, with the
filesystem *you* _want_ to use? You can use UFS it you
want to, works perfectly well. ;-)

The filesystem ot use depends on what you want to use
it for. If data exchange with Android devices is your
goal, you'd probably keep using exFAT...


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...