LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Running out space for /var, what todo? Can I solve this? (https://www.linuxquestions.org/questions/linux-desktop-74/running-out-space-for-var-what-todo-can-i-solve-this-4175673796/)

nkamp 04-23-2020 08:02 AM

Running out space for /var, what todo? Can I solve this?
 
Hello,

I'm not a guru on linux but I try to learn it and try to succeed.

I have installed Fedora 31 without any further reason. I have been googling for the size of the different partition/mounting points.
Here my overview:
- boot: 500 Mb
- /: 10 Gb
- home: 50 Gb
- var: 4 Gb
- swap: 8 Gb

I'm developer and I have installed by myself:
- Apache
- PHP
- MySQL MariadB
- Netbeans

Everytime i update the software there was the message /var is running out of space or there is not much space left!
I'am more or less already in trouble. I have two kernels on my system.

I was playing around with docker to find out how it works. I have docker running with "Hello world".

The next step what I just did is "docker pull jenkins", but that is not possible anymore.

So what is the best thing todo in my case:
  • Can I change the size? If so How
  • I see most the diskspace is used by /var/cache/PackageKit (docker)
  • I read somewere to make my home dir 50Gb now I'm doubting, why 50 Gb?

I hope that someone will advise me what the best thing is todo? Hopefully not to install complete Linux again. I have made it multiboot and there is some fysical diskspace (80 Gb) left that I can use.

Thanks in advance,

Nico

yancek 04-23-2020 08:19 AM

From a terminal, run the command (as root) fdisk -l and post the output here as that will show the actual partitions, their size and what partitions are contiguous as well as free space available if any. 4GB for var on a server doesn't seem like much and I expect w/10GB for the / partition will soon cause problems also.

pan64 04-23-2020 08:20 AM

if that was docker related:
stop the docker service, reconfigure it to use another dir on another partition, restart it and delete the content on /var (not the full /var, but the docker related dir, which was originally set).

dc.901 04-23-2020 08:26 AM

Docker image files (by default) will be under /var/lib/docker
check output of "docker ps" and "docker images" - then delete the images you are not using?

Also, checkout command "ncdu", you will have to install it. After installing it, go to /var directory and run it, you will see directory with most usage...

agillator 04-23-2020 08:40 AM

Don't pay too much attention to what other people recommend for partition sizes. How you use your computer is different from everyone else in the world as you are finding out, so you need to figure it out for yourself.

First, BACKUP EVERYTHING!!! When you are playing with partitions it is always easy to have problems! Murphy loves messing with partitions.

Second, if not already installed, install gparted. In this case the GUI will be invaluable.

Run gparted and see how the partitions are currently used. You will probably have something that has a lot of empty space. You can transfer some of that space to your /var partition. You have to do it a step at a time by shrinking the large partition, then moving the partitions that are between the now unallocated space and the /var partition until the unallocated space directly follows the /var partition. Now you can increase the size of the /var partition. CAUTION: If you disturb the boot partition in any way you will probably have to reinstall GRUB. Anything that changes the partition number of the boot partition will keep the system from booting and you will need to reinstall GRUB from a live installation disk. Google for instuctions for that. But if the computer will not boot, cannot find the boot partition, after you have played with the partitions it is not a disaster. Everything is probably still there, you just need to reload GRUB.

Note for future reference: How you partition a drive is up to you. There are as many opinions on that as there are computer users. You only have to have one partition: the root (/) partition. Having more can be useful but can lead to the size problem you are running into until you know how YOU use your machine. Also, the size of the swap partition is debatable. The rule of thumb is the size of your RAM, but actually it is whatever works. You don't have to have any swap space especially if you have a lot of RAM so it is never full.

nkamp 04-24-2020 12:47 PM

Hello,

Ok, what I have done yesterday, create with Rufus on my Windows machine a bootable USB stick with GParted.
Than it's easy but I thought that I have read in the past, that it was not possible or very complicated for Linux todo this. With GParted it is very easy.

I use this system to learn and get further with Linux. So if it should go wrong it not funny but I can live with it. I have changed the partitions with GParted:
  • boot ext4 500 MiB
  • home ext4 15 GiB (was 50 GiB)
  • root ext4 10,80 GiB (Why 0,80 extra?)
  • var ext4 38,20 GiB (was 4 GiB)
  • Swap ext4 8 GiB (equal to memory)

I see here at my customer were I'm working for the jenkins server has also a /usr. When do you choose to add this directory to the system?

For my development work, I further now.

I know it is something different but I'm already two days strugling and thinking how do I get Jenkins in an Docker container working. This afternoon it was working but not. I followed. I'm using open jdk version 19.9 could that be the issue?

Thanks everybody,

Nico

sevendogsbsd 04-24-2020 12:50 PM

Unless this is a server, I would not worry about separate partitions for anything except /home, but that is my opinion. Servers have very different partition requirements than desktop PCs and with a server it is sometimes beneficial to have separate partitions for /var, /usr or others.


All times are GMT -5. The time now is 09:37 PM.