[Solved] Change mount point to /opt


The Quick Start for Adding a USB drive guide leads to USB devices mounted at /mnt/sda1 as a default.

Once I attempt to change the mount point to /opt through LuCI, it allows to change only to /opt/sda1.

How can I change the mount point to /opt?

Thank you.

See the section on Device Names in the Linux manual.


unmount it first then do the edits.

admittedly i'm running a snapshot build but you should see the custom part at bottom? put /opt in there.

Failing that. manually edit the /etc/config/fstab file

config mount
	option target '/mnt/sda1'
	option uuid '292f3823-ba8f-42bb-8821-f45cf5569341'
	option enabled '1'

Change the option target line to /opt instead of /mnt/sda1

Bit more explanation.

first column is the device

so /dev/sda1 is your first detected usb drive.

Then the mount point /mnt/sda1 is the directory where it mounts that drive.

however when you use the guide it changes the /dev/sda1 into the uuid (the devices serial number).
This ensures if you put the usb drive in a different port eg /dev/sdb1 then it would still mount the drive correctly instead of failing because /dev/sda1 doesn't exist anymore.

root@OpenWrt:/opt# block info | grep "/dev/sd"
/dev/sda1: UUID="292f3823-ba8f-42bb-8821-f45cf5569341" VERSION="1.0" MOUNT="/mnt/sda1" TYPE="ext4"
1 Like

The mount point for the device will still show as /opt/sda1, /opt/sdb1, etc.

The OP stated -

You can't AFAIK.

Mine does. However like i said. I'm running a snapshot.

However if he unmounts it and manually edits the fstab file and reboots. it will mount to /opt.

1 Like

Good to know.

You can simply enter /opt as -- custom -- value no need to manually edit any files.


Entering /opt in Custom field, as suggested by both mercygroundabyss and jow, worked. This hadn't worked previously for me, until re-installed clean 21.02.1 stable (not snapshot).


1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.