experchange > freebsd

Philipp Klaus Krause (11-29-19, 12:40 PM)
This is my first encounter with FreeBSD.

I use FreeBSD 12.1 on a Rasberry Pi 3B+ (wrote the image onto a memory
card using dd, later installed some more software using pkg install).

I still have plenty of spacce on /, but I quickly run out of space on
/tmp when using the system.
Is there an easy way to have a bigger /tmp?

Philipp
Bob Eager (11-29-19, 01:27 PM)
On Fri, 29 Nov 2019 11:40:27 +0100, Philipp Klaus Krause wrote:

> This is my first encounter with FreeBSD.
> I use FreeBSD 12.1 on a Rasberry Pi 3B+ (wrote the image onto a memory
> card using dd, later installed some more software using pkg install).
> I still have plenty of spacce on /, but I quickly run out of space on
> /tmp when using the system.
> Is there an easy way to have a bigger /tmp?


Two things.

1) If you have space for another partition, set that up using newfs and
mount it on /tmp, editing /etc/fstab to make it persistent. If you don't,
consider using dd to copy the whole SD card to a bigger one, then you'll
be able to do this anyway.
2) See if one or two programs are using the space. Have a look to see how
to make them use somewhere else. This could be via an environment
variable (e.g. TMPDIR, but it varies), in which case add that to .profile
or .login or whatever your shell uses. Or it could be via a command line
flag, in which case add it as an alias.
Philipp Klaus Krause (11-29-19, 02:21 PM)
I have a 32 GB SD card, wrote the 12.1 image onto it using dd on
GNU/Linux. It looks to me as if all 32 GB were used, nearly all of it
for the root partition.
It would be okay for me to start anew with FreeBSD and loose all data
currently on the card. So how could I get, using my GNU/Linux system,
from the image and my SD card to a situation where I have a bigger /tmp?

Philipp
Per Hedeland (11-29-19, 04:31 PM)
In article <qrr2h2$gf$1> Philipp Klaus Krause <pkk> writes:
>I have a 32 GB SD card, wrote the 12.1 image onto it using dd on
>GNU/Linux.


I assume that you are still talking about a Raspberry Pi image, as in
the post you are following up to - what I write below may apply to
others too, but I only have experience with the RPi images.

> It looks to me as if all 32 GB were used, nearly all of it
>for the root partition.


Yes, the pre-built images use growfs(8) to expand the root partition
to fill the available space on the card on the first boot. It is
possible to prevent this if you modify the image on the card before
booting from it, but it's generally OK.

>It would be okay for me to start anew with FreeBSD and loose all data
>currently on the card. So how could I get, using my GNU/Linux system,
>from the image and my SD card to a situation where I have a bigger /tmp?


/tmp is a tmpfs (i.e. in-memory) filesystem in these images, which is
good(tm) since it reduces the risk of wearing out the SD card with
lots of writes. For your purpose it has the added benefit that you can
modify its size by simply editing /etc/fstab (and rebooting). E.g.

tmpfs /tmp tmpfs rw,mode=1777,size=200m 0 0

will give you 200 MB (the default is size=50m, i.e. 50 MB). Obviously
you have to consider the tradeoff vs using the memory for other
purposes, but the tmpfs file system doesn't "grab" the size that you
specify, it is just the limit, and the actual usage is what you store
in /tmp.

--Per Hedeland
Similar Threads