LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 05-31-2013, 12:18 PM   #1
flokofcgulls
Member
 
Registered: Apr 2013
Posts: 79

Rep: Reputation: Disabled
slackpkg upgrade-all fails when /var/log is mounted as tmpfs


In my quest to perfect the installation of Slackware on an SSD, I've encountered another issue.

Several sites I've discovered in my research have mentioned an optimization that involves mounting some write-intensive locations to RAM using tmpfs in fstab. With the exception of log files not persisting between restarts, this seems like a reasonable idea, so I decided to try it.

I've added the following lines to /etc/fstab:

Code:
tmpfs     /tmp         tmpfs     defaults,noatime,mode=1777     0     0
tmpfs     /var/spool   tmpfs     defaults,noatime,mode=1777     0     0
tmpfs     /var/tmp     tmpfs     defaults,noatime,mode=1777     0     0
tmpfs     /var/log     tmpfs     defaults,noatime,mode=0755     0     0
After doing this, I noticed an error on reboot that /var/log/setup/tmp didn't exist, but everything seemed to be working alright.

Now, when I run slackpkg upgrade-all, it fails with an error that /var/log/packages doesn't exist.

I would have thought that the /packages folder it's referring to would have been a place where packages flagged for update would have been held, but since I haven't gotten into the details of this piece of the system yet that must be incorrect.

So, is it possible to get slackpkg working when these folders are mounted this way, or does the program require they be written to a disk?
 
Old 05-31-2013, 12:35 PM   #2
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,044

Rep: Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977
_never_ever_ mount /var/log as tmpfs.

It does include essential permanent data, among which the database of your packages and scripts (/var/log/packages, /var/log/setup, etc.) and slackware scripts in /var/log/setup/tmp, and of course you system logs.

So if you do that, Slackware tools won't work.

Last edited by Didier Spaier; 05-31-2013 at 12:54 PM. Reason: Last sentence added
 
Old 05-31-2013, 12:48 PM   #3
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 314

Rep: Reputation: 77
Your SSD will last 10 years even if you write the logs there.
 
Old 05-31-2013, 12:57 PM   #4
flokofcgulls
Member
 
Registered: Apr 2013
Posts: 79

Original Poster
Rep: Reputation: Disabled
@Didier Spaier: That's interesting, I'm assuming these databases are created during installation? And therefore are not re-created at a later time then?

I generally approach all of these recommendations with a healthy dose of skepticism in order to weed out the bad ones, but I've encountered this one so many times it seems to be pretty widely recommended. Having these databases stored in /var/log, is this unique to Slackware?

This is why we test things first, right? =)

@Celyr: All my research on SSD has really only yielded one consistent observation; that nobody agrees on best practices yet. Since SSD usage has only recently started becoming more widespread, that's understandable. But as far as long-term failure rates, I think we're all still making best-guesses, and won't really know who was right or wrong until we get there in 10 years.

So while we're on the topic, are there any possible consequences of having /tmp, /var/spool, or /var/tmp mounted in RAM also?
 
Old 05-31-2013, 01:17 PM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,044

Rep: Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977Reputation: 977
Quote:
Originally Posted by flokofcgulls View Post
@Didier Spaier: That's interesting, I'm assuming these databases are created during installation? And therefore are not re-created at a later time then?
Yes, they are created during installation and there is no simple way to recreate it. They are updated every time you install, update or remove a package.

Quote:
Originally Posted by flokofcgulls View Post
Having these databases stored in /var/log, is this unique to Slackware?
Unique probably no, as some derivatives could use that as well, but somehow specific yes as the Slackware package management system as a whole.

Quote:
Originally Posted by flokofcgulls View Post
So while we're on the topic, are there any possible consequences of having /tmp, /var/spool, or /var/tmp mounted in RAM also?
I think that having /tmp in RAM is not a problem, provided that you copy or move on disk stuff you would want to keep before switching off or rebooting the computer.

For the others I don't know.

Last edited by Didier Spaier; 05-31-2013 at 01:24 PM.
 
Old 05-31-2013, 01:53 PM   #6
flokofcgulls
Member
 
Registered: Apr 2013
Posts: 79

Original Poster
Rep: Reputation: Disabled
After reading a little more about some of the other things that happen inside of /var, I'm starting to think that putting any of it into tmpfs is likely to cause more problems than it solves.

Therefore, I think I'm just going to mount /tmp there, and leave /var on the disk for now.

As for fixing the current situation, it seems that a re-install is in order. I need to do this anyways because one of my partitions isn't aligned correctly. I was going to try to iron out a few more things first so I could start testing the documentation I've been working on for this process, but it's no big deal.

Thanks for the guidance, as always!
 
Old 05-31-2013, 03:10 PM   #7
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 241

Rep: Reputation: 86
Quote:
Originally Posted by flokofcgulls View Post
are there any possible consequences of having /tmp, /var/spool, or /var/tmp mounted in RAM also?
/var/spool contains for example cron jobs, at jobs, print jobs, and mail inboxes. I wouldn't like to lose all of them at reboot...

/var/tmp is like /tmp except /var/tmp should survive reboots. If I remember right, vi (elvis) saves restore info there in case of computer crash during an edit session.
 
Old 05-31-2013, 11:30 PM   #8
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: Carrollton, Texas
Distribution: Slackware64 14.1
Posts: 1,443

Rep: Reputation: 409Reputation: 409Reputation: 409Reputation: 409Reputation: 409
Quote:
Originally Posted by flokofcgulls View Post
In my quest to perfect the installation of Slackware on an SSD, I've encountered another issue.

Several sites I've discovered in my research have mentioned an optimization that involves mounting some write-intensive locations to RAM using tmpfs in fstab. With the exception of log files not persisting between restarts, this seems like a reasonable idea, so I decided to try it.
It's interesting to see that you would NEVER want to know why your machine rebooted.

It's certainly the case I don't look at *my* log files that often. But when I need to, they are there.
 
Old 06-01-2013, 09:12 AM   #9
flokofcgulls
Member
 
Registered: Apr 2013
Posts: 79

Original Poster
Rep: Reputation: Disabled
Thanks for the additional info on this, very helpful!

Quote:
It's interesting to see that you would NEVER want to know why your machine rebooted.

It's certainly the case I don't look at *my* log files that often. But when I need to, they are there.
Well, I didn't really mean to imply that I wouldn't want the log files, only that I understood that was one of the downsides of doing this.

Since there's no clear agreement on how to properly setup Linux on an SSD, I'm having to do a lot of research and experimentation to figure out what works and what doesn't. I'm also still in the process of learning how Slackware works. All of this means that the experimentation is going to fail at times, and that's totally alright, that's how we figure out what works and what doesn't.

Even though I ended up having to do another reinstall to fix this issue, I'm glad I tried it. Thanks to everyone who posted, I learned a lot more about what all goes on inside of /var, and I also learned that all the sites recommending moving parts of /var into RAM are incorrect.
 
  


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
Slackpkg - /var/log/packages broken croftad1 Slackware 4 12-02-2012 05:21 AM
/var run out of space while slackpkg upgrade-all. Consequences? PreguntoYo Slackware 2 04-02-2012 04:05 PM
slackpkg search problem - not using /var/log/packages? plunder Slackware 2 09-21-2010 05:15 PM
Slackpkg fails on upgrade-all albhaf Slackware 1 12-02-2006 10:22 AM
Mounting /var/log as a tmpfs mr666white Linux - Laptop and Netbook 2 12-06-2004 08:07 PM


All times are GMT -5. The time now is 05:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration