LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 08-20-2014, 05:34 AM   #1
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 181

Rep: Reputation: Disabled
Raspberry Pi remount rootfs read-only


Hi Folks,

I'm new to this forum, I'd like to ask for your help.
Since there is no power button on the RPi if it's run headless damages may happen to the filesystem when power goes away, I thought it would be useful to remount the rootfs in read-only mode.
Filesystems don't cultivate power outages or pulling out the power supply by someone while writing to disk.
I think there might be a workaround to eliminate this problem, but I don't know what would be the easiest and elegant way to achieve this.
I was told to do this: create an init script and during the boot process, when each and every daemon has started succesfully the script would set the rootfs into read only mode.
But /proc, /sys and /dev maybe more... still need to be writable, should I make a new partition on the SDHC card for them, or is there another way?
I'm not a hardcore linux geek, I have some experience in bash scripting but never wrote an init script, do you think is this a good idea at all?
Do you think it's possible that the RPi has already been prepared to tolerate power outages?

Z

Last edited by kzo81; 08-20-2014 at 06:18 AM.
 
Old 08-20-2014, 10:41 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,963

Rep: Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272
Quote:
Do you think it's possible that the RPi has already been prepared to tolerate power outages?
Yes. It runs from an sdcard. Don't worry too much about that. Better to use ext3 or ext4 fs as they do journalling and just check the open files on a dirty stop

Last edited by business_kid; 08-20-2014 at 11:31 AM.
 
1 members found this post helpful.
Old 09-05-2014, 01:37 PM   #3
kzo81
Member
 
Registered: Aug 2014
Location: Hungary
Distribution: Debian, Linux Mint, CentOS
Posts: 181

Original Poster
Rep: Reputation: Disabled
Thank you, than I won't botter with this.
By the way, I would like to know in theory what is the appropriate way to do this with an init script, if don't mind could you pleas tell me how this should be done?
How can I find out in which /etc/rcX.d/ directory should I place my init script if I had one?
Does it depend on the given system let's say on debian is always in the rc2.d directory?
Sooner or later I'll have to write an init script I know...
I have little projects with rasbian I survived so far by adding scripts to cron.

Last edited by kzo81; 09-06-2014 at 05:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What would cause an NFS-mounted rootfs to come up read-only? elsutjr Linux - Embedded & Single-board computer 3 03-04-2014 08:40 AM
remount read only filesystems 7hewh0re Linux - Newbie 1 01-24-2014 06:29 AM
remount read write alaios Linux - General 3 05-18-2011 05:34 AM
Boot Up Process- The Read Only Rootfs into VFS dman777 Linux - General 4 03-17-2011 10:50 PM
Getting thrown into read-only mode - not able to remount dleangen Linux - General 19 06-07-2007 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration