Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

i have a digital ocean Ubuntu server, two days ago every page in my website gives me error 500,

in ssh i got this error message "No space left on device",

For more info please check this SSH screenshot

so i restore backup and the server and website works fine now, but it will happen again in near future

and this is the current server status

root@****:~# df -k
Filesystem     1K-blocks     Used Available Use% Mounted on
udev             4077544        4   4077540   1% /dev
tmpfs             817680      340    817340   1% /run
/dev/vda1       82436784 34630128  43596088  45% /
none                   4        0         4   0% /sys/fs/cgroup
none                5120        0      5120   0% /run/lock
none             4088392        0   4088392   0% /run/shm
none              102400        0    102400   0% /run/user
root@****:~# df -i
Filesystem      Inodes   IUsed   IFree IUse% Mounted on
udev           1019386     402 1018984    1% /dev
tmpfs          1022098     319 1021779    1% /run
/dev/vda1      5242880 5014058  228822   96% /
none           1022098       2 1022096    1% /sys/fs/cgroup
none           1022098       5 1022093    1% /run/lock
none           1022098       1 1022097    1% /run/shm
none           1022098       2 1022096    1% /run/user
root@****:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G  4.0K  3.9G   1% /dev
tmpfs           799M  340K  799M   1% /run
/dev/vda1        79G   34G   42G  45% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
none            5.0M     0  5.0M   0% /run/lock
none            3.9G     0  3.9G   0% /run/shm
none            100M     0  100M   0% /run/user
root@****:~# ls /tmp/
root@****:~# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/vda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/vda: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders, total 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1               1   167772159    83886079+  ee  GPT

Thanks in advance

like image 865
Fathi Avatar asked Nov 08 '22 10:11

Fathi


2 Answers

Please try to use commands to resolve your issue:

root@****:~# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 150G 0 disk
└─xvda1 202:1 0 8G 0 part /

root@****:~# df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.8G  4.5G  2.9G  61% /
tmpfs            32G     0   32G   0% /dev/shm

Looking at above thing it seems that EBS is having 150 GB but the root partition is only 8 GB.

So to resize EBS Root Volume

root@****:~# sudo growpart /dev/xvda 1

To install "growpart" use

root@****:~# sudo yum install -y cloud-init dracut-modules-growroot

And restart the engine.

like image 71
Mahendra Andhale Avatar answered Nov 09 '22 22:11

Mahendra Andhale


You can try this, it worked for me:

sudo apt-get autoclean
like image 41
DARK_C0D3R Avatar answered Nov 10 '22 00:11

DARK_C0D3R