Author Topic: Help Beta Test a script to mount the SD card on a Pi read-only  (Read 5994 times)

Offline nmiller0113

  • Sr. Member
  • ****
  • Join Date: Aug 2015
  • Location: Santa Rosa, CA
  • Posts: 477
  • Kudos: 8
    • The Miller Lights
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #15 on: November 16, 2016, 04:25:20 PM »
Ok, so if you make the SD card RO by default and I flip it to RW for storage then I'm myself at risk of corruption in a power failure, or are there workarounds to protect the areas of the filesystem that we can't risk corruption of?  Forgive my ignorance here as I'm not 100% clear how you're accomplishing everything and I do not want to assume.


I like using the SD card only because of the speed of the SD card over USB as well as the fact it keeps me from needing to eat up USB power resources as I've already got 3 in use with sound, wireless and USB to Serial for the projector, and 4 when a keyboard is connected...though that is few and far between as a keyboard is not required.

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #16 on: November 16, 2016, 04:35:27 PM »
Ok, so if you make the SD card RO by default and I flip it to RW for storage then I'm myself at risk of corruption in a power failure, or are there workarounds to protect the areas of the filesystem that we can't risk corruption of?  Forgive my ignorance here as I'm not 100% clear how you're accomplishing everything and I do not want to assume.


I like using the SD card only because of the speed of the SD card over USB as well as the fact it keeps me from needing to eat up USB power resources as I've already got 3 in use with sound, wireless and USB to Serial for the projector, and 4 when a keyboard is connected...though that is few and far between as a keyboard is not required.

Yes, if we make FPP v2.x use RO by default and you flip back to RW then you are risking corruption if there is a power issue, but that is the same as with a FPP v1.x SD image.

One thought that I have is to keep the base OS filesystems (/ and /boot) at their install size and format the rest of the SD card as a separate partition and filesystem.  Then, we can leave the OS filesystems read-only and allow the data partition to be mounted read-write.  That would help, but doesn't totally eliminate risk of corruption during a power issue.

FPP v2.0 will not use NOOBS for installing the Pi image, so we can be a bit more flexible in our setup.  For v2.0, you will 'burn' the image to the SD for a Pi using the same procedure as we use for the BBB and when you boot the Pi up, it will be up and running, there won't be an install procedure.  There could be a "grow the data partition" or "grow the root OS parittion" procedure though, which might require a reboot.  We haven't talked about these ideas much, but they are some things I would like to explore.
-
Chris

Offline smccoy

  • Jr. Member
  • **
  • Join Date: May 2016
  • Location: Houston, TX
  • Posts: 68
  • Kudos: 0
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #17 on: November 16, 2016, 05:29:51 PM »
Not sure if this is related, but on my master Pi, after updating and running the script, the hostname reset to FPP, the mode changed to standalone, and FPPD indicated stopped.  Switching mode to Master showed FPPD as running and the show started. 

EDIT: Looks like all settings on the FPP Settings pages (Hostname, Log level, Always transmit data, Multisync) all got reset to the defaults.

Offline smccoy

  • Jr. Member
  • **
  • Join Date: May 2016
  • Location: Houston, TX
  • Posts: 68
  • Kudos: 0
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #18 on: November 16, 2016, 05:40:56 PM »
It seems like FPPD will sometimes start fine and other times not.  When it fails, I see an error like this in the log:
Code: [Select]
Wed Nov 16 18:35:45 CST 2016
cat: /home/fpp/media/config/channeloutputs.json: No such file or directory
rm: cannot remove `/opt/fpp/lib/librgbmatrix.so': Read-only file system
ln: failed to create symbolic link `/opt/fpp/lib/librgbmatrix.so': File exists
Starting /opt/fpp/bin.pi/fppd
sh: 1: cannot open options: No such file

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #19 on: November 16, 2016, 10:43:13 PM »
It seems like FPPD will sometimes start fine and other times not.  When it fails, I see an error like this in the log:
Code: [Select]
Wed Nov 16 18:35:45 CST 2016
cat: /home/fpp/media/config/channeloutputs.json: No such file or directory
rm: cannot remove `/opt/fpp/lib/librgbmatrix.so': Read-only file system
ln: failed to create symbolic link `/opt/fpp/lib/librgbmatrix.so': File exists
Starting /opt/fpp/bin.pi/fppd
sh: 1: cannot open options: No such file

The librgbmatrix.so issue is an issue with mounting the filesystem read-only.  The channeloutputs.json issue sounds like a problem with your USB drive.  That link should have existed on the system prior to converting to read-only so it should allow fppd to start up.  I will need to think of a way around that.  Currently if you are using the LED Panels on the Pi, you will be stuck with whatever pinout you were originally using.  For most that should be OK because they want the default standard pinout.  I will work on a solution to the link error.

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #20 on: November 16, 2016, 10:45:57 PM »
EDIT: Looks like all settings on the FPP Settings pages (Hostname, Log level, Always transmit data, Multisync) all got reset to the defaults.

This further makes it sound like you have USB drive issues OR you are using the SD card for storage.  The read-only script would not affect the state of the USB drive.

Offline smccoy

  • Jr. Member
  • **
  • Join Date: May 2016
  • Location: Houston, TX
  • Posts: 68
  • Kudos: 0
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #21 on: November 16, 2016, 10:56:53 PM »
EDIT: Looks like all settings on the FPP Settings pages (Hostname, Log level, Always transmit data, Multisync) all got reset to the defaults.

This further makes it sound like you have USB drive issues OR you are using the SD card for storage.  The read-only script would not affect the state of the USB drive.
It is on a USB drive and now that I think about it, I wouldn't doubt that there could be a corruption issue as this Pi got power cycled several times in the past (bad UPS...). I'll back up and reformat it tomorrow.

Sent from my Nexus 6P using Tapatalk


Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #22 on: November 16, 2016, 11:03:32 PM »
rm: cannot remove `/opt/fpp/lib/librgbmatrix.so': Read-only file system
ln: failed to create symbolic link `/opt/fpp/lib/librgbmatrix.so': File exists

I added a "Known Issues" section at the bottom of the first post and noted this.  I don't think it will affect many people because even if someone is using a different hat with a different pinout, they are likely not switching back and forth so although this is an error in the logs, it doesn't actually break anything.  It also only affects v1.9 because v1.8 did not have support for the other pinouts.  Thanks for reporting it, and I will look into it.

Offline gadgetsmith

  • Hero Member
  • *****
  • Join Date: Apr 2014
  • Location: Charlton, NY
  • Posts: 907
  • Kudos: 14
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #23 on: November 17, 2016, 09:03:21 AM »
Did a clean install of v1.8 on a uSD card on a Pi3.  Kept my USB stick and settings with no changes.  Updated to v1.9 branch, and latest code is v1.9-26-g313d26a.  Installed and ran script.

Still can not edit E1.31 channels on the Outputs Page.  Can no longer asses the media directory through windows PC. (typically I just type in my Pi3 IP address, \\192.168.1.185, in a 'run' window to open an explorer instance where I can drag and drop files)

I'm attaching some error messages received on an HDMI monitor during the reboot after running the script.


Offline gadgetsmith

  • Hero Member
  • *****
  • Join Date: Apr 2014
  • Location: Charlton, NY
  • Posts: 907
  • Kudos: 14
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #24 on: November 17, 2016, 09:07:34 AM »
from the mounts section:


/dev/root on / type ext4 (ro,noatime,data=ordered) devtmpfs on /dev type devtmpfs (rw,relatime,size=469688k,nr_inodes=117422,mode=755) tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=94804k,mode=755) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) /dev/sda1 on /home/fpp/media type vfat (rw,noatime,nodiratime,uid=500,gid=500,fmask=0022,dmask=0022,codepage=437,iochar set=ascii,shortname=mixed,flush,errors=remount-ro,_netdev) tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=189600k) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) /dev/mmcblk0p6 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed, errors=remount-ro) tmpfs on /var/log type tmpfs (rw,nosuid,nodev,relatime,size=10240k) tmpfs on /var/tmp type tmpfs (rw,nosuid,nodev,relatime,size=10240k) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=189600k) tmpfs on /etc.rw type tmpfs (rw,relatime) overlay on /etc type overlay (rw,relatime,lowerdir=/etc.ro,upperdir=/etc.rw/upper,workdir=/etc.rw/work)


Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #25 on: November 17, 2016, 10:02:50 AM »
I'm attaching some error messages received on an HDMI monitor during the reboot after running the script.

Something didn't work right, none of those errors about /etc being read-only should be occurring.  It looks like it didn't mount the overlay /etc directory.  Were those two screenshots from the same reboot or two different reboots?

The text you pasted from the mounts section looks good, /etc is mounted as it should be and it is writable so that doesn't explain the errors in the screenshot.

I did find some more cases where we need to remount read-write when switching branches, installing plugins which may install their own packages, etc. and I will push a change to fix those cases tonight.  None of them should cause what you are seeing though.

Offline richardholdman

  • Newbie
  • *
  • Join Date: Nov 2016
  • Location:
  • Posts: 1
  • Kudos: 0
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #26 on: November 18, 2016, 11:13:37 PM »
Thank you so much for making this. I loaded it on and it is working great. I turned it off and on about 30 times while I had a show running and every time it came up.


One thing I did notice is that I can no longer access it from my windows machine via network sharing. When I go to network it shows up as "FPP" on my network but will not connect. I have just been using FTP to access the files on the USB thumb drive and works great.

Thanks again!

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 7,939
  • Kudos: 141
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #27 on: November 19, 2016, 02:52:54 AM »
One thing I did notice is that I can no longer access it from my windows machine via network sharing. When I go to network it shows up as "FPP" on my network but will not connect. I have just been using FTP to access the files on the USB thumb drive and works great.

Thanks for the feedback.

I looked into the file share issue and have pushed a fix to the v1.8 and v1.9 branches.  If you pull in the latest updates and reboot then the file share should start working again.

Offline JonB256

  • Supporting Member
  • ******
  • Join Date: Mar 2013
  • Location: Granbury, Texas
  • Posts: 3,835
  • Kudos: 81
    • Granbury Christmas Lights
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #28 on: November 19, 2016, 08:55:58 AM »
Back to some testing - Fresh reimage of v1.8, upgraded to v1.9, running Version: v1.9-30-g3ca93de. This is on a RasPi B+, 4gb SD, 8gb Flash

Installed the script and ran it, rebooted and verified "ro" in the right places.

I'm still losing my E1.31 channel outputs settings if I change them. Since I didn't "Save" after they disappeared, they were not lost.

Offline JonB256

  • Supporting Member
  • ******
  • Join Date: Mar 2013
  • Location: Granbury, Texas
  • Posts: 3,835
  • Kudos: 81
    • Granbury Christmas Lights
Re: Help Beta Test a script to mount the SD card on a Pi read-only
« Reply #29 on: November 19, 2016, 10:19:37 AM »
Other than the problem noted above (changing my Channel Outputs), testing continues.

I have my test RasPi B+ running as a Remote with four sequences looping on the Master.

I have now successfully just "pulled the plug" on it mid sequence, counted to 10, then re-powered.

Still working after 3 cycles. Rather slow on the bootup, but that may be a B+ problem, but it has continued to reboot. It comes back up and updates the screen to FPPD Stopped pretty quickly but almost another minute before it starts and re-syncs.

I have Logging set at Warn with no checks for logging anything.

At 48 seconds, the screen updated to "Stopped"
at 100 seconds, FPPD began running and synced
« Last Edit: November 19, 2016, 10:42:32 AM by JonB256 »

 

Back to top