Home > Blockchain >  Error: ENOSPC: no space left on device, write pm2 server
Error: ENOSPC: no space left on device, write pm2 server

Time:08-16

I am not able to identify what is causing my ec2 disk space to reach 100% of capacity. I have a script which deletes files in tmp folder.But still randomly sometimes my disk capacity reaches 100%. I have attached the logs of df -i to show disk utilization.

Error

PM2        | Error: ENOSPC: no space left on device, write
PM2        |     at Object.writeSync (fs.js:679:3)
PM2        |     at Object.writeFileSync (fs.js:1393:26)
PM2        |     at ProcessContainer (/usr/lib/node_modules/pm2/lib/ProcessContainer.js:70:10)
PM2        |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainer.js:103:3)
PM2        |     at Module._compile (internal/modules/cjs/loader.js:999:30)

I am using command df -i to find enter image description here

enter image description here

du -h -d 1

enter image description here

cd /lib sudo du -h -d 1

enter image description here

CodePudding user response:

You can use the dh utility

cd /
du -h -d 1

it will show the disk usage for every folder in /, then you can cd in the biggest ones and repeat the same.

You can also run

du | sort -n

and you'll get (after a while) all the folders size in the filesystem (ordered by ascending size). By my experience I'd take a first look at /home, /tmp and /var.

CodePudding user response:

Check the user .pm2/logs directory, if your node app as errors or many regular logs this can increase disk space used.

  • Related