New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
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...
root@vps_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.
increase your budget and upgrade vps.
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?
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.
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.
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.
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.
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 **
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.
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 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:
Remove logs
Delete hens or build new chicken
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.
check logs..
du -sh /var/log
journald often go wild on ubuntu/debian.
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!