LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-01-2012, 06:13 AM   #1
origami-sheep
Member
 
Registered: Dec 2009
Distribution: Arch
Posts: 103

Rep: Reputation: 2
how to mount /usr/lib and other Dirs in RAM


i read that it can massively improve responsiveness to mount certain directories in RAM (one guy claimed it can make firefox open in under half a second)

i can see the benefit of doing this, but how would i go about doing so? in particular how could i get it to write the modified files back to /usr?

fyi the ones i think would have greatest impact are
/usr/bin /usr/sbin /usr/lib and /lib
 
Old 05-01-2012, 10:10 AM   #2
fatmac
Member
 
Registered: Sep 2011
Location: Surrey/Hants Border, UK
Distribution: AntiX, TinyCore, (& SliTaz)
Posts: 382

Rep: Reputation: Disabled
Quote:
Originally Posted by origami-sheep View Post
i read that it can massively improve responsiveness to mount certain directories in RAM (one guy claimed it can make firefox open in under half a second)

i can see the benefit of doing this, but how would i go about doing so? in particular how could i get it to write the modified files back to /usr?

fyi the ones i think would have greatest impact are
/usr/bin /usr/sbin /usr/lib and /lib
Generally speaking, the idea of using ram to speed things up isn't really worth it, for most users.
(I believe some servers use it to speed access times to large databases, etc.)

Yes it can be done by creating a ram disk, copying to it, & remounting onto it.

If you're still interested, look up 'ram disks'.
 
Old 05-01-2012, 01:02 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
You have to create a custom initrd to do this, with a modified init-script that copies the contents of the directories to a tmpfs and then mounts that tmpfs as the directory you want to have in RAM.
I think it would be far easier to load the whole system in RAM, instead. Also, keep in mind that this will:
- have a negative effect on boot time.
- use much of your RAM, that can't be used for your applications. If you don't have enough RAM for the file-system and your applications the system will start to swap, which will slow down your system.
- only accelerate the first start of an application. If you have enough RAM to mount entire file-systems into it then your application will most likely be cached anyways after the first start.

So this can be a project for a nice learning experience, but I wouldn't recommend it for everyday use.
 
  


Reply

Tags
mount, ramdisk, tmpfs


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
OPENNMS INSTALLATION ERROR -install –disU –l /usr/lib/jni:/usr/lib ramecare Linux - Server 4 07-11-2011 01:06 PM
opennms installation error -install –disU –l /usr/lib/jni:/usr/lib ramecare Linux - Server 2 07-08-2011 11:51 AM
oops, I stripped /usr/lib and /usr/X11R6/lib ! H_TeXMeX_H Slackware 2 02-08-2007 10:27 PM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-29-2004 12:33 AM


All times are GMT -5. The time now is 06:17 PM.

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