New on LowEndTalk? Please Register and read our Community Rules.
Help - VPS is reaching limit of disk space
Hi all!
I have a vps running on a 5gb nvme ryzen.
I have installed ubuntu 20.04 LTS and it's running openvpn / wireguard and 1 or 2 app's more...
[email protected]_ik:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 448M 0 448M 0% /dev
tmpfs 99M 5.6M 93M 6% /run
/dev/vda1 3.8G 3.7G 100M 99% /
tmpfs 491M 0 491M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 491M 0 491M 0% /sys/fs/cgroup
tmpfs 99M 0 99M 0% /run/user/0
I have done this
sudo bash -c "apt-get update && apt-get -y upgrade && apt-get -y autoremove && apt-get -y clean
However, "just" clean no more than 80/100M
What more can I doo?
Any script to run a x times per month to clean some garbage that I don't need?
Comments
Increase disk space of your VPS !
Find what is using the space.
Upgrade storage on your VPS. Contact your provider, to see if you can get a custom quote if the current VPS specs wise is enough, and you just need more storage.
My Blog rafalblog.xyz
Contabo GmbH insanely cheap VPS | Racknerd LLC Amazing price to performance ratio(aff) (noaff)
increase your budget and upgrade vps.
Recurring 35% off on Cheap Dedicated Servers in USA with 200TB Monthly Bandwidth ||
Cheap Web Hosting Services in business since 2014
tune2fs -m 1 /dev/vda1
Might save you a tiny bit of space and buy some time to upgrade/migrate.
explanation.
ext4 filesystems as standard reserve 5% of a partitions total allocated disk space to preserve the filesystem in case you do actually run out of space, this was a standard used when disks were much smaller, with today's larger disks it is usually safe to reduce this amount.
That said it is on a 5GB disk so you need to be careful here, you can push it to 0 instead of 1% (the -m 1) but if you hit 100% you will start to lose data potentially.
5gb is little disk space tho
run
du -d 1 -h / | sort -h
further investigate by either increasing -d param to >1 or change dir to prior result
What's with all the "upgrade" comments... for the intended use 5GB is plenty. Here's a 5GB VPS with CentOS nested on a 1.5 GB partition:
OP needs to distinguish whether (a) the disk is already ~100% full when everything is first installed, or whether it is getting filled up over time - in which case it is most likely logs, cache, etc.; and (b) possibly consider a different distro.
logfiles?
UltraVPS.eu KVM in US/UK/NL/DE: 15% off first 6 month | Netcup VPS/rootDS - 5€ off: 36nc15279180197 (ref)
well, at this provider, it's not possible
Change providers @dustinc (racknerd, look at my signature) might be able to help you and give u a nice VPS for really cheap.
My Blog rafalblog.xyz
Contabo GmbH insanely cheap VPS | Racknerd LLC Amazing price to performance ratio(aff) (noaff)
Your signature violates the rules
I have a 5gb VPS, too;
Filesystem Size Used Avail Use% Mounted on
udev 480M 0 480M 0% /dev
tmpfs 99M 12M 88M 12% /run
/dev/sda1 5.0G 4.2G 479M 90% /
tmpfs 494M 0 494M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 494M 0 494M 0% /sys/fs/cgroup
tmpfs 99M 0 99M 0% /run/user/1000
I think it depends on the applications. For me the space is sufficient since my application will not generate too much garbages.
If you can reinstall your OS, you can try to use a smaller OS, and/or btrfs compression to save spaces.
QuantumCore
Webhorizon
LittleCreek
Clouveo
RackNerd
NexusBytes
Novos
NaranjaTech 
For purpose, yes. But:
He picked the wrong distro if he wants to be lean and mean. Use debian instead.
The provider only sells one size VPS?
This really does nothing as far as getting space back.
You should cd to the root directory and run du -sm, then a day later run the same command. Which top-level directories changed? Then cd into those and run the same command a day apart, etc. You need to find what's growing.
Could very well be. OP could look at logrotated.conf and set it more aggressively or look at what's running and tell it to stop being so verbose.
If the OP has a swapfile, maybe he doesn't need one, or at least not as big a one. See swapon -s or look at top.
Could look at /tmp and see if there are things there to be cleaned up.
You can run commands like find / -mtime 1 -print to see what's changed in the 24 hours.
For LET support, please visit the support desk.
you should reinstall or check for log files,
you can run this command "du -Sh | sort -rh | head -5" To display the largest folders/files including the sub-directories,
A bare metal installation would take 2+GB
https://ubuntu.com/server/docs/installation
Once you add any other packages, there’s really not much room to play with.
Nexus Bytes Ryzen Powered NVMe VPS | NYC|Miami|LA|London|Netherlands| Singapore|Tokyo
Storage VPS | LiteSpeed Powered Web Hosting + SSH access | Switcher Special |
Happy now?
I'm not the only one who breaks this rule, as it more applies to threads and comments, than signatures.
I'm yet to see a person being reprimanded for not having a non-aff link in their signature by a **mod or an admin **
My Blog rafalblog.xyz
Contabo GmbH insanely cheap VPS | Racknerd LLC Amazing price to performance ratio(aff) (noaff)
how can I see if it's a ubuntu minimal or a normal that I have installed?
It all sort of depends on what else is installed and what you need. Get a package listing and see what is unnecessary and
apt-get purge
it. Not all of the text in the ReduceDebian page will apply, but it might give you some ideas.Also check your logs. If you can trim some of that or log remotely, that might help as well.
DataPlane.org's current server hosting provider list
Start removing whitespaces and tabs where it's not required. Every byte counts.
You can use
ncdu
to explore your filesystem and find out what's taking up space.I once deleted all the spaces in
COMMAND.COM
on my floppy disk, and then the computer won't start again.I snagged Deal of the Year: $6.9/year, 6 vCPU, 8GB RAM, 105GB NVMe - but it got away.
I have vps with 5GB disk too and in my case /dev/vda1 shows "size 4.9G" (btw, "used 1.7G" for minimal debian with name-/log-/ssh-server). Getting "3.8G size" for 5GB disk is suspicious. I guess you sacrificed 1GB for swap. Show "free -h" (or even better "fdisk -l /dev/vda") to be sure...
Had the same problem, because vps-template had pre-selected swap-partition 1GB. The only option was to re-install VPS from iso-image and select no swap manually (you can still set up some file-swap later). Loosing 1GB out of 5GB disk space is simply too much...
You can easily identify the large files and folders on the VPS with ncdu.
apt-get install ncdu
sudo ncdu -x /
Look for the disk at
/dev/shm
. It usually has a lot of space left.I used to put my homework in that partition, but nowadays I only put nginx cache files there.
Then, reduce system log size with this command:
I snagged Deal of the Year: $6.9/year, 6 vCPU, 8GB RAM, 105GB NVMe - but it got away.
Remove logs
Linkila - Super powered short URLs
Delete hens or build new chicken
I
Nexus Bytes and Direct Admin 
Switch to Debian as it's smaller than Ubuntu, install from ISO if the provider allows that (some providers have bloated images). Failing those two, it might be best to find a provider that can give you some more storage, as 5GB really isn't enough unless you heavily tweak your system. Disabling any logging can also help, but it makes troubleshooting more difficult.
Spearware Networks | AS212647 | Premium Shared, Reseller, and VPS Hosting in Tampa, FL | https://spearwarenetworks.com
check logs..
du -sh /var/log
journald often go wild on ubuntu/debian.
thanks for all the fishes 🐟
Ubuntu for minimal server space is bad idea, try debian minimal, for wireguard just only 1.1 Gb space disk, dont forget reduce log file with cronjob ;
The clear idea is to get more space, and you should ask your provider for it!
Normally, we'd flag the post and comment to a mod and then they sort it out over PM. You could have just said, "thanks, fixed." He just gave you a friendly heads up instead of you getting PM'd by a mod and wasting their time, too.
Try the following.. shows you desc sorted list of 25 folders/files taking highest space.
du -a -h --max-depth=1 / | sort -hr | head -25
My list of reliable providers :
Ramnode : HostHatch : Dediserve : Serverica : CloudCone : InceptionHosting : AlphaVps : Lunanode : Few more under testing!
You should try alpine linux, it takes up the least amount of space.
Then for mods:
Sebster27
JasonM
lentro
My Blog rafalblog.xyz
Contabo GmbH insanely cheap VPS | Racknerd LLC Amazing price to performance ratio(aff) (noaff)
You use the Flag link above the post and below their username.
Also CRLF>LF
^ this
Also you can trim it down to just the most recent kernel, not 2-3 stored, and that'll save you like 150-300MB.
dpkg --list | grep linux-image-*
Anything with 'ii' next to it is installed, check which you're running/is the latest, then delete the other(s) with
apt purge linux-image-5.4.0-66-generic
- just be sure to leave the 'linux-image-generic' item alone.🐴 $2/mo 512MB KVM - Unmetered bandwidth. $1.25 for 256GB Block Storage - from BuyVM (aff)
FWIW Debian's documented absolute minimum for installation is 780 MB disk space (https://www.debian.org/releases/stretch/i386/ch02s05.html.en), but they recommend 2 GB space and 128 MB RAM minimum (https://www.debian.org/releases/stretch/i386/ch03s04.html.en).
For an installation with very low space, you could try using btrfs and enabling zstd compression. This would work best if you have a lot of very compressible files (plain text, eg source code, HTML files, etc).
If you've got very low RAM (128 MB), it may be a good idea to use 32-bit rather than 64-bit, as the smaller pointers will save you a little bit of RAM. Just ensure it's not a PAE kernel (eg the regular Debian i686 kernel is fine). Just make sure all your apps run on 32-bit. All apps packaged with Debian support 32-bit, but some third party software is 64-bit-only now.
Daniel15 | https://d.sb/
dnstools.ws - DNS lookups, pings, and traceroutes from 30 locations worldwide.
Lately, ubuntu has been more focused on competing with windows instead of actually standard nix systems. Gotten very bloaty straight out of the box. Nothing beats good ol lean debian, or for the yoloers, Alpine.
Nexus Bytes Ryzen Powered NVMe VPS | NYC|Miami|LA|London|Netherlands| Singapore|Tokyo
Storage VPS | LiteSpeed Powered Web Hosting + SSH access | Switcher Special |
Can you post the results of
fdisk -l
or similar to see your partitioning scheme?Webhosting24 Munich Cloud Servers - Including IPv4 and /48 IPv6 subnet, NVMe and Unmetered Bandwidth
Webhosting24 Singapore Launch Thread - Premium Connectivity, IPv4 and /48 IPv6 subnet, Ryzen NVMe
It seems like the OP wanted a "quick fix" for their issue. Turns out, there isn't one.
There are two:
Add a space after
p
for extra effect.Always understand what a command does before you proceed.
I snagged Deal of the Year: $6.9/year, 6 vCPU, 8GB RAM, 105GB NVMe - but it got away.
Most likely the problem is log growth. The apt cleaning commands you ran just clear out local cached copies of deb packages and related files from /var/cache/apt. Run
du -shc /var/*
anddu -shc /var/log/*
to check. Orncdu /var/
if you have that installed. A common cause of sudden log growth is a brute-force login attempt against your SSH daemon causing a lot of log entries, perhaps install fail2ban to reduce that if this appears to be the issue in your case (though f2b won't help much for distributed attempts).