Posts

Showing posts with the label lvm

Tips on Recovering from Out of Disk Space (Linux Server)

Background When multiple VM is being used for application infrastructure,  sooner or later a system administrator will face out of disk space condition. This post will show a few selected approach to resolve such condition. First Step : Identify The Disk Configuration Some commands to determine disk mounting configuration : determine disk usage and mount points : df -h detailed mount point and options : mount | column -t physical volumes for LVM : pvs logical volumes for LVM : lvs volume group for LVM : vgs block devices list : lsblk Some VM might use ZFS on Linux, to examine pool configurations use : zfs list zpool list zfs list -t snapshot Second step : Determine which directory are using most space From the df -h command, we found out which partition or mount point is at out of disk space condition or nearing it. Better way to determine which directory are the largest is using ncdu tool, but if you didn't have it installed you could always use du -hs /<path>/*. For example...

How to create LVM volume with thin provisioning

Image
This post shows how to create LVM volume with thin provisioning, that is, only actually used ranges of the volume will actually be allocated. Check volume groups First, check lvm volume groups to find out which vg has space for our thin volume pool. vgdisplay Choose one of the volume groups with sufficient space. Because we are using thin provisioning, we could use less space than normal provisioning. Second, check existing logical volumes also.  lvs Creating thin volume pool Next, we create thin volume pool in the chosen volume group (example, vgdata). lvcreate -L 50G --thinpool globalthinpool vgdata Print the resulting volumes using lvs : We see that globalthinpool are created with logical size 50 gigabytes. Creating thinly provisioned volume Now we create thinly provisioned volume using previously created pool. lvcreate -V100G -T vgdata/globalthinpool -n dockerpool The command would create a 100 G logical volume using t...