# fstab entry not being unmounted during shutdown



## Cinolt (Dec 7, 2016)

My exfat filesystem is not being umount'd properly during shutdown/reboot.

Here is my fstab:

```
# Device     Mountpoint FStype Options Dump Pass#
/dev/ada0s3a /          ufs    rw      1    1
/dev/ada0s3b none       swap   sw      0    0
/dev/ada0s5  /archive   none   rw,mountprog=/usr/local/sbin/mount.exfat 0 0
```
It mounts properly during boot, but when I reboot, I get this message:


```
Dec  6 22:23:58 cinofbsd kernel: Starting file system checks:
Dec  6 22:23:58 cinofbsd kernel: /dev/ada0s3a: FILE SYSTEM CLEAN; SKIPPING CHECKS
Dec  6 22:23:58 cinofbsd kernel: /dev/ada0s3a: clean, 59234518 free (4022 frags, 7403812 blocks, 0.0% fragmentation)
Dec  6 22:23:58 cinofbsd kernel: Mounting local filesystems:
Dec  6 22:23:58 cinofbsd kernel: FUSE exfat 1.2.4
Dec  6 22:23:58 cinofbsd kernel: WARN: volume was not unmounted cleanly.
Dec  6 22:23:58 cinofbsd kernel: .
```
Note how the first two filesystems are CLEAN, yet the exfat fs is not unmounted properly during shutdown.

Any ideas as to how I can make FreeBSD unmount this fs properly?

EDIT: Also note that if I manually umount the fs before rebooting, the warning does not appear. Also, 'umount -a' unmounts the exfat fs, so for some reason the shutdown scripts are not recognizing my exfat fs as something to umount.


----------



## sidetone (Dec 14, 2016)

On fstype you have none, can that be msdosfs, instead of mountprog and exfat? Shouldn't you have 2 and 2 for Dump and Pass?

If your documentation says those settings are right, maybe it's that program's settings in /usr/local/etc/.


----------



## Cinolt (Dec 14, 2016)

msdosfs does not handle ExFAT filesystems, for instance:

```
# mount -t msdosfs /dev/ada0s5 /mnt
mount_msdosfs: /dev/ada0s5: Invalid argument
```
Also, if I put 2 in for Pass# in fstab the system fails to boot because there is no command called fsck_none (it's trying to call fsck on the type, in this case none).

```
# pkg info -l fusefs-exfat
fusefs-exfat-1.2.4:
   /usr/local/man/man8/mount.exfat-fuse.8.gz
   /usr/local/sbin/mount.exfat
   /usr/local/sbin/mount.exfat-fuse
   /usr/local/share/licenses/fusefs-exfat-1.2.4/GPLv2+
   /usr/local/share/licenses/fusefs-exfat-1.2.4/LICENSE
   /usr/local/share/licenses/fusefs-exfat-1.2.4/MSPAT
   /usr/local/share/licenses/fusefs-exfat-1.2.4/catalog.mk
```
The package does not provide a fsck program.

So, the only solution for now is to umount the filesystem in rc.shutdown (though I kind of think it would be sensible for FreeBSD to do this by default, but oh well)


----------



## kpa (Dec 14, 2016)

I believe this is a bug in umount(8), it should handle any mounted filesystem listed in fstab(5) if invoked as `umount -a` even if the filesystem type is set to none.


----------



## Cinolt (Dec 14, 2016)

To clarify, `umount -a` *does* unmount the exfat FS; it's just that rc.shutdown does not call `umount -a` or anything to that effect, but it appears to be fine if I just add it in manually.

The only lingering thought is why FreeBSD does not do that by default.


----------

