# Expanding VM Filesystem Size

If the VM hits the size limit, but there is more space allocated, or you allocated the space. These steps will help with expanding the size of the volume.

##### Checking the Size

1. Check Disk Usage to see which disk is affected

```bash
df -h
```

2. Check volume group for free space

```bash
sudo vgdisplay
```

If there is no space, you will need to allocate more trough Hypervisor

##### Expanding filesystem roof

1. Extend logical volume

```bash
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
```

This will add remaining space to the root system

2. Resize filesystem

```bash
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
```

3. Verify disk size and usage

```bash
df -h /
```