0

I tired to increase the swap area by from here Keep saying no space left on the device. Then I used gparted to swapon and I get the previous swap.

I don't want to resize the swap, just fix the error and free the root. It was 35% used before I try to change the size of swap.

Now the root is full. and tab completion give the followng error.

bash: cannot create temp file for here-document: No space left on device
        -bash: cannot create temp file for here-document: No space left on device

what is the solution?

 df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             32G     0   32G   0% /dev
tmpfs           6.3G  2.1M  6.3G   1% /run
/dev/sda1        55G   55G     0 100% /
tmpfs            32G     0   32G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            32G     0   32G   0% /sys/fs/cgroup
/dev/loop0       43M   43M     0 100% /snap/gtk-common-themes/1313
/dev/loop1       90M   90M     0 100% /snap/core/7917
/dev/loop2      3.8M  3.8M     0 100% /snap/gnome-system-monitor/100
/dev/loop3       45M   45M     0 100% /snap/gtk-common-themes/1353
/dev/loop4      141M  141M     0 100% /snap/gnome-3-26-1604/97
/dev/loop5       15M   15M     0 100% /snap/gnome-characters/359
/dev/loop6       90M   90M     0 100% /snap/core/8039
/dev/sdb1       1.8T  118G  1.6T   7% /hdd1
/dev/sdc1       1.8T   57G  1.7T   4% /hdd2
/dev/loop7      1.0M  1.0M     0 100% /snap/gnome-logs/81
/dev/loop8       15M   15M     0 100% /snap/gnome-characters/317
/dev/loop10     141M  141M     0 100% /snap/gnome-3-26-1604/94
/dev/loop9       55M   55M     0 100% /snap/core18/1265
/dev/loop11     157M  157M     0 100% /snap/gnome-3-28-1804/91
/dev/sda3       803G  402G  360G  53% /home
/dev/loop12     3.8M  3.8M     0 100% /snap/gnome-system-monitor/107
/dev/loop13      55M   55M     0 100% /snap/core18/1223
/dev/loop14     1.0M  1.0M     0 100% /snap/gnome-logs/73
/dev/loop15     4.3M  4.3M     0 100% /snap/gnome-calculator/536
/dev/loop16     4.3M  4.3M     0 100% /snap/gnome-calculator/544
/dev/loop17     150M  150M     0 100% /snap/gnome-3-28-1804/71
tmpfs           6.3G     0  6.3G   0% /run/user/1001

enter image description here

4
  • No not related.
    – Abolfazl
    Nov 11 '19 at 19:12
  • So...are you asking how to determine what's filling your / filesystem?
    – user535733
    Nov 11 '19 at 19:13
  • Yes, exactly...
    – Abolfazl
    Nov 11 '19 at 19:14
  • 59G for a swap partition is nuts. Why do you think you need that? What you should do is resize (down) your swap partition, and resize (up) your / partition.
    – heynnema
    Nov 11 '19 at 20:31
5

Probably you also created a swap file in your root partition.

If that is the case you will need to make some room first, for example by doing an rm /var/cache/apt/archives/* (it's like apt-clean but simpler). If not even that will work, try to cd /var/cache/apt/archives/ then do ls and try to remove a couple of files individually, before you retry the rm /var/cache/apt/archives/*

Then, you have to remove the swap file (not partition). Try to find a huge file in your disk with something like:

$ sudo find / -type f -size +1G

If you find it, you remove it and you will reclaim the space. You might have to do a

$ swapoff -a

before you cat remove it.

1
  • 2
    I found 9.4G /swapfile. Well that free some space. about 15%.
    – Abolfazl
    Nov 11 '19 at 19:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.