Running out of disk space


#1

Looks like I’ll have to migrate this to a new instance soon. I tried to rebuild the app and it failed due to lack of disk space.

Graham@docker:/var/discourse$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev             1886708       0   1886708   0% /dev
tmpfs             378828   19640    359188   6% /run
/dev/sda1       10098468 8460480   1621604  84% /
tmpfs            1894124     620   1893504   1% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs            1894124       0   1894124   0% /sys/fs/cgroup
tmpfs             378828       0    378828   0% /run/user/1001

#2

Here are a few tips to reclaim some of that space.

  1. Remove dependencies that are no longer required sudo apt-get autoremove
  2. Clean out the aptitude cache sudo apt-get clean (but you may need to download stuff again if you need to reinstall anything)
  3. Have a look at what is using the space in a directory du -sm * the s recursively includes subdirectories and m is to display in MB. Best to use this a folder at a time like /home as it is not a great idea to run this against some of the dynamic filesystems such as /proc
    Cheers, John

#3

Both of those do nothing :frowning:


#4

At least the third option will tell you where all the space is going. Good luck. J


#5
sudo du -sm /var/*

something like that?


#6

Yes, but you probably don’t need the sudo. -J


#7
Graham@docker:~$ sudo du -sm /var/*

2 /var/backups
6 /var/cache
1 /var/crash
111 /var/discourse
8454 /var/lib
1 /var/local
0 /var/lock
2 /var/log
1 /var/mail
1 /var/opt
0 /var/run
1 /var/snap
1 /var/spool
1 /var/tmp

Does that help ( I did need the sudo ) ?


#8

I resized in the web interface from 10 Gb to 20 Gb but I’m afraid to go further!

compkarori@docker:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.8G     0  1.8G   0% /dev
tmpfs           370M   20M  351M   6% /run
/dev/sda1       9.7G  8.0G  1.7G  83% /
tmpfs           1.9G  1.2M  1.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs           370M     0  370M   0% /run/user/1001
tmpfs           370M     0  370M   0% /run/user/1004
compkarori@docker:~$ sudo lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda      8:0    0  20G  0 disk 
└─sda1   8:1    0  10G  0 part /

So I now do this?

sudo resize2fs /dev/sda1

#9

I am a bit confused as to what you actually have set up.

  1. You have a Google server with X amount of storage (X is unknown although going by this page https://cloud.google.com/compute/pricing#machinetype it might be 30GB ??).
  2. You have installed docker and added a container running discourse which may be configured to be only 10GB in size?? Just a guess
  3. You have resized a partition in a web interface of some kind which may be the whole server or just the docker container, I’m not sure which.
  4. You want to resize the filesystem to fit the newly resized partition.Is this in docker or on the host OS?

#10
  1. Google server with only 10Gb only.
  2. 85% used by the docker container or something
  3. Increased permanent disk size now to 20Gb
  4. Just googled it and it says that Ubuntu will automatically resize the partition to the new disk size
  5. Just rebooted and I see the new disk size with docker now only taking 45%
  6. Crisis solved!
  7. And enough space now to rebuild the app but it didn’t solve the cipher suite issue

#11

Yay :slight_smile: .