Click here to Skip to main content
15,306,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i try to compile my code in c with the command the following error showus up :

fib_slow.c:14:1: fatal error: error closing /tmp/cc7nssUG.s: No space left on device
   14 | }
      | ^
compilation terminated.


What I have tried:

..................................................
Posted
Updated 2-May-21 16:05pm
v2

There's two probably issues. 1) your root partition is full, and 2) you have /tmp mounted as a RAM disk, and so you are out of RAM.
To determine which problem you face, use the df command:
$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
devtmpfs                      16G     0   16G   0% /dev
tmpfs                         16G  126M   16G   1% /dev/shm
tmpfs                        6.3G  2.0M  6.3G   1% /run
/dev/nvme0n1p3               120G   39G   81G  33% /
tmpfs                         16G   79M   16G   1% /tmp
/dev/nvme0n1p2               976M  425M  485M  47% /boot
/dev/nvme0n1p1               599M   78M  522M  13% /boot/efi
/dev/mapper/ebhomeVg01-home  512G  107G  405G  21% /home
tmpfs                        3.2G  152K  3.2G   1% /run/user/1001
Here we can see that my root partition / has 39 G of 120 G free, and /tmp has a filesystem type of tmpfs, which means its held in RAM, not on a physical disk. If you do not have a /tmp filesystem in the output for your system, then it means that /tmp will be sharing space with your root partition.

If you are using tmpfs for /tmp, and it is full, then the quickest way to recover the space would be to reboot your system. Be aware that this means that anything held in /tmp will be gone, so if you are storing stuff in /tmp that you will need later, copy it somewhere else (like your home directory) first. In general, its a bad idea to store anything not of a temporary or "scratch" nature in /tmp, as the system does see it as temporary and is free to remove files and data as it sees fit. I have seen this happen.

If you are not using tmpfs for /tmp, and your root partition is full, then you will need to find out where all your space has gone. I like to use the du command for this. As root, cd / then do an ls and then du -sh dir1 dir2 dir3 ... where dir1 dir2, etc are directories NOT listed in the output to df. This should produce something like
# du -sh etc mnt opt root usr var
46M     etc
0       mnt
1.1G    opt
852M    root
33G     usr
3.8G    var
Which will show you the disk usage of the directories. If you wanted to take a further look at /opt, for example, you could then
# cd /opt
# du -sh  * .??* 
This will break down the disk usage for all the files and directoris in /opt, including hidden files and directories (e.g. .config, or .local). You should be able to find out what's consuming your disk space, and then make decisions about what to remove. That might not be obvious - there are some large files that are needed by the OS to run, so don't remove them. In general you will be looking for files that are owned by you, or are log files that can be trimmed and/or removed.
   
Comments
CPallini 3-May-21 2:08am
   
5.
Google the error message: "no space left on device[^]"

Chances are high you have a full drive.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900