How to mount /opt as read-only on boot?

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
tabicat
DD-WRT Novice


Joined: 13 Jan 2018
Posts: 38

PostPosted: Sat May 13, 2023 4:44    Post subject: How to mount /opt as read-only on boot? Reply with quote
I followed the instructions on https://wiki.dd-wrt.com/wiki/index.php/Installing_Entware to install Entware and some packages that I want, and everything works fine.

The partition is labeled "Optware" so it is automatically mounted at boot. However, I would like it to mount the partition as read-only instead of read-write.

I can manually run "mount -r -o ro,remount /opt" to remount /opt as read-only, and that seems to work.

I can't edit /etc/fstab because its partition is read-only, and I read somewhere else that DD-WRT doesn't use fstab anyway.

Is there a way to get /opt to be mounted as read-only on every boot? I'm okay with having to remount it as read-write in order to install/update packages.


Last edited by tabicat on Sat May 13, 2023 16:56; edited 1 time in total
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6439
Location: UK, London, just across the river..

PostPosted: Sat May 13, 2023 5:27    Post subject: Reply with quote
Just add you commands to administration>commands>save to usb script...
so when your /opt comes up it will execute your read only command...i've no idea if entware is made to work like that...probability on entware updates you have to remove those commands..in order to update

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
tabicat
DD-WRT Novice


Joined: 13 Jan 2018
Posts: 38

PostPosted: Sun May 14, 2023 13:41    Post subject: Reply with quote
That worked, thanks.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum