In this post we will review how to overcome disk space issues in an Ubuntu VM.
This week, we've had our build machine out of disk space due to docker images disk requirements. This occurred since we keep the latest version per each git branch. Even after cleanup of some old images, we realized that we should have more disk space available on the build machine.
The steps to add disk space are listed below.
Add New Disk to the VM
Create a Partition and a FileSystem
Identify the new added disk using the command: sudo lshw -C disk.
An example of output is:
In this case the new disk device is /dev/sdb, which is a shorthand for Scsi Disk B.
To create a partition, run sudo cgdisk /dev/sdb, where the argument is the new disk device.
- In the cgdisk utility, create a new partition.
- Use the defaults values for the partition creation.
- Make sure to select "Write" option after the partition creation.
Duplicate one of the UUID line, and replace the UUID with the one created in the previous step. Also select an existing folder to mount the disk on. In our case we use a new folder for the docker images, hence we use the folder /var/lib/docker/overlay2.
To check that this is working, use the command: sudo mount -av.
Finally reboot the machine to verify that everything works.
No comments:
Post a Comment