Score:0

How to fix: "No Space left on device" on /tmp

tz flag

I'm facing an issue where my program won't compile due to no device space in the /tmp folder. After a little examine and deleting all files on tmp it stills shows me the same error: enter image description here

after system reboot the problem solves but it is back after few compiles, is there any solution to this problem that do not include restarting my computer every 10 min?

p.s this is what the terminal shows on 'df /tmp' command: enter image description here

and this is what 'gparted' command gets me: enter image description here

thanks in advance for all advises! :)

David avatar
cn flag
Did you make a separate partition for tmp? What is the version of Ubuntu?
FedKad avatar
cn flag
Your root filesystem (containing the `/tmp` directory also) is too small. Look for similar questions (like "no space left on root file system") in AskUbuntu.
Kali C avatar
tz flag
@David no just a partition for storage and swap memory if I remember correctly (is there a way to check?), and I'm using Ubuntu 22.04
David avatar
cn flag
Run gparted and post the pic in your question.
Kali C avatar
tz flag
@David added the pic
pLumo avatar
in flag
Please check [Ubuntu System requirements](https://help.ubuntu.com/community/Installation/SystemRequirements), it says you 25G of disk space is the **recommended minimum**, but you have given only 18G. So it's normal.
Kali C avatar
tz flag
@pLumo is there a way to change it without uninstalling Ubuntu and reinstall it again? I gave Ubuntu 100 GiB in total
David avatar
cn flag
Since Ubuntu 22.04 uses snaps more like 50 is a better idea but like @pLumo said you do not even have the bare min. You would have been better off to have not made all these partitions and let Ubuntu set them up you would not have run out of space.
hr flag
`gcc` should respect a `TMPDIR` environment variable, so you could try creating a `$HOME/tmp` directory for example and exporting `TMPDIR=$HOME/tmp` before starting the build
Score:0
in flag

Your best bet would be to reinstall and don't use separate partitions. Also you don't need a separate swap partition, but have a swapfile.

However, you can fix your current setup if you integrate your /home into your / partition, then you have ~50G for everything, which is not perfect, but would work for now.

Do all following steps from an Ubuntu live session.

  1. Backup your complete /home to an external drive or some other partition with free space, make sure to preserve permissions.
  2. Delete the /home partition (nvme01np9), do not format, but leave as unallocated space.
  3. Enlarge / partition (nvme01np8) with the now free space.
  4. Mount your / partition and open /path/to/mount_point
  5. Remove the line that mounts your /home from /path/to/mount_point/etc/fstab
  6. Copy back your backup to /path/to/mount_point/home, make sure to preserve permissions and check that you don't have duplicate "home" e.g. .../home/home/username.
  7. Reboot system.
Kali C avatar
tz flag
Backed up my home directory, removed the partition (nvme01np9), resized / (nvme01np8) to get the newly freed space. Where do I now mount the nvme01np8 partition, and how to do it? Thanks in advance for all your help, and sorry for the late response, could only try it on the weekend so I won’t miss any work hours
pLumo avatar
in flag
Something like this ... `mkdir /tmp/mnt; mount /dev/nvme01np8 /tmp/mnt`, then use `/tmp/mnt/etc/fstab` and `/tmp/mnt/home`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.