sliverstorm
Posts: 7
Joined: Sun Aug 26, 2012 11:47 pm

Minimizing SD I/O

Mon Aug 27, 2012 12:25 am

My rpi stays on for long periods, and my SD card is somewhat old and not super high quality. I back it up and all, but either way I'd rather it didn't fail any time soon.

So, I've been on a campaign to minimize I/O activity to the SD card. Nothing insane, mind you- I'm not going to mount my home folder in a temporary directory to prevent writes to ~/.history (although maybe I should turn off history!) I've been focusing on things like doing work in /tmp (which I mount as tmpfs) and turning logging way down. I've left /var alone for now, because aside from the logs I believe most activity there is at boot or shutdown.

Has anyone gone on a similar crusade? Does anyone have any suggestions of good things to target?

kriston
Posts: 12
Joined: Sat Aug 25, 2012 3:05 am

Re: Minimizing SD I/O

Mon Aug 27, 2012 2:10 am

In your lifetime you're not likely to wear out the SD card if it was made after 2005.
The most effective thing to do is to arrange to mount /var into a ramdisk. That's fairly easy to do in BSD Unix and Red Hat Linux but in Debian and Ubuntu it is not so easy since they depend so heavily on persistent things in /var. You might look at unionfs to mount the read/write parts of the filesystem onto a ramdisk but that's a bit too hairy to go into detail here.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Minimizing SD I/O

Mon Aug 27, 2012 3:16 am

/var/run and /var/logs are safe to mount into tmpfs.
If you're using raspbian, theres a few other directories for apt that can be mounted into tmpfs as well.
/var/lib/apt ? and /var/cache/apt ? I think they were.
I'll find out when I get home.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

sliverstorm
Posts: 7
Joined: Sun Aug 26, 2012 11:47 pm

Re: Minimizing SD I/O

Mon Aug 27, 2012 3:53 am

Should have mentioned this is with ArchLinux

Elect
Posts: 11
Joined: Tue Aug 07, 2012 7:48 am
Location: Netherlands

Re: Minimizing SD I/O

Mon Aug 27, 2012 4:00 pm

http://piserv.nl/blog/index.php/using-t ... pberry-pi/

I couldn't easily find out if it was available for Archlinux, so proceed with some caution.

kriston
Posts: 12
Joined: Sat Aug 25, 2012 3:05 am

Re: Minimizing SD I/O

Sun Sep 23, 2012 4:10 am

Pretty much mount /var into a ramdisk in order to keep flash memory writes to a minimum. Of course you lose diagnostic data but that's how we did it when we implemented a flash-based filesystem on Linux in the olden days. Some subsystems write to /etc but I forget which they were and even then they don't write that often. The /var volume is the main place to worry about.

Return to “Advanced users”