After you have attached the disk to a physical server or virtual machine, you need to type command:
```bash
sudo fdisk -l
```
<!--more-->
This is to make sure the drive is recognized by the operating system, and to identify the drive name. Output of the command will be something like this:
```plaintext
Disk /dev/vdc: 5 GiB, 5368709120 bytes, 10485760 sectors
If you have xfs file system, then the extending can be done with the following command:
```bash
sudo xfs_growfs /dev/{vg-name}/{lv-name}
```
In our case, it will be:
```bash
sudo xfs_growfs /dev/vg-example/lv-example
```
For ext4 filesystem, replace `xfs_growfs` with `resize2fs`
### Situation 2: if the size of the existing disk has changed
Sometimes the size of an existing disk can change, for example, in case of a virtual machine. In this case, the first step will be different, the second step will not be performed, and the rest of the steps will be pretty the same as in the situation with a new disc described above. The first step is not to create a physical volume, but to resize the existing one. It can be done with the command: