Maximizing SD Card lifespan

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Maximizing SD Card lifespan

Postby ethernode » Mon Jun 15, 2015 6:52 am

Hello,

I'm desperately looking for comprehensive tips on how to maximize RPI's SD card ; i am running raspberry pis 24/7 and they keep failing with i/o errors etc...

While there is a large amount of tips for raspbian based systems, i am still to find working instructions on how to run the root filesystem read only -- systemd apparently fails to start properly without disk access.

Any other tips would also be welcome,

Thanks
ethernode
 
Posts: 2
Joined: Mon Jun 15, 2015 6:45 am

Re: Maximizing SD Card lifespan

Postby ethernode » Fri Jun 19, 2015 4:37 pm

Basically after setting ro instead of rw as below, there are a number of services which fail to work:
$this->bbcode_second_pass_code('', '[root@videoplayer ~]# cat /boot/cmdline.txt
root=/dev/mmcblk0p2 ro rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop
')

Are the following errors avoidable ? "dangerous" ? I'm just wanting to have a robust machine that i can nearly plug anytime.

$this->bbcode_second_pass_code('', '
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting default ACL "u::rwx,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::r-x" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb failed: Read-only file system
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rwx,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::r-x" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb failed: Read-only file system
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system.journal failed: Read-only fil
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r--,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@067b425f7a264487b790b1b204200
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@af352691b4bd442ba0a67917ac792
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@000000000067818f-c9f7a2e3ec9e
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@000000000075206f-fe1a250ff788
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@000000000075eb50-3facea6fc43e
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@067b425f7a264487b790b1b204200
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@cfa1368d8e254774a3f9cc1cf76c6
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Setting access ACL "u::rw-,g::r-x,g:adm:r-x,g:wheel:r-x,m::r-x,o::---" on /var/log/journal/002e11bf469a4ac584a15c2ca42108bb/system@2f3ac48bb7764171a80f11a9a3cc1
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Failed to create file /var/log/btmp: Read-only file system
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Failed to create file /var/log/lastlog: Read-only file system
Jan 01 01:00:11 videoplayer systemd-tmpfiles[124]: Failed to create file /var/log/wtmp: Read-only file system
Jan 01 01:00:11 videoplayer systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE
Jan 01 01:00:11 videoplayer systemd[1]: Failed to start Create Volatile Files and Directories.
Jan 01 01:00:11 videoplayer systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state.
Jan 01 01:00:11 videoplayer systemd[1]: systemd-tmpfiles-setup.service failed.
Jan 01 01:00:11 videoplayer systemd[1]: Starting Update UTMP about System Boot/Shutdown...
Jan 01 01:00:11 videoplayer systemd-update-utmp[127]: Failed to write utmp record: Read-only file system
Jan 01 01:00:11 videoplayer systemd[1]: systemd-update-utmp.service: main process exited, code=exited, status=1/FAILURE
Jan 01 01:00:11 videoplayer systemd[1]: Failed to start Update UTMP about System Boot/Shutdown.
Jan 01 01:00:11 videoplayer systemd[1]: Unit systemd-update-utmp.service entered failed state.
Jan 01 01:00:11 videoplayer systemd[1]: systemd-update-utmp.service failed.
...
Jan 01 01:00:15 videoplayer systemd[1]: systemd-hostnamed.service failed to run 'start' task: Read-only file system
Jan 01 01:00:15 videoplayer systemd[1]: Failed to start Hostname Service.
Jan 01 01:00:15 videoplayer systemd[1]: Unit systemd-hostnamed.service entered failed state.
Jan 01 01:00:15 videoplayer systemd[1]: systemd-hostnamed.service failed.
')
ethernode
 
Posts: 2
Joined: Mon Jun 15, 2015 6:45 am

Re: Maximizing SD Card lifespan

Postby sdjf » Sun Jun 21, 2015 6:14 am

If you have I/O errors, could be a problem with your power supply or cable.

There are a variety of safety checks built in to the system, which you would disable if it can't write to disk. Some people put the root file system on an external device, just booting from the SD card. The writing would happen on the external device, but that may not suit your needs.
sdjf
 
Posts: 178
Joined: Wed May 08, 2013 1:55 pm

Re: Maximizing SD Card lifespan

Postby moonman » Sun Jun 21, 2015 7:16 am

You can easily run systemd in ro mode. You do need to put your /var in tmpfs and write tmpfiles to recreate required directories under /var. Depending on the services you run, some files may need to copied into tmpfs on boot too. I say this because it has been done with rescue system for kirkwood plugs: viewtopic.php?f=30&t=8383
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am


Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 13 guests