I'm running docker containers on my machine which puts it all in /var/. df shows that /var/ is only 5G but I know the total amount of this system if 40G and it has at least 24G available. How can increase the size of /var/ an extra 15G? I'm unclear on if I should be doing this in my docker-compose file or through CentOS itself. The docker documentation on filesystems is incredibly confusing.

Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   27G  2.9G   24G  11% /
/dev/mapper/centos-var   5.0G  4.1G  944M  82% /var

  PV         VG     Fmt  Attr PSize   PFree
  /dev/sda2  centos lvm2 a--  <39.50g 4.00m

  VG     #PV #LV #SN Attr   VSize   VFree
  centos   1   4   0 wz--n- <39.50g 4.00m
  • Is this a VM or a physical machine? Add the output of pvs and vgs to your question. – Nasir Riley Jun 12 '19 at 22:44
  • @NasirRiley it's a VM. I edited the question with the output of the commands. – pnus Jun 12 '19 at 22:47
  • Your centos volume group is out of space. There are two other logical volumes in that volume group, most likely centos-home and centos-tmp, that are taking up the rest of the 40GB. You'll need to add a new virtual disk to your VM, create a new physical volume, add it to the centos volume group, and expand some of the free space to centos-var. – Nasir Riley Jun 12 '19 at 23:38

As per my observation, I can see there are lots of unused space is there in / partition so we can reduce this LV and make use this reclaimed space to extend /var

Step 1. Reduce LV "centos-root" Results >> you will get enough space in VG "Centos"

Step 2. Esxtend the size of LV "centos-var"

Note: You have to take precautions as you are reducing the / partition.

  • If the file system on centos-root is xfs then it won't be possible to reduce the size. – Nasir Riley Jun 16 '19 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.