liblvm is a rubygem provide functions to manipulate the linux LVM objects.
- Create Lvm
- Remove LVM
- Get LVM list
- Verify if a LVM exist
- Get vg extent size
- Get vg free size
- Get vg extent count
- libllvm2.7 a linux library
- Install the liblvm rubygem
gem install liblvm
- Initialize the lvm Object Before you should create your VG. The constructor take the VG name as argument
lvm = Linuxlvm.new('TEST_VG')
- Get the lvm version
lvm.get_lvm_version
- Get the VG free size (KB)
lvm.vg_get_free_size
- Get VG extent count
lvm.vg_get_extent_count
- Get VG extent size
lvm.vg_get_extent_size
- Get vg free extent count
lvm.vg_get_free_extent_count
- Create a LV object the lv_create function take two argument the "lv name" and "lv size"
lvm.lv_create("test", lvm.vg_get_extent_size * 10)
- Verify if a lv exist
lvm.lv_exist("test")
- Get the lvs list
lvm.get_lv_list
- Remove a Lv object
lvm.lv_remove("test")