Makepkg failed on tmpfs

Install xmake in aur

https://aur.archlinux.org/packages/xmake/

$ cat /etc/fstab
...
tmpfs /var/tmp tmpfs rw,noatime,nodiratime,nodev,noexec,nosuid,nr_inodes=5K,size=4G,mode=1700 0 0
...
$ sudo du -hs /var/tmp
0       /var/tmp
$ makepkg
...
==> Entering fakeroot environment...
==> Starting package()...
installing to /var/tmp/pamac-build-alg/xmake/pkg/xmake//usr ...
plat: linux
arch: x86_64
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/#target#.vcxproj.filters': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.obj(fileobj)': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include.natvis(incnatvis)': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.ui(fileui)': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.cu(filecu)': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/File.c(filec)': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Include.c(incc)': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/vcxproj.filters/Filter(dir)': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/sln': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.targets': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.props': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/templates/Xmake.Custom.items.filters': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/Xmake.props': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/Xmake.xml': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/Xmake.targets': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsproj/Xmake.Defaults.props': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/getinfo.lua': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/vsxmake.lua': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vsxmake/render.lua': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/clang': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/cmake': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/vstudio': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/ninja': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/make': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/xmake.lua': No space left on device
cp: cannot create regular file '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/project/main.lua': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/macro': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/doxygen': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/service': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/plugins/repo': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/repository': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/rules': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/scripts': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/templates': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/themes': No space left on device
cp: cannot create directory '/var/tmp/pamac-build-alg/xmake/pkg/xmake//usr/share/xmake/toolchains': No space left on device
make: *** [makefile:114: install] Error 1
==> ERROR: A failure occurred in package().
    Aborting...
...

If do it in ~, which is not ext4 instead of tmpfs, it succeeds.

Why it failed on tmpfs? How to solve?

/var/tmp is on your filesystem - it is not tmpfs - so this could indicate problems with the filesystem.

Reboot on a live ISO and run fsck on your root partition

(Emphasis mine)
Tmpfs is actually on RAM/swap, that should give you an idea of how much space you have.


Despite their entry in fstab?
Or rather, should they have that entry (AFAIK only /tmp should be tmpfs)?

/var/tmp is tmpfs as df shows

$ df
Filesystem      Size  Used Avail Use% Mounted on
...
tmpfs           4.0G     0  4.0G   0% /var/tmp
...

I missed that one.

If /var/tmp is using tmpfs - the configuration is not default and as such system can run out of diskspace on /var/tmp.

/tmp on the other hand is tmpfs - excerpt from my system

➜  ~ df         
Filesystem      Size  Used Avail Use% Mounted on
dev              32G     0   32G   0% /dev
run              32G  1,3M   32G   1% /run
/dev/nvme0n1p2  460G   34G  403G   8% /
tmpfs            32G     0   32G   0% /dev/shm
tmpfs            32G   51M   32G   1% /tmp
/dev/nvme0n1p1  300M  288K  300M   1% /boot/efi
tmpfs           6,3G   44K  6,3G   1% /run/user/1000

swap is not used, free ram is 10G+

both /tmp and /var/tmp are tmpfs

$ df
Filesystem      Size  Used Avail Use% Mounted on
...
tmpfs           7.8G   15M  7.8G   1% /tmp
...
tmpfs           4.0G     0  4.0G   0% /var/tmp
...

Some directories where tmpfs(5) is commonly used are /tmp, /var/lock and /var/run. Do not use it on /var/tmp, because that folder is meant for temporary files that are preserved across reboots.

https://wiki.archlinux.org/title/Tmpfs

You likely should edit your fstab so that /var/tmp does not use tmpfs.

2 Likes

Just want to know what causes the error

It probably has to do with the mount options you set for that partition, like nr_inodes=5K and size=4G which explicitly restrict what is available.
man mount
man tmpfs

For a small utility, nr_inodes=5K and size=4G must be enough.
/var/tmp contian no other files except 3 empty folders.

The error you got tells the opposite…

At the moment, but not after you start makepkg . So run makepkg and monitor the free space.

1 Like

As the logs below show, maybe nr_inodes=5K is not enough

$ df
Filesystem      Size  Used Avail Use% Mounted on
...
tmpfs           4.0G     0  4.0G   0% /var/tmp
...

$ free -h
               total        used        free      shared  buff/cache   available
Mem:            15Gi       2.6Gi       9.8Gi       851Mi       3.1Gi        11Gi
Swap:             0B          0B          0B


$ sudo du -hs /var/tmp/
...
0       /var/tmp/

$ cd /var/tmp
$ git clone https://aur.archlinux.org/xmake.git
$ cd xmake
$ makepkg
...
make: *** [makefile:114: install] Error 1
==> ERROR: A failure occurred in package().
    Aborting...
$ df
Filesystem      Size  Used Avail Use% Mounted on
...
tmpfs           4.0G   38M  4.0G   1% /var/tmp
...

$ free -h
               total        used        free      shared  buff/cache   available
Mem:            15Gi       2.6Gi       9.7Gi       905Mi       3.1Gi        11Gi
Swap:             0B          0B          0B

$ find . -type f -print | wc -l # file count
4216

EDIT

nr_inodes=5K is changed to nr_inodes=5M, the problem is solved.

Thanks

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.