You are not logged in.

#1 2003-08-30 16:15:19

Ghost Dawg
Member
From: Third Stone from the Sun
Registered: 2002-10-28
Posts: 47

Tmpfs is Huge

I was looking over my /etc/fstab and noticed that the tmpfs is over 2gb is size, why is it that big?

tmpfs                  /tmp      tmpfs     size=2G,nr_inodes=10k  0      0

With other distros, I never noticed it that big. I thought it is part of the root partition.

Thnx.


Drink Pepsi, the new generation, get Linux!

Offline

#2 2003-08-30 20:45:41

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Tmpfs is Huge

heh. mine is puny. far too small actually. it is about 256 or some dumb number like that which makes it very hard to download isos and such with web brwosers.

i think the size of tmp can be set in /etc/fstab


AKA uknowme

I am not your friend

Offline

#3 2003-10-07 16:47:24

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

Re: Tmpfs is Huge

Alert to all Dev's:

I was just google'n on the 'tmpfs fstab' and I came across the post from a guy, whom I think added 'tmpfs' to the kernel, and he says:

[regarding the 'tmpfs' and mounting]

+3) Some people (including me) find it very convenient to mount it
+   e.g. on /tmp and /var/tmp and have a big swap partition. But be
+   aware: loop mounts of tmpfs files do not work due to the internal
+   design. So mkinitrd shipped by most distributions will fail with a
+   tmpfs /tmp.
+
+4) And probably a lot more I do not know about :-)
+
+
+tmpfs has a couple of mount options:
+
+size:    The limit of allocated bytes for this tmpfs instance. The
+           default is half of your physical RAM without swap. If you
+    oversize your tmpfs instances the machine will deadlock
+    since the OOM handler will not be able to free that memory.
+nr_blocks: The same as size, but in blocks of PAGECACHE_SIZE.
+nr_inodes: The maximum number of inodes for this instance. The default
+           is half of the number of your physical RAM pages.
+
+These parameters accept a suffix k, m or g for kilo, mega and giga and
+can be changed on remount.
+
+The initial permissions of the root directory can be set with the
+mount option "mode". Later on you can change the permissions of the
+root directory with chmod.
+
+So 'mount -t tmpfs -o size=10G,nr_inodes=10k,mode=0700 tmpfs /mytmpfs'
+will give you tmpfs instance on /mytmpfs which can allocate 10GB
+RAM/SWAP in 10240 inodes and it is only accessible by root.
+
+
+TODOs:
+
+1) give the size option a percent semantic: If you give a mount option
+   size=50% the tmpfs instance should be able to grow to 50 percent of
+   RAM + swap. So the instance should adapt autatically if you add or
+   remove swap space.
+2) loop mounts: This is difficult since loop.c relies on the readpage
+   operation. This operation gets a page from the caller to be filled
+   with the content of the file at that position. But tmpfs always has
+   the page and thus cannot copy the content to the given page. So it
+   cannot provide this operation. The VM had to be changed seriously
+   to achieve this.
+3) Show the number of tmpfs RAM pages. (As shared?)
+
+
+Author:
+   Christoph Rohland <cr@sap.com>, 1.12.01


SOURCE POST:
http://groups.google.com/groups?q=autho … al&rnum=45


Am I to understand that we, in ArchLinux, _do_ or _don't do_ the part about:

+3) Some people (including me) find it very convenient to mount it
+   e.g. on /tmp and /var/tmp and have a big swap partition. But be
+   aware: loop mounts of tmpfs files do not work due to the internal
+   design. So mkinitrd shipped by most distributions will fail with a
+   tmpfs /tmp.

Just wondering.  Thanx.


-- Linux!  Isn't it time?

Offline

#4 2003-10-07 17:02:20

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Tmpfs is Huge

i, personally, do not like the allocation of 2GB of space to tmpfs so i just remove the size and nr_nodes parameter with "defaults". i may hinder myself a bit on occassion with this but when you have a few hard drives thyat have less than 6 GB on them it is not very desirable to lose 2GB to tmpfs


AKA uknowme

I am not your friend

Offline

#5 2003-10-07 17:24:03

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

Re: Tmpfs is Huge

Sarah,

Yah, I just learned 'bout that when I was try'n to d/l an ISO and kept get'n 'out-of-space' errors.  Is there any other way to get the kernel to use actual physical space to cache d/l's?


-- Linux!  Isn't it time?

Offline

#6 2003-10-07 20:53:15

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Tmpfs is Huge

yeah use wget to download large files.


AKA uknowme

I am not your friend

Offline

#7 2003-10-07 22:30:20

marin_linuxer
Member
From: San Rafael, CA U.S.A.
Registered: 2003-09-03
Posts: 111
Website

Re: Tmpfs is Huge

sarah31 wrote:

yeah use wget to download large files.

DOH! I forgot wget ... (brilliant little proggy).  Thanx!


-- Linux!  Isn't it time?

Offline

#8 2003-10-08 04:11:48

Jagged
Member
From: Blacksburg, VA
Registered: 2003-07-18
Posts: 153

Re: Tmpfs is Huge

i just remove tmpfs alltogether, and modify the shutdown scripts to cleanup the tmp dirs.

i do however maintain a tmpfs in /dev/shm in case i need it for something... but its set at default (4096K). tmpfs has the ability to grow dynamically


Nkawtg...n!

Offline

Board footer

Powered by FluxBB