Joel007
Posts: 6
Joined: Wed May 01, 2019 4:03 pm

Make root readonly

Mon May 06, 2019 7:42 pm

I am currently have a huge problem. Every time power cut happen in our house the is gets corrupted. So, I did a little bit of research on the internet and found out that this problem can be solved using read-only root( by making root partition read-only) I have tried all kind of solutions out there on internet. But still no luck. I can't make my root read-only. Please help me to do it........

Specifications:
Raspbian lite
Raspberry Pi 3B+

stuartiannaylor

Re: Make root readonly

Mon May 06, 2019 8:22 pm

https://github.com/StuartIanNaylor/zram-config

Code: Select all

sudo apt-get install git
git clone https://github.com/StuartIanNaylor/zram-config
cd zram-config
sudo sh install.sh
sudo nano /etc/ztab #comment out the dir but prob keep the zram swap
sudo zram-config enable-ephemeral
sudo reboot
Sure you haven't already posted this as got a really strong feeling of deja-vu?

User avatar
thagrol
Posts: 1844
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Make root readonly

Tue May 07, 2019 7:08 pm

Joel007 wrote:
Mon May 06, 2019 7:42 pm
I am currently have a huge problem. Every time power cut happen in our house the is gets corrupted. So, I did a little bit of research on the internet and found out that this problem can be solved using read-only root( by making root partition read-only) I have tried all kind of solutions out there on internet. But still no luck. I can't make my root read-only. Please help me to do it........

Specifications:
Raspbian lite
Raspberry Pi 3B+
I've had success using this: https://learn.adafruit.com/read-only-ra ... i/overview
That'll stop SD card problems with unclear shutdowns but will also prevent any and all writes to the SD card. It won't prevent damage to any additional storage you have connected and mounted.
This space unintentionally left blank.

Joel007
Posts: 6
Joined: Wed May 01, 2019 4:03 pm

Re: Make root readonly

Sun May 26, 2019 4:36 pm

I used the code of stuartiannaylor but it's showing me this error.

Code: Select all

pi@raspberrypi:~ $ /home/pi/freenet/./run.sh start
Your java executable at /usr/bin/java seems suitable
/home/pi/freenet/./run.sh: 172: /home/pi/freenet/./run.sh: cannot create /home/pi/freenet/wrapper.conf.bak: Read-only file system
mv: cannot stat '/home/pi/freenet/wrapper.conf.bak': No such file or directory
Starting Freenet 0.7...
rm: cannot remove '/home/pi/freenet/./Freenet.pid': Read-only file system
Removed stale pid file: /home/pi/freenet/./Freenet.pid
rm: cannot remove '/home/pi/freenet/./Freenet.pid': Read-only file system
Removed stale pid file2: /home/pi/freenet/./Freenet.pid
pi@raspberrypi:~ $
Does anyone know how to fix it?

User avatar
thagrol
Posts: 1844
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Make root readonly

Sun May 26, 2019 4:53 pm

Joel007 wrote:
Sun May 26, 2019 4:36 pm
I used the code of stuartiannaylor but it's showing me this error.

Code: Select all

pi@raspberrypi:~ $ /home/pi/freenet/./run.sh start
Your java executable at /usr/bin/java seems suitable
/home/pi/freenet/./run.sh: 172: /home/pi/freenet/./run.sh: cannot create /home/pi/freenet/wrapper.conf.bak: Read-only file system
mv: cannot stat '/home/pi/freenet/wrapper.conf.bak': No such file or directory
Starting Freenet 0.7...
rm: cannot remove '/home/pi/freenet/./Freenet.pid': Read-only file system
Removed stale pid file: /home/pi/freenet/./Freenet.pid
rm: cannot remove '/home/pi/freenet/./Freenet.pid': Read-only file system
Removed stale pid file2: /home/pi/freenet/./Freenet.pid
pi@raspberrypi:~ $
Does anyone know how to fix it?
In brief

Stop using a read only filesystem, add a writeable partition and move the stuff hay needs to be written to there, add an overlay to / (Google overlays for info)
This space unintentionally left blank.

Return to “Raspbian”