LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-01-2008, 11:58 AM   #1
mudflap
Member
 
Registered: Jul 2008
Location: Coffin Point
Distribution: Slackware - ttylinux - CPO
Posts: 53

Rep: Reputation: 15
/var in RAM on a flash drive system


The life of a flash media "drive" is limited by the number of writes. To extend this, I plan to mount /var in RAM, where the truly dynamic files (eg: logging) have free reign.

Certain files however are relatively static (eg: mail, and pkgtoolstuff). On such a system, these need be placed elsewhere, although /usr/var would seem to be the alternative, I am exploring other options.

Besides those files and directories mentioned, are there others I should consider moving from /var?

Last edited by mudflap; 10-01-2008 at 03:34 PM.
 
Old 10-01-2008, 04:18 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I wrote up some information on this for installing Slackware on the Eee 701 on another forum, but the long and short of it is to just use syslog.

Lets say you mounted /tmp on tmpfs, and want syslog to write the really active files (I.E. messages and syslog) to it. You would modify your /etc/syslog.conf file as such:

Code:
# Log anything 'info' or higher, but lower than 'warn'.
# Exclude authpriv, cron, mail, and news.  These are logged elsewhere.
*.info;*.!warn;\
    authpriv.none;cron.none;mail.none;news.none    -/tmp/messages

# Log anything 'warn' or higher.
# Exclude authpriv, cron, mail, and news.  These are logged elsewhere.
*.warn;\
    authpriv.none;cron.none;mail.none;news.none    -/tmp/syslog

# Debugging information is logged here.
*.=debug                        -/tmp/debug
This will cause syslog to start writing them to the tmpfs mounted /tmp, rather than /var/log. You can also manually symlink anything you want to move over, like the XOrg log:

Code:
ln -s /tmp/Xorg.0.log /var/log/Xorg.0.log
You can actually link all of the logs back to their original locations, so that the fact that they are in /tmp is transparent to the end user; you would still access them through /var/log.

The advantage of using syslog directly is that you don't even need to mess with the rest of /var (like /var/packages); as the logs are really the most active files there anyway.
 
Old 10-01-2008, 06:44 PM   #3
mudflap
Member
 
Registered: Jul 2008
Location: Coffin Point
Distribution: Slackware - ttylinux - CPO
Posts: 53

Original Poster
Rep: Reputation: 15
Thanks, a more measured approach than I had been considering. My Eeepc thanks you as well.
 
  


Reply



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
Need help choosing a persistent operating system to be installed on flash drive ghostmachine Linux - Software 7 08-30-2008 08:31 AM
flash drive for/as RAM? plesaleza Linux - General 3 08-22-2007 06:40 PM
usb flash drive operating system chodeman07 Linux - General 2 01-26-2006 11:34 PM
LXer: EDGE Tech Corp Announces Portable Flash Drive With Muscle - the New 8GB DiskGO!(TM) Now Available; Swap and Go With This Secure Thumb-Sized Flash Drive LXer Syndicated Linux News 0 12-14-2005 02:16 AM
System Manager to modify inode number in USB Flash drive asaba Linux - Software 2 03-09-2005 03:12 AM

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

All times are GMT -5. The time now is 03:44 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