LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 05: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, 09:10 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

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, 12:02 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:21 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
Open Source Consulting | Domain Registration