Howdy, Stranger!

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


Help - VPS is reaching limit of disk space
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.

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

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?

«1

Comments

  • What more can I doo?

    Increase disk space of your VPS !

    Thanked by 1yoursunny
  • Find what is using the space.

  • skorupionskorupion Member, Host Rep

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

    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?

    increase your budget and upgrade vps.

  • InceptionHostingInceptionHosting Member, Patron 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 1Abd
  • pulseonepulseone Member
    edited March 2021

    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:

    $ 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
  • 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, Host Rep
    edited March 2021

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

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

  • raindog308raindog308 Administrator, Veteran

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

  • systemfreakssystemfreaks Member, Patron Provider

    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.

  • skorupionskorupion Member, Host Rep
    edited March 2021

    @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
  • yoursunnyyoursunny Member, IPv6 Advocate

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

  • JarryJarry Member
    edited March 2021

    @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, IPv6 Advocate
    edited March 2021

    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
    
  • ericlsericls Member, Patron Provider

    Remove logs

  • Delete hens or build new chicken

  • mike1smike1s Member
    edited March 2021

    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.

  • fazarfazar Member

    check logs..
    du -sh /var/log

    journald often go wild on ubuntu/debian.

  • isunbejoisunbejo Member
    edited March 2021

    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!

Sign In or Register to comment.