Questions about adding USB devices to OpenWrt

I am using OpenWrt for the first time, and according to the help file I installed a USB stick

/mnt/sda1 is the partition of the USB stick that you get after following the help document. But I've seen other articles on the web and it has one more step than the official documentation, to set the mount point for the USB device partition, the command as follows.

mkdir /mnt/usb && mount /mnt/sda1 /mnt/usb

I don't understand, /mnt/sda1 Isn't it a mount point? The test can read the file, so why do I need to create a separate directory to set the mount point?

Is this step necessary? Or what are the benefits of doing so? Which is the standard normative usage?


mkdir /mnt/usb && mount /dev/sda1 /mnt/usb

If you're using automatic mounting, the mount point is configured by the file /etc/config/fstab. By default /mnt/sdXN is used.

Mount points must exist (as empty directories) before a filesystem can be mounted on them. If a non-empty directory is used the existing files and subdirectories in it will be unreachable until the new filesystem is unmounted.

A common issue is having an external filesystem fail to mount, then an application writes large files to /mnt/sdXN anyway. These files overfill the internal flash and crash the router. A workaround for this is to place the application and/or its config files on the external drive so it cannot run unless the drive is mounted.

1 Like