DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th March 2009
gosha gosha is offline
Spam Deminer
 
Join Date: Jun 2008
Location: China
Posts: 256
Default /tmp on ram write denied

Hello,
I followed the instructions in the fstab manpages and some tutorials on line to put my /tmp on ram. I'm trying this because my macmini has a hard disk spinning at 5400 and I have far enough ram (1g), so this might speed up things especially while browsing the web (am I right?).
It works fine if I do things as root, but as normal user (in the wheel group) I get a permission denied, cannot write on /tmp. What permission am I missing?
And, by the way, is it really worth doing this?
tks
Reply With Quote
  #2   (View Single Post)  
Old 29th March 2009
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

What is the permissions on your /tmp folder?
$ ls -ld /tmp
(note: I am a FreeBSDMan, but I doubt that ls's syntax will change!)
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #3   (View Single Post)  
Old 29th March 2009
gosha gosha is offline
Spam Deminer
 
Join Date: Jun 2008
Location: China
Posts: 256
Default

yes, of course, for some reason I did not think about checking the permission of /tmp, it was writable only by root.
But then, why, if I create a "normal" /tmp partition it is writable by all, but this is not. What's the reason?

Anyway thank you robbak, changed permission to 777 and now it works
Reply With Quote
  #4   (View Single Post)  
Old 29th March 2009
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

It is called the sticky bit.

When the sticky bit is set on a directory, anyone with permissions on the directory can create a file, but only the owner of the file, directory (or the super user) can delete it.

You should have set the permissions to 1777. If that is the right number in OpenBSD: check chmod(1) or sticky(8) to confirm.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #5   (View Single Post)  
Old 29th March 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by gosha View Post
And, by the way, is it really worth doing this?
If you learned something from the exercise, then it had value, but as for seeing any performance increase as a result, I doubt it. Most of the recipes you may be finding on the Web for this trick target Soekris-like systems which measure in the ~500MHz range & have limited RAM. Moving /tmp to RAM is done more to save writes to (older) CF cards to extend their lifetime than to boost performance. Your PPC Mac mini is a 1.4GHz system which doesn't have the same constraints (solid-state storage).

If you have concerns about performance, study both the manpage to top(1) & it output. If the system is inordinately swapping, then moving /tmp to RAM might be called for, but I suspect the performance increase experienced will be negligible.

As an anecdote, when Hitachi 7200rpm laptop drives first came out, I immediately went out & put (an unauthorized) one in a IBM Thinkpad which originally had a factory-installed 5400rpm drive. The perceptible difference between drives when running OpenBSD were nearly negligible, & the 7200rpm drive ran warmer. Eventually, IBM added a whining beep (because the drive was unauthorized...) in a BIOS update which prompted me to just get a bigger drive from them, & for heat reasons, they were only selling 5400rpm drives. I've never regretted downgrading back to a slower drive. Given the algorithms OpenBSD employs with disk writes (& when to do them...), I didn't find such performance tricks very beneficial. At least, that has been my experience.
Reply With Quote
  #6   (View Single Post)  
Old 29th March 2009
gosha gosha is offline
Spam Deminer
 
Join Date: Jun 2008
Location: China
Posts: 256
Default

Quote:
Your PPC Mac mini is a 1.4GHz
for the sake of correctness:
Code:
cpu0 at mainbus0: 7447A (Revision 0x102): 1249 MHz: 512KB L2 cache
In fact, I doubted that it could have any noticeable performance boost, but when I have five minutes time, I sometimes try something new to learn the system better. At this point I guess it is better to go back to the original configuration and leave ram free to be used as ram.
I also tried to use "softdep" in fstab but also without noticing any particular performance increase. Would it be noticeable only on a busy server?
Reply With Quote
  #7   (View Single Post)  
Old 29th March 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Quote:
Originally Posted by gosha View Post
I'm trying this because my macmini has a hard disk spinning at 5400 and I have far enough ram (1g), so this might speed up things especially while browsing the web (am I right?).
Nope, this will not make browsing the web faster... Firefox's cache is inside your home directory.

$ ls -la ~/.mozilla/firefox/*.default/Cache/

I guess theoretically you could turn that into an mfs mount, but.. overall, would it be worth the effort? probably not.

Good luck though..
Reply With Quote
  #8   (View Single Post)  
Old 29th March 2009
gosha gosha is offline
Spam Deminer
 
Join Date: Jun 2008
Location: China
Posts: 256
Default

yeah, not really worth it, I was just playing around... better go back to work.
thanks a lot
Reply With Quote
  #9   (View Single Post)  
Old 29th March 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

You will find softdep performance noticeable whenever you issue a large rm(1). It has other benefits as well; see the links in FAQ 14.5.

I use MFS regularly for /tmp; I have used it also for /usr/obj and /usr/xobj, but no longer do: /usr/obj has now gotten larger than the upper size limit for MFS on one of my architectures, and workarounds are not worth the effort. Plus, because I am making releases, I sometimes want to keep /usr/obj between reboots. Was the elapsed time noticeable? yes. But we're talking hundreds of thousands of file accesses during builds. Was it enough to keep MFS? No.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why you should write a guide/howto in XML J65nko Guides 4 19th October 2008 07:46 PM
Permission denied (publickey). Help pls rex FreeBSD General 13 14th October 2008 08:54 PM
[F1] write usb modem driver raixun Programming 7 17th July 2008 11:06 AM
[VSFTPD] Can't write in directory Sunsawe General software and network 7 1st June 2008 11:29 PM
Permission denied delboy FreeBSD Ports and Packages 11 24th May 2008 09:26 PM


All times are GMT. The time now is 10:02 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick