How do I disable automount of USB disks?

I need stable mount paths. Bonus points for excluding disks by UUID.

The built-ingl_nas_diskmanager mounts partitions under /tmp/mountd/diskX_partY, but with more than one disk, this is non-deterministic - the disk numbers are free to change at boot time. This is the reason no one should use the old /dev/sdX paths any more either - the only safe method is to rely on UUIDs or stable device identifiers (e.g. /dev/disk/by-id and friends on modern udev, but these are absent on openwrt, so UUIDs it is).

I added an fstab entry to /etc/config/fstab via UUID and the specific partition I need to mount mounts at the correct mountpoint, however gl_nas_diskmanager appears to do zero checks for whether a disk is mounted or owned by block-mount, and so it also mounts the disk under /tmp/mountd, which is a straight path to data corruption - I’m kind of shocked this was not prevented by the kernel, but I have no idea what the gl_nas_diskmanager binary blob is doing.

If /etc/init.d/gl_nas_diskmanager exists, disable the GL.iNet automounter and reboot so the UUID-based fstab entry is the only mount mechanism:

/etc/init.d/gl_nas_diskmanager stop
/etc/init.d/gl_nas_diskmanager disable
reboot

After reboot, verify with mount or block info that each partition is mounted only once at the configured path. Disabling this service may prevent the GL.iNet Network Storage page and its managed Samba/WebDAV/DLNA shares from detecting disks. To revert:

/etc/init.d/gl_nas_diskmanager enable
/etc/init.d/gl_nas_diskmanager start

I am not aware of a documented gl_nas_diskmanager option for excluding selected UUIDs. Please provide the router model and exact firmware version before applying this permanently, because the NAS service arrangement can differ between firmware branches and upgrades may restore its defaults.

This reply was generated by AI. Please verify its accuracy.

GL.iNet Technical Support reviews and responds to relevant threads on business days. Please allow time for a staff response.

This functions as a work-around, but would be nice if the application was smarter and/or more correct in its behaviour.

I spoke too soon - after a short time, even with /etc/init.d/gl_nas_diskmanager disabled, the disk is again mounted under /tmp/mound even though it was already mounted elsewhere. This is extremely likely to cause disk corruption.

Disabling the init script is not sufficient if another NAS component or hotplug handler starts the automounter again. Before disabling additional services, capture which component is active immediately after the second mount appears:

block info
findmnt -rn -o SOURCE,TARGET,FSTYPE,OPTIONS
pgrep -af 'gl_nas|mountd|blockd'
logread | grep -Ei 'gl_nas|mountd|diskmanager|blockd|mount'

Please post those outputs with the router model and exact firmware version, redacting anything unrelated. This will distinguish a true second filesystem mount from an additional bind/alias mount and identify whether gl_nas_diskmanager, another GL.iNet NAS service, or OpenWrt hotplug created it. Until then, avoid writing through both paths; unmount the unwanted /tmp/mountd/... path before use.

This reply was generated by AI. Please verify its accuracy.

GL.iNet Technical Support reviews and responds to relevant threads on business days. Please allow time for a staff response.

root@moat:~# block info
/dev/sda1: UUID="bdde1e3a-ffab-4dbc-a02a-8afccc85e4fa" LABEL="moat-external" VERSION="1.0" MOUNT="/mnt/docker" TYPE="ext4"
root@moat:~# findmnt -rn -o SOURCE,TARGET,FSTYPE,OPTIONS
-ash: findmnt: not found
root@moat:~# pgrep -af 'gl_nas|mountd|blockd'
15605 /usr/bin/gl_nas_sys
20691 /usr/bin/gl_nas_diskmanager -e
root@moat:~# logread | grep -Ei 'gl_nas|mountd|diskmanager|blockd|mount'
Fri Oct  2 01:28:45 2026 user.notice ucitrack: Setting up non-init /etc/config/fstab reload handler: /sbin/block mount
Fri Oct  2 01:28:54 2026 daemon.notice procd: /etc/rc.d/S97gl_nas_sys: Command failed: ubus call service delete { "name": "samba4" } (Not found)
Fri Oct  2 01:29:02 2026 daemon.notice procd: /etc/rc.d/S99gl_nas_sys_dl: start app = /usr/bin/gl_nas_sys
Fri Oct  2 01:29:02 2026 daemon.notice procd: /etc/rc.d/S99gl_nas_sys_dl: === nas enable
Fri Oct  2 01:29:02 2026 daemon.notice procd: /etc/rc.d/S99gl_nas_sys_up: start app = /usr/bin/gl_nas_sys
Fri Oct  2 01:29:02 2026 daemon.notice procd: /etc/rc.d/S99gl_nas_sys_up: === nas enable
root@moat:~# mount
/dev/root on /rom type squashfs (ro,relatime,errors=continue)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/loop0 on /overlay type f2fs (rw,lazytime,noatime,background_gc=on,nogc_merge,discard,discard_unit=block,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,extent_cache,mode=adaptive,active_logs=6,alloc_mode=default,checkpoint_merge,fsync_mode=posix,memory=normal,errors=continue)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work,xino=off)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,noatime)
bpffs on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,noatime)
/dev/sda1 on /mnt/docker type ext4 (rw,relatime)
/dev/sda1 on /tmp/mountd/disk2_part1 type ext4 (rw,relatime)

Router: Flint 4 GL.iNet GL-BE14000
Firmware: be14000-4.11.0_beta1-1103-0924-1790247785.bin

The output confirms a genuine second mount, and gl_nas_diskmanager -e has been restarted despite its own init script being disabled. The boot log indicates that gl_nas_sys_dl and gl_nas_sys_up start /usr/bin/gl_nas_sys, which is the likely supervisor launching the disk manager.

If you do not need GL.iNet Network Storage, disable the complete NAS service group:

for s in gl_nas_sys_dl gl_nas_sys_up gl_nas_sys gl_nas_diskmanager; do
    [ -x "/etc/init.d/$s" ] && /etc/init.d/$s stop
    [ -x "/etc/init.d/$s" ] && /etc/init.d/$s disable
done

pgrep -af 'gl_nas|mountd'
umount /tmp/mountd/disk2_part1
reboot

After reboot, confirm that pgrep shows no GL NAS processes and that mount lists /dev/sda1 only at /mnt/docker. This disables GL.iNet-managed Samba/WebDAV/DLNA and the Network Storage interface. Mounting the same filesystem twice does not by itself prove corruption, but avoiding writes through both paths is prudent. Since this is Flint 4 beta firmware 4.11.0 beta1, the NAS supervisor ignoring the separately disabled disk-manager service should also be reviewed by GL.iNet staff.

This reply was generated by AI. Please verify its accuracy.

GL.iNet Technical Support reviews and responds to relevant threads on business days. Please allow time for a staff response.

It seems that accessing the UI for the “Network Storage” application automatically forces the service back to enabled:

```
root@moat:~# for s in gl_nas_sys_dl gl_nas_sys_up gl_nas_sys gl_nas_diskmanager; do echo $s ; /etc/init.d/$s status ; done
gl_nas_sys_dl
inactive
gl_nas_sys_up
inactive
gl_nas_sys
running
gl_nas_diskmanager
Syntax: /etc/init.d/gl_nas_diskmanager [command]

Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if service does not implement reload)
enable Enable service autostart
disable Disable service autostart
enabled Check if service is started on boot
```

This confirms that opening Network Storage starts gl_nas_sys on demand; it does not necessarily re-enable boot autostart. The inactive gl_nas_sys_dl/gl_nas_sys_up services alongside a running gl_nas_sys process indicate that the UI/API launched it directly. The disk-manager script simply does not implement status.

For now, avoid opening the Network Storage page when using UUID-based manual mounts. If it has been opened, stop the NAS processes before removing the duplicate mount:

/etc/init.d/gl_nas_sys stop
/etc/init.d/gl_nas_diskmanager stop
pgrep -af 'gl_nas|mountd'
umount /tmp/mountd/disk2_part1

Verify the target with mount before unmounting because the diskX_partY number can change. On Flint 4 firmware 4.11.0 beta1, the UI starting an automounter that mounts an already-mounted filesystem should be reviewed by GL.iNet staff; disabling init autostart alone cannot prevent an explicit UI/API launch.

This reply was generated by AI. Please verify its accuracy.

GL.iNet Technical Support reviews and responds to relevant threads on business days. Please allow time for a staff response.