Files
gitea-pages/admin-guide/configuration/partitioning.md
2024-08-08 09:55:20 +02:00

2.3 KiB

Partitioning

Resize System Volumes

The size of the system volumes (inside volume group vgroot), are automatically set on a rather small size at the initial installation.

Note that due to the limitations of XFS a volume can only be increased, not be shrunk.

Get Available Space and Volume Sizes

To check how much space is still available, use pvs and look for the volume group vgroot:

[root@lxdev00 ~]# pvs
  PV         VG      Fmt  Attr PSize   PFree 
  /dev/sda2  vg_root lvm2 a--  <62.94g <5.19g
[root@lxdev00 ~]# 

Then lvs gives the sizes of the volumes inside:

[root@lxdev00 ~]# lvs
  LV         VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_home    vg_root -wi-ao---- <31.44g                                                    
  lv_openafs vg_root -wi-ao----   2.00g                                                    
  lv_root    vg_root -wi-ao----  12.31g                                                    
  lv_tmp     vg_root -wi-ao----   2.00g                                                    
  lv_var     vg_root -wi-ao----   8.00g                                                    
  lv_var_log vg_root -wi-ao----   2.00g                                                    
[root@lxdev00 ~]# 

Extend System Volume

This can be done in Hiera with the vgroot::path key where for each volume which should be increased a new minium size can be set:

vgroot::path:
    lv_root: 15GB
    lv_var_log: 3GB

This is then applied on the next puppet run, you may trigger one as root:

puppet agent -t

Custom Partitioning

To add a new volume to the system disk, you need to address the lvm Puppet module directly in Hiera::

lvm::volume_groups:
  vg_root:
    physical_volumes:
      - /dev/nvme0n1p3
    logical_volumes:
      lv_data:
        size: 3TB
        fs_type: 'xfs'
        mountpath: '/mnt/data'
        size_is_minsize: true

Please note that you need also to list the partition on which vg_root is located.

The same you can do to add partitions outside of the system disk, but here you need to define the full LVM volume group:

lvm::volume_groups:
  vg_data:
    physical_volumes:
      - '/dev/sdb'
    logical_volumes:
      lv_usr_local:
        mountpath: '/usr/local'
        fs_type: 'xfs'