Issue with exFAT volume

Hi,

There is an issue when we try to automount an external USB disk which has been formatted as “exFat” under by example “/media/dabou2” as defined within the file “/etc/fstab”.

UUID=6010-1484 /media/dabou2 exfat noatime,lazytime,rw,nofail,noauto,gid=1000,uid=1000,x-systemd.automount

When the machine boots, the volume is not mounted

root@DietPi:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.8G     0  1.8G   0% /dev
tmpfs           380M  8.1M  372M   3% /run
/dev/mmcblk1p1   15G  774M   14G   6% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           1.9G     0  1.9G   0% /tmp
tmpfs            50M  8.0K   50M   1% /var/log
/dev/nvme0n1    916G  168G  702G  20% /media/dabou

Surprisingly, content exists under “/media/dabou2”. Why ? I don t know :frowning:

root@DietPi:~# ls -la /media/dabou2
total 1156
drwxrwxrwx 1 dietpi dietpi 131072 Jan  1  1970 .
drwxr-xr-x 4 root   root     4096 Jan 27 11:04 ..
drwxrwxrwx 1 dietpi dietpi 131072 Jan 21 08:00 Famille
drwxrwxrwx 1 dietpi dietpi 131072 Jan 26 13:28 .fseventsd
drwxrwxrwx 1 dietpi dietpi 131072 Jan 24 16:46 Movies
drwxrwxrwx 1 dietpi dietpi 131072 Jan 25 08:17 Music
-rwxrwxrwx 1 dietpi dietpi    187 Jan 25 17:05 README.txt
drwxrwxrwx 1 dietpi dietpi 131072 Jan 26 15:30 samba
drwxrwxrwx 1 dietpi dietpi 131072 Jan 26 12:09 .Spotlight-V100
drwxrwxrwx 1 dietpi dietpi 131072 Jan 26 13:28 .Trashes

Something else: I can mount it manually but Fuse reports the following warning messages

mount -v -t exfat  /dev/sda2 /media/dabou2
FUSE exfat 1.3.0
WARN: volume was not unmounted cleanly.
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

and mount cmd reports: 

/dev/sda2 on /mnt/dabou-usb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,x-systemd.automount)

The volume seems to be well mounted anyway. Really bizarre

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.8G     0  1.8G   0% /dev
tmpfs           380M  8.1M  372M   3% /run
/dev/mmcblk1p1   15G  774M   14G   6% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           1.9G     0  1.9G   0% /tmp
tmpfs            50M  8.0K   50M   1% /var/log
/dev/nvme0n1    916G  168G  702G  20% /media/dabou
/dev/sda2       1.9T  185G  1.7T  10% /media/dabou2

Do you know how we could fix that ?

Cheers

Charles

this is working as expected. You specified mount option x-systemd.automount, which is recommended for external HDD to avoid your system being stuck on boot as some HDD take time to spin up.

Means, the device is not mounted during boot but as soon you going to access it. That’s exactly as you describe below.

  • Device not visible right after reboot
  • device got mounted as you did an ls -la
  • that’s why it is visible on following df

False, the volume is only mounted if I do

mount -v -t exfat  /dev/sda2 /media/dabou2

and then we will see it using “df -h”

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.8G     0  1.8G   0% /dev
tmpfs           380M  8.1M  372M   3% /run
/dev/mmcblk1p1   15G  774M   14G   6% /
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           1.9G     0  1.9G   0% /tmp
tmpfs            50M  8.0K   50M   1% /var/log
/dev/nvme0n1    916G  168G  702G  20% /media/dabou
/dev/sda2       1.9T  185G  1.7T  10% /media/dabou2

BTW, the NVMe SSD disk (= ext4 format - /dev/nvme0n1 ) is automounted automatically when dietpi boots according to this fstab definition “UUID=2e0b34b5-bdd1-4f5d-bc7c-8af0fb1879c0 /media/dabou ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount”.

So, I still dont understand why an external disk is not automouneted automatically as NVMe SSD ? Is is an issue with the Fuse extFAT format as during mount it reports → see:

FUSE exfat 1.3.0
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

did you tried reboot and afterwards ls -la /media/dabou2. Does it show anything?

ls -la /media/dabou2 shows the content of the volume but df -h like mount commands don t show that the volume is mounted :frowning:

A temporary workaround is to configure /etc/fstab like this

UUID=6010-1484 /media/dabou2 exfat noatime,lazytime,rw,nofail,auto,gid=1000,uid=1000,umask=000

After rebooting dietpi, then “df- h” and “mount” shows that the volume of the external USB disk has been mounted.

did you checked df after you have executed ls?

Yes. hmhmhm. If I execute several times the command df -h every 2s, then after a few moments, I will see the volume mounted :slight_smile:

Question: Why “df -h” and “mount” shows later than “ls -la /my/volume/mounted” that the volume is mounted ?

not sure why it takes time to show up on df. Most important to have the content displayed correctly.

This problem is really weird and it also occurs, even if we have rebooted the machine long time ago. I executed the command mount or df -h randomly this afternoon and sometimes I saw the mounted volume, sometimes not. Really strange :cry: