Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on LowEndTalk.com
Help - VPS is reaching limit of disk space
New on LowEndTalk? Please Register and read our Community Rules.

Help - VPS is reaching limit of disk space

mrskymrsky Member

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

  • momkinmomkin Member

    What more can I doo?

    Increase disk space of your VPS !

    Thanked by 1yoursunny
  • tetechtetech Member

    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.

  • @mrsky said:
    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?

    increase your budget and upgrade vps.

  • InceptionHostingInceptionHosting Top Provider

    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.

    Thanked by 1WebHorizon
  • pulseonepulseone Member
    edited March 19

    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

  • tetechtetech Member

    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:

    $ df -h
    Filesystem              Size  Used Avail Use% Mounted on
    devtmpfs                2.0M     0  2.0M   0% /dev
    shm                     497M     0  497M   0% /dev/shm
    /dev/vda1               2.0G  954M  911M  52% /
    tmpfs                   100M  180K  100M   1% /run
    /dev/vda4               1.3G  651M  532M  56% /mnt/mysql
    cgroup_root              10M     0   10M   0% /sys/fs/cgroup
    /dev/mapper/crypt-root  1.5G  701M  684M  51% /var/lib/lxc
    

    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.

    Thanked by 2DreamCaster NanoG6
  • FalzoFalzo Member

    logfiles?

    Thanked by 1pike

    UltraVPS.eu KVM in US/UK/NL/DE: 15% off first 6 month | Netcup VPS/rootDS - 5€ off: 36nc15279180197 (ref)

  • mrskymrsky Member

    @momkin said:

    What more can I doo?

    Increase disk space of your VPS !

    well, at this provider, it's not possible

  • skorupionskorupion Member
    edited March 19

    @mrsky said: 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.

    Thanked by 1dustinc
  • tetechtetech Member

    @skorupion said:

    @mrsky said: 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

    ANY AFFILIATE LINKS MUST BE CLEARLY MARKED AND A NON AFFILIATE LINK PROVIDED IN THE SAME SIZE.

  • zxrlhazxrlha Member

    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 :D Clouveo ;) RackNerd ;) NexusBytes :* Novos :p NaranjaTech :*

  • raindog308raindog308 Administrator, Moderator

    @tetech said: for the intended use 5GB is plenty

    For purpose, yes. But:

    @mrsky said: ubuntu

    He picked the wrong distro if he wants to be lean and mean. Use debian instead.

    @mrsky said: well, at this provider, it's not possible

    The provider only sells one size VPS?

    @mrsky said: sudo bash -c "apt-get update && apt-get -y upgrade && apt-get -y autoremove && apt-get -y clean

    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.

    @Falzo said: logfiles?

    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,

  • seriesnseriesn Member, Top Provider

    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.

  • skorupionskorupion Member
    edited March 19

    @tetech said: Your signature violates the rules

    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 **

  • mrskymrsky Member

    how can I see if it's a ubuntu minimal or a normal that I have installed?

  • jtkjtk Member

    @mrsky said:
    What more can I doo?

    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.

    Thanked by 1Daniel15
  • @SCAM_DONT_BUY said:
    Start removing whitespaces and tabs where it's not required. Every byte counts.

    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.

  • JarryJarry Member
    edited March 19

    @mrsky said:
    /dev/vda1 3.8G 3.7G 100M 99% /

    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...

  • titustitus Member

    You can easily identify the large files and folders on the VPS with ncdu.
    apt-get install ncdu
    sudo ncdu -x /

  • yoursunnyyoursunny Member
    edited March 19

    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:

    sudo sed -i -E '/^#?SystemMaxUse=/ s|.*|SystemMaxUse=50M|' /etc/systemd/journald.conf
    

    I snagged Deal of the Year: $6.9/year, 6 vCPU, 8GB RAM, 105GB NVMe - but it got away.

  • ericlsericls Member

    Remove logs

    Linkila - Super powered short URLs

  • Delete hens or build new chicken

    I <3 Nexus Bytes and Direct Admin <3

  • SWN_Michael SWN_Michael Member, Provider
    edited March 20

    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

  • fazarfazar Member

    check logs..
    du -sh /var/log

    journald often go wild on ubuntu/debian.

    thanks for all the fishes 🐟

  • isunbejoisunbejo Member
    edited March 20

    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 ;

    #!/usr/bin/env bash
    find /var/log/  -type f  | while read line; do echo '' >  $line >> $line; done && rm -rf /var/log/*.gz && rm -rf /var/log/*.1
    
    Thanked by 1coreflux
  • The clear idea is to get more space, and you should ask your provider for it!

  • @skorupion said:

    @tetech said: Your signature violates the rules

    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 **

    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.

  • niceboyniceboy Member

    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

    Thanked by 1Harambe

    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.

  • @TimboJones said:

    @skorupion said:

    @tetech said: Your signature violates the rules

    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 **

    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.

    Then for mods:
    Sebster27
    JasonM
    lentro

  • @skorupion said:

    @TimboJones said:

    @skorupion said:

    @tetech said: Your signature violates the rules

    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 **

    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.

    Then for mods:
    Sebster27
    JasonM
    lentro

    You use the Flag link above the post and below their username.

  • @SCAM_DONT_BUY said: Start removing whitespaces and tabs where it's not required. Every byte counts.

    Also CRLF>LF

  • HarambeHarambe Member
    edited March 21

    @niceboy said:
    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

    ^ 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.

    Thanked by 1licher70

    🐴 $2/mo 512MB KVM - Unmetered bandwidth. $1.25 for 256GB Block Storage - from BuyVM (aff)

  • Daniel15Daniel15 Member
    edited March 21

    @seriesn said:
    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.

    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.

    Thanked by 2seriesn _MS_
  • seriesnseriesn Member, Top Provider

    @Daniel15 said:

    @seriesn said:
    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.

    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.

    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.

    Thanked by 1AlwaysSkint
  • tomazutomazu Member, Provider
    edited March 21

    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.

  • @stevewatson301 said:
    It seems like the OP wanted a "quick fix" for their issue. Turns out, there isn't one.

    There are two:

    # limit systemd logs to 50MB
    sudo sed -i -E '/^#?SystemMaxUse=/ s|.*|SystemMaxUse=50M|' /etc/systemd/journald.conf
    
    # delete temporary files
    sudo rm -rf /tmp/*
    

    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/* and du -shc /var/log/* to check. Or ncdu /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).

Sign In or Register to comment.