Baremetal tmpfs size

364 views
Skip to first unread message

Vince Telvary

unread,
Jul 15, 2014, 11:53:19 AM7/15/14
to coreo...@googlegroups.com
Hi,

By default the tmpfs uses 50% of the RAM. I'd like to reduce it to a fixed value (2Go). 
I added "rootflags=size=2g" at the kernel command but it only works for the rootfs :

core@localhost ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          2.0G  168K  2.0G   1% /
devtmpfs         48G     0   48G   0% /dev
tmpfs            48G     0   48G   0% /dev/shm
tmpfs            48G   17M   48G   1% /run
tmpfs            48G     0   48G   0% /sys/fs/cgroup
tmpfs           2.0G  168K  2.0G   1% /
/dev/loop0      107M  107M     0 100% /usr
tmpfs            48G     0   48G   0% /tmp
tmpfs            48G     0   48G   0% /media

Any idea ?

Thanks.

fabio fumarola

unread,
Jan 20, 2015, 2:41:15 AM1/20/15
to coreo...@googlegroups.com
Dear Vince, I have the same problem. Thanks you gave me an hint. Did you solve the problem?

Michael Marineau

unread,
Jan 21, 2015, 1:19:05 AM1/21/15
to Vince Telvary, coreos-user
tmpfs doesn't "use" 50% of ram, that is just the default maximum size.
It only uses however much data is written to it. So the only reason to
adjust the size is if you need to limit the amount of data that can be
written to any particular tmpfs. Most of the time this isn't
necessary. For systems with a persistent root partition a traditional
/etc/fstab can be used to adjust the mount options. So to limit the
size of /tmp the following should work:

tmpfs /tmp tmpfs size=2G 0 0

For PXE systems there isn't an option I can think of that will let you
specify the limit in advance but you can always remount the
filesystems afterwards to apply the new limit:

mount -o remount,size=2G /tmp
> --
> You received this message because you are subscribed to the Google Groups
> "CoreOS User" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to coreos-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages