We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

Change /tmp size [answered]

asked 2016-12-05 21:43:29 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2016-12-05 21:43:52 +0300

SebM gravatar image

Hi,

I need to grow the /tmp filesystem a little, how can I do that ?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by SebM
close date 2016-12-06 10:39:47.928644

Comments

you could mount a different partition/file on said mount point

till ( 2016-12-05 22:42:00 +0300 )edit

That's a good workaround but I don't a spare filesystem to do that.

My option is to grow /tmp FS,

On my Ubuntu, there is a "/etc/fstab" line for that but I don't see a "/tmp" in my "fstab" on my Jolla and still "/tmp" is there.

I wonder how it works.

SebM ( 2016-12-06 08:51:28 +0300 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2016-12-06 09:07:23 +0300

rinigus gravatar image

these days, /tmp is mounted usually on tmpfs. Tmpfs is RAM-based (https://en.wikipedia.org/wiki/Tmpfs) and default allocation is usually 1/2 RAM. Its a max and if is less data on the filesystem, only that part of RAM would be used.

You can in theory increase /tmp by increasing its allocation in RAM (see tmpfs mount options). However, beware that you might get too little RAM for other applications.

Alternative is to make subdir in /home and use that instead of /tmp in your programs.

There are many other alternatives that you could consider, its too many to list here and they would depend on your specific needs.

edit flag offensive delete publish link more

Comments

@rinigus You are right and I know about tmpfs already.

On my ubuntu there an explicit "tmpfs" mount line for "/tmp" but here have I nothing in my Jolla fstab :

$ grep /tmp /etc/fstab
$

I just wonder how it works if it not explicitly mounted via a fstab description line.

SebM ( 2016-12-06 10:17:27 +0300 )edit

Its mounted by systemd during boot, so you have to look for systemd configs. But I think if you start even approaching to consuming 1/2 of your phone RAM, you maybe in trouble. Unless you have a phone with lots of it (3GB is a max for full-blown SFOS at present due to the non-finished 64-bit ports). I wouldn't risk to get to 1GB RAM consumption even with 2GB RAM phones - your apps may start to get killed.

You can probably make a /home/tmp dir and use that for this purpose. No mount is necessary then, just adjust permissions and point your program over there (might need to modify its source).

rinigus ( 2016-12-06 10:32:25 +0300 )edit

@rinigus Thanks a lot for your explanation :)

SebM ( 2016-12-06 10:39:10 +0300 )edit

@SebM You are welcome. Good luck!

rinigus ( 2016-12-06 10:42:22 +0300 )edit
1

alternatively you can bind-mount (eg mount -o bind /home/tmp /tmp), but beware that existing files in /tmp are no longer accessible in this case

till ( 2016-12-06 11:36:41 +0300 )edit

Question tools

Follow
1 follower

Stats

Asked: 2016-12-05 21:43:29 +0300

Seen: 284 times

Last updated: Dec 06 '16