This article describes how to mount an USB storage device in OpenWRT.
Go to all articles of this series and the description of the test setup:

To mount a USB device in OpenWRT follow these steps:
➡ https://openwrt.org/docs/guide-user/storage/usb-drives
The software packages need to be installed on the device:
opkg install block-mount kmod-usb-storage usbutils libblkid gdisk
After the installation a new menu appears System --> Mount Points
. If the menu is not displayed just reboot OpenWRT.
reboot
After the reboot login via LuCi.

Attach your USB storage device to your OpenWRT device.
Click Edit
.

The mount point needs to be added via custom field. It is not listed in the drop down menu.
Configuration In LuCi
General Settings
Select your USB storage device from the drop down.

Click int to --cutom--
field

Enter the mount point of the USB storage device manually. The root directory is /mnt
.

Click Save
.

The USB storage device can get mounted by OpenWRT. Click Enabled
and Save & Apply
the changes.

On the CLI you can check if the USB storage device is mounted.
Gib mir gerne einen Kaffee ☕ aus!
Wenn dir meine Beiträge gefallen und geholfen haben, dann kannst du mir gerne einen Kaffee ☕ ausgeben.
bc1qfuz93hw2fhdvfuxf6mlxlk8zdadvnktppkzqzj
root@OpenWrt:~# cd /mnt/
root@OpenWrt:/mnt# ls -lah
drwxr-xr-x 1 root root 0 Nov 30 10:22 .
drwxr-xr-x 1 root root 0 Nov 30 08:29 ..
drwxr-xr-x 2 root root 0 Nov 30 10:22 sda1
Advanced Settings

Configuration on CLI
On the CLI the configuration looks as following:
root@OpenWrt:~# ls -l /dev/sd*
brw------- 1 root root 8, 0 Nov 23 12:20 /dev/sda
brw------- 1 root root 8, 1 Nov 23 12:20 /dev/sda1
root@OpenWrt:~# block info | grep "/dev/sd"
/dev/sda1: UUID="637E-0193" LABEL="usb-drive" TYPE="exfat"
root@OpenWrt:~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
# Generate a config entry for the fstab file:
root@OpenWrt:~# block detect | uci import fstab
# Now enable automount on that config entry:
root@OpenWrt:~# uci set fstab.@mount[-1].enabled='1'
root@OpenWrt:~# uci commit fstab
# uci show fstab
root@OpenWrt:~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].target='/mnt/sda1'
fstab.@mount[0].uuid='637E-0193'
fstab.@mount[0].enabled='1'
# Show mount point details
root@OpenWrt:~# ls -l /mnt/sda1
root@OpenWrt:~# block info
/dev/mtdblock13: UUID="9b0b81c6-8dfd6cb8-6b633c0f-b2292799" VERSION="4.0" MOUNT="/rom" TYPE="squashfs"
/dev/mtdblock14: MOUNT="/overlay" TYPE="jffs2"
/dev/mtdblock15: TYPE="jffs2"
/dev/sda1: UUID="637E-0193" LABEL="usb-drive" TYPE="exfat"
# Restart service fstab
root@OpenWrt:~# service fstab boot
Prepare USB Storage
Start disk utility program

Click on Delete

Select ExFAT
and click on Delete

Eject the storage device.

Attach the usb storage device to OpenWRT and follow the steps described above.
See all articles of this series …

… on strobelstefan.de
➡ Overview of all OpenWRT Articles/

… on codeberg.org
➡ see manual on codeberg.org
Gib mir gerne einen Kaffee ☕ aus!
Wenn dir meine Beiträge gefallen und geholfen haben, dann kannst du mir gerne einen Kaffee ☕ ausgeben.
bc1qfuz93hw2fhdvfuxf6mlxlk8zdadvnktppkzqzj
Source:
– https://openwrt.org/
– Official OpenWRT Logo – https://openwrt.org/_media/docs/guide-graphic-designer/openwrt-logo-usage-guidelines.pdf

ist absolut technik-begeistert und großer Fan von Linux und Open Source. Raspberry Pi Bastler der ersten Stunde und nach wie vor begeistert von dem kleinen Stück Hardware, auf dem er tolle Projekte umsetzt. Teilt hier seine Erfahrungen mit Nextcloud, Pi-hole, YubiKey, Synology und openmediavault und anderen spannenden IT-Themen. Nutzt Markdown und LaTeX zum Dokumentieren seiner Projekte und Gitea zum Versionieren. Sitzt vor einem 49“ Monitor, nutzt Windows und MacOS zum Arbeiten, Linux auf seinen Servern und virtuellen Maschinen und hört dabei Spotify und MP3s und Radio-Streams über seinen RadioPi.