New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yaourt - tmpfs error: No space left on device #47

Closed
csanyipal opened this Issue Jul 19, 2014 · 10 comments

Comments

Projects
None yet
8 participants
@csanyipal

csanyipal commented Jul 19, 2014

Hi,

I have been told on aur-general@archlinux.org mailing list that that this problem
should be post here too, because this is a yaourt problem.

So, the story is as it follows.

I was tried to install on my archlinux system icecat with yaourt but get always error: No
space left on device.

$ df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 66G 38G 26G 60% /
tmpfs 3.2G 0 3.2G 0% /dev/shm
tmpfs 3.2G 0 3.2G 0% /sys/fs/cgroup
tmpfs 3.2G 3.2G 160k 100% /tmp
tmpfs 627M 4.1k 627M 1% /run/user/1000

I have installed my arch linux on one partition only, on /dev/sda3.

I tried to install icecat several times, moreover after a reboot too, but always get this error message.

I tried also to setup yaourt and makepkg:
/etc/yaourtrc
TMPDIR="/tmp"

/etc/makepkg.conf
BUILDDIR=/tmp/makepkg

Still get the above error.

$ free -h

total used free shared buffers cached
Mem: 5.8G 4.2G 1.6G 2.9G 64M 3.2G
-/+ buffers/cache: 928M 4.9G
Swap: 511M 0B 511M

/etc/fstab

/dev/sda3 / ext4 rw,relatime,data=ordered 0 1
/dev/cdrom /media/cdrom iso9660 ro,user,noauto,unhide 0 0
/swapfile none swap defaults 0 0

On the arch-general mailing list I get the following advices.

  • From Daniel Micay:
    Stop building a very large package in a filesystem of very limited size.
    The BUILDDIR option is unset by default, and if you leave it unset
    makepkg will work fine.
  • From me:
    Before I edited the file: /etc/makepkg.conf

I tried to install with yaourt the icecat package but get the same
error message.
That is way I edited the /etc/makepkg.conf file and set the BUILDDIR option to:
BUILDDIR=/tmp/makepkg

So, leaving it unset doesn't work here.

  • From Daniel Micay:
    Leave it unset and build with makepkg directly.

Set BUILDDIR=/var/tmp instead, /tmp is filling up.

Or just use the default of not building in a global directory...
especially /tmp which is a ramdisk.

  • From Mark Lee:
    I just looked at yaourt's yaourtrc and it's clear that it's storing
    its temporary files in /tmp. Building with yaourt means building in
    tmpfs which would for large compilation jobs can exhaust the tmpfs
    file system. Either extend the size of /tmp by specifying a larger
    size when mounting in /tmp (using fstab or just command line) or set a
    different direcotry via yaourt --tmp .

This should really be posted to the AUR mailing list since it's an AUR
issue. I hope this helps.

  • From Ralf Mardorf:
    [rocketmouse@archlinux ~]$ grep tmp /etc/fstab
    #tmpfs /tmp tmpfs nodev,nosuid,size=3G 0 0

It's commented out, but I once had to use it and it solved the issue for
me.

  • From John Broggs:
    The best way to overcome this error is to allocate the space you need in
    fstab as per the instructions on the fstab page on ArchWiki.
  • From Bigby James:
    systemd will allocate /tmp to a ramdisk by default, whether you specify it or
    not. Specifying tmpfs in /etc/fstab allows you to dictate how large the ramdisk
    is, but unless you explicitly stop systemd from mounting /tmp in RAM that's
    where it will go.

I solve this problem by building icecat directly with makepkg.

So, why can't I setup yaourt in /etc/yaourtrc wuth the line:
TMPDIR="/tmp"
to uses the /tmp directory in the / directory? Why it always uses the tmpfs in the RAM memory?

Regards, from Pal

@Long-Cao

This comment has been minimized.

Show comment
Hide comment
@Long-Cao

Long-Cao Jul 31, 2014

"Why it always uses the tmpfs in the RAM memory?"
AFAIK, you have some misunderstanding here.
tmpfs is a filesystem, and /tmp is a directory. For instance, ext4,NTFS are filesystems, while / or /media/Windows are directories.
So when your system boots up, it automatically mounts those device/directory with the corresponding filesystem by looking up the /etc/fstab. Like mounting /dev/sda1 to / as ext4, or /tmp to your RAM (kinda like a RAMdisk) as tmpfs.
Different filesystem has different way to store/process the data. That's why ext4 tends to be less fragmented that NTFS. The benefit of having a build directory in your RAM is to speed up the build process by taking advantage of RAM read-write rate.

"yaourt - tmpfs error: No space left on device"
You may come accross this issue when your data excess the directory's capacity. Look at the output of "df -H":
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.2G 3.2G 160k 100% /tmp
As you may see, directory /tmp (where yaourt store its temporary data like source package) is mounted as a tmpfs with a capacity of 3.2GB (usually half your RAM, but IIRC the percentage could be configed). And its availability is only 160KB left, while %usage is 100%!!! That's the reason yaourt(exactly makepkg) is not able to build your package anymore as long as your don't have any spare RAM space.

My suggestion is to configure TMPDIR pointing to another directory mounted as ext4 or NTFS in your HDD. The build speed might be slow, but you have enough diskspace to complete the process.

Hope my answer help, and good luck :D

Long-Cao commented Jul 31, 2014

"Why it always uses the tmpfs in the RAM memory?"
AFAIK, you have some misunderstanding here.
tmpfs is a filesystem, and /tmp is a directory. For instance, ext4,NTFS are filesystems, while / or /media/Windows are directories.
So when your system boots up, it automatically mounts those device/directory with the corresponding filesystem by looking up the /etc/fstab. Like mounting /dev/sda1 to / as ext4, or /tmp to your RAM (kinda like a RAMdisk) as tmpfs.
Different filesystem has different way to store/process the data. That's why ext4 tends to be less fragmented that NTFS. The benefit of having a build directory in your RAM is to speed up the build process by taking advantage of RAM read-write rate.

"yaourt - tmpfs error: No space left on device"
You may come accross this issue when your data excess the directory's capacity. Look at the output of "df -H":
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.2G 3.2G 160k 100% /tmp
As you may see, directory /tmp (where yaourt store its temporary data like source package) is mounted as a tmpfs with a capacity of 3.2GB (usually half your RAM, but IIRC the percentage could be configed). And its availability is only 160KB left, while %usage is 100%!!! That's the reason yaourt(exactly makepkg) is not able to build your package anymore as long as your don't have any spare RAM space.

My suggestion is to configure TMPDIR pointing to another directory mounted as ext4 or NTFS in your HDD. The build speed might be slow, but you have enough diskspace to complete the process.

Hope my answer help, and good luck :D

@tuxce tuxce closed this Jan 8, 2015

@mirh

This comment has been minimized.

Show comment
Hide comment
@mirh

mirh Feb 24, 2016

Why can't yaourt just use a temporary folder on the hdd?

mirh commented Feb 24, 2016

Why can't yaourt just use a temporary folder on the hdd?

@f2404

This comment has been minimized.

Show comment
Hide comment
@f2404

f2404 Feb 24, 2016

Collaborator

The user has decided to use their RAM for the /tmp directory, why should not yaourt obey this decision?

Collaborator

f2404 commented Feb 24, 2016

The user has decided to use their RAM for the /tmp directory, why should not yaourt obey this decision?

@Mikaela

This comment has been minimized.

Show comment
Hide comment
@Mikaela

Mikaela Feb 24, 2016

The user has decided to use their RAM for the /tmp directory, why should not yaourt obey this decision?

I am sure that Arch Linux has decided that or some part of it as /tmp is tmpfs by default and I don't have it specified in my fstab.

When I encounter this issue, I just tell yaourt to use /var/tmp instead.

Mikaela commented Feb 24, 2016

The user has decided to use their RAM for the /tmp directory, why should not yaourt obey this decision?

I am sure that Arch Linux has decided that or some part of it as /tmp is tmpfs by default and I don't have it specified in my fstab.

When I encounter this issue, I just tell yaourt to use /var/tmp instead.

@f2404

This comment has been minimized.

Show comment
Hide comment
@f2404

f2404 Feb 24, 2016

Collaborator

Looks like it's systemd that automatically mounts /tmp as tmpfs: https://wiki.archlinux.org/index.php/Tmpfs#Disable_automatic_mount
The same link contains instructions on overriding the default behavior.

Collaborator

f2404 commented Feb 24, 2016

Looks like it's systemd that automatically mounts /tmp as tmpfs: https://wiki.archlinux.org/index.php/Tmpfs#Disable_automatic_mount
The same link contains instructions on overriding the default behavior.

@mirh

This comment has been minimized.

Show comment
Hide comment
@mirh

mirh Feb 24, 2016

Oh, I guess this way everything makes sense then.

Could the error message be a bit more clearer though?
I mean.. It's not 100% "automatic" to realize what device we are even talking about in the first place, if I can explain.

mirh commented Feb 24, 2016

Oh, I guess this way everything makes sense then.

Could the error message be a bit more clearer though?
I mean.. It's not 100% "automatic" to realize what device we are even talking about in the first place, if I can explain.

@f2404

This comment has been minimized.

Show comment
Hide comment
@f2404

f2404 Feb 25, 2016

Collaborator

@mirh This message is not produced by yaourt. Like it's stated above, it's more likely produced by makepkg. But even makepkg does not own the message; it's a standard Linux error produced when attempting to write on a device which has no free space.

Collaborator

f2404 commented Feb 25, 2016

@mirh This message is not produced by yaourt. Like it's stated above, it's more likely produced by makepkg. But even makepkg does not own the message; it's a standard Linux error produced when attempting to write on a device which has no free space.

@zygimantus

This comment has been minimized.

Show comment
Hide comment
@zygimantus

zygimantus Sep 29, 2016

So how to change /tmp folder to another?

zygimantus commented Sep 29, 2016

So how to change /tmp folder to another?

@f2404

This comment has been minimized.

Show comment
Hide comment
@f2404

f2404 Sep 29, 2016

Collaborator
$ man yaourt

       --tmp <dir>
           Use <dir> as temporary folder. default to /tmp
Collaborator

f2404 commented Sep 29, 2016

$ man yaourt

       --tmp <dir>
           Use <dir> as temporary folder. default to /tmp
@mathieujobin

This comment has been minimized.

Show comment
Hide comment
@mathieujobin

mathieujobin Mar 6, 2017

i did this to install a package that was taking more tmp space I had available

export TMPDIR=/opt/tmp
yaourt -S rocketchat-server

thanks

mathieujobin commented Mar 6, 2017

i did this to install a package that was taking more tmp space I had available

export TMPDIR=/opt/tmp
yaourt -S rocketchat-server

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment