LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 07-15-2019, 10:50 AM   #1
forestcreature
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Rep: Reputation: Disabled
Using tmpfs tricks to reduce SD card writes


I would be interested to know if and how others have used tmpfs to reduce frequency of writes to their SD cards, the idea being to maybe prolong SD card life by writing a lot of logs and stuff that doesn't need to persist to RAM.

/var/log is an obvious candidate to mount on tmpfs, but up to slackware 14.2 package management depends on a couple of directories in /var/log. I've mounted /var/log on tmpfs and have a bunch of symlinks made on boot in rc.local to new directories in /usr/local/var/log from /var/log/packages (.../removed_packages, /scripts, /removed_scripts, /setup). So far it's worked well, and left me with a useable amount of RAM.

With CLEANUP:-YES in sbopkg.conf and judicious removal of built trees and packages, building sessions into a /tmp mounted on large tmpfs also work.

Anything else? Source caches, browser caches &c.?

Last edited by forestcreature; 07-15-2019 at 02:05 PM.
 
Old 07-15-2019, 11:59 AM   #2
lamerix
LQ Newbie
 
Registered: Mar 2018
Location: Bulgaria
Distribution: Slackware
Posts: 27

Rep: Reputation: Disabled
Quote:
Originally Posted by forestcreature View Post
I would be interested to know if and how others have used tmpfs to reduce frequency of writes to their SD cards, the idea being to maybe prolong SD card life by writing a lot of logs and stuff that doesn't need to persist to RAM.

/var/log is an obvious candidate to mount on tmpfs, but slackware package management depends on a couple of directories in /var/log. I've mounted /var/log on tmpfs and have a bunch of symlinks made on boot in rc.local to new directories in /usr/local/var/log from /var/log/packages (.../removed_packages, /scripts, /removed_scripts, /setup). So far it's worked well, and left me with a useable amount of RAM.

With CLEANUP:-YES in sbopkg.conf and judicious removal of built trees and packages, building sessions into a /tmp mounted on large tmpfs also work.

Anything else? Source caches, browser caches &c.?
I don't think slackware-current dosnt really depend on the stuff in /var/log ..but maybe some external tools still do. For stable ..yeah, Patric moved that stuff after 14.2's release. But the way you are donig things ...creating symlinks at boot should fix that.
Anyway, another thing you can do is using something like
Code:
commit=60
in fstab when mounting you root partition. Not sure if it works on all filesystems but it does on ext3,ext4. Long story short, this will make the filesystem sync every 60 seconds.
To save up some memory you may wanna look up zswap
 
Old 07-15-2019, 12:19 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,217

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
As far as I know, this is the documentation on "Patrick moved that stuff":

https://www.linuxquestions.org/quest...6/#post5870498
 
Old 07-15-2019, 01:50 PM   #4
forestcreature
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Whoa, right!

Thank you for the update and for the tips on zswap and commit=XX

Last edited by forestcreature; 07-15-2019 at 01:54 PM.
 
Old 07-16-2019, 06:03 AM   #5
Exaga
SARPi Maintainer
 
Registered: Nov 2012
Distribution: Slackware AArch64
Posts: 1,043

Rep: Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665Reputation: 665
Quote:
Originally Posted by forestcreature View Post
I would be interested to know if and how others have used tmpfs to reduce frequency of writes to their SD cards, the idea being to maybe prolong SD card life by writing a lot of logs and stuff that doesn't need to persist to RAM.

Anything else? Source caches, browser caches &c.?
No is the answer. I haven't ever tried prolonging the lifespan of any of my SD cards because failure isn't something that's happened very often for me. I guess it's just luck.

Some SD cards that I've been using for years on RPi build systems are still going strong. I only use branded, high quality, SD cards. So perhaps that makes a difference towards longevity.
 
Old 07-16-2019, 07:01 PM   #6
forestcreature
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Exaga View Post
Some SD cards that I've been using for years on RPi build systems are still going strong. I only use branded, high quality, SD cards. So perhaps that makes a difference towards longevity.
I've read similar experiences elsewhere so maybe it's more systematic than luck.
 
  


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
Reducing writes to SSD: mounting /var (and others) on RAM disks (tmpfs). sysfce2 Slackware 7 08-26-2011 02:00 AM
/etc/fstab "tmpfs /tmp tmpfs defaults 0 0" ramfs?! HOW? xcislav Linux - General 2 06-04-2011 03:03 AM
Running Slackware from an SD card - tmpfs / ramfs disturbed1 Slackware 2 01-15-2011 11:39 PM
New Tricks and Toys For Linux Addicts- USB tricks and Portables OS's! linus72 Linux - Newbie 3 05-29-2009 05:36 PM
Reduce HDD writes? Cyberman Linux - Hardware 1 09-29-2008 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 03:34 AM.

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