LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-06-2013, 07:46 PM   #1
NetBot
LQ Newbie
 
Registered: Nov 2013
Posts: 13

Rep: Reputation: 0
Can a tmpfs be asigned a certain size


Hello

My system has 4gb of memory. I just gotten a SSD drive and created a tmpfs filesystem in the /etc/fstab file for the /tmp directory.

When I rebooted the system and ran df -h, the tmpfs size was 1.5gb. That's almost half my system memory. I am going to upgrade my system memory at a later date. Until then, can I assign a lower size like 1gb for tmpfs.

Thanks
 
Old 11-06-2013, 08:54 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,614

Rep: Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576Reputation: 1576
Certainly. In your /etc/fstab entry just include "size=nnn" in the options. An optional suffix of "%", "k", "m", or "g" will be accepted. It's all in the manpage for the mount command under "Mount options for tmpfs."

But, that 1.5GB is just the maximum size (defaults to 50% of available memory after the kernel is loaded). At any given time, that tmpfs will use only enough memory to hold the files currently there.

Last edited by rknichols; 11-06-2013 at 08:57 PM.
 
1 members found this post helpful.
Old 11-07-2013, 04:30 AM   #3
NetBot
LQ Newbie
 
Registered: Nov 2013
Posts: 13

Original Poster
Rep: Reputation: 0
Thank you rknichols. It works!
 
  


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
[SOLVED] Tmpfs size (limits) Mr. Alex Linux - General 5 09-08-2012 12:48 PM
tmpfs /dev/shm - file deletion and size determination bgeary Red Hat 4 05-12-2010 08:56 AM
tmpfs Initial Size Megatog615 Linux - Software 5 02-13-2007 05:39 AM
Ubuntu eth0 still asigned when card was removed sam_vde Linux - Hardware 1 09-21-2006 04:21 PM
Kscd asigned to wrong cdrom drive farpoint Linux - Hardware 2 07-25-2005 06:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:02 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration