LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2010, 09:08 AM   #1
newbinaryfile
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
How can i mount Ram as HDD ?


Hi;
I have server with 32 GB ram. And i have biggest problems with HDD I/O speeds.

Now i want to do use my 16 GB Ram like HDD.

How can i mount 16 gb ram like hdd in CentOS ?

And data safety is not problem for me.I used for sessions and if data lost in restart i dont care.


Thanks for all helpings
Best Regards
 
Old 11-20-2010, 09:22 AM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
depending on the version/release, you likely already have 1/2 of your ram mounted at /dev/shm. you can either place your files there or use a bind-mount to mount it where you'd like in the filesystem.
 
Old 11-20-2010, 09:23 AM   #3
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
You can use tmpfs or ramfs. Read man mount about it.
 
Old 11-20-2010, 10:07 AM   #4
newbinaryfile
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
hi;
i readed and i understand. but i have simple question.

which one is faster then other ? ramfs or tmpfs. because i/o speed most important think for me. i dont care data safety
 
Old 11-20-2010, 10:18 AM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by newbinaryfile View Post
which one is faster then other ? ramfs or tmpfs. because i/o speed most important think for me. i dont care data safety
I don't think there is any significant performance difference. But you might need to check that by testing and/or by searching for results of other tests.

tmpfs is significantly more flexible in the ways you can configure it and in the ways it adjusts to level of use, so it is almost always a better choice than ramfs.

I don't recall the exact limits and issues with ramfs (I only use tmpfs). Some of the advantages of tmpfs that I think are not shared by ramfs are:
1) tmpfs only uses the ram if you actually allocate the files. Otherwise the ram is available for any other use.
2) If you put more on a tmpfs than you have available ram, it will fall back to using your swap space. In deciding what to put in the tmpfs, you probably won't be expecting it to need more ram than it can get. But having a smooth fallback (vs. failing) is nice in case you mis estimated the total use.

But, I also want to point out that you may have much less need for either tmpfs or ramfs than you think. Linux file caching usually works a lot better than you probably expect.

You might expect it would be a good idea to copy a bunch of important files from hdd to tmpfs when the OS boots and then use them from tmpfs from then on. That usually is wasted effort. It is more efficient to let the OS automatically copy them from hdd to cache on first use and keep them in cache as long as there is no more important use for that ram.

A tmpfs is much better for files that tend to exist for a short time and then get deleted. If you just rely on the cache, the files will usually stay in cache (so you don't lose time reading them from disk). But they (and their directory entries) will also usually get written to disk. So you waste time with lots of writes to disk to create and delete directory info and write data, all of which only gets used from cache, so none of the disk writes are read back. A tmpfs avoids all that. The file contents and the directory entries are only written to disk (to swap space) if you mis estimated it or your other your ram needs and don't have room for it in ram.

Last edited by johnsfine; 11-20-2010 at 10:29 AM.
 
Old 11-21-2010, 08:59 AM   #6
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
You can also read article "Overview of RAMFS and TMPFS on Linux".
 
  


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
new hdd, old mount needs to point to new hdd mount. phorning Linux - Newbie 3 06-14-2010 05:44 AM
Make removable USB hdd mount at fixed mount point ctkroeker Linux - General 13 08-11-2009 08:49 AM
Puppy runs in Ram, but how to install to HDD? petect Puppy 5 05-01-2009 06:51 AM
want to see HDD/RAM capacity shipon_97 Linux - Newbie 3 05-20-2007 09:18 AM
How to format & mount 2nd hdd after FedCor1 has been installed on 1st hdd? clay394 Fedora 1 05-18-2004 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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