lvm Cookbook
============
[](http://travis-ci.org/opscode-cookbooks/lvm)
Installs lvm2 package and includes resources for managing LVM. The default recipe simply installs LVM and the supporting Ruby gem. The cookbook includes providers for managing LVMs.
Requirements
------------
- Chef 10 or higher
Resources/Providers
-------------------
#### `lvm_physical_volume`
Manages LVM physical volumes.
##### Actions
Attribute |
Description |
Example |
Default |
name |
(name attribute) Name of the logical volume |
bacon |
|
group |
(required) Volume group in which to create the new volume (not required if the volume is declared inside of an `lvm_volume_group` block) |
bits |
|
size |
(required) Size of the volume.
- It can be the size of the volume with units (k, K, m, M, g, G, t, T)
- It can be specified as the percentage of the size of the volume group
|
|
|
filesystem |
The format for the file system |
'ext4' |
|
mount_point |
Either a String containing the path to the mount point, or a Hash with the following keys:
- location - (required) the directory to mount the volume on
- options - the mount options for the volume
- dump - the dump field for the fstab entry
- pass - the pass field for the fstab entry
|
'/var/my/mount' |
|
physical_volumes |
Array of physical volumes that the volume will be
restricted to |
['/dev/sda', '/dev/sdb'] |
|
stripes |
Number of stripes for the volume |
5 |
|
stripe_size |
Number of kilobytes per stripe segment (must be a power of 2 less than or equal to the physical extent size for the volume group) |
24 |
|
mirrors |
Number of mirrors for the volume |
5 |
|
contiguous |
Whether or not volume should use the contiguous allocation
policy |
true |
false |
readahead |
The readahead sector count for the volume (can be a value
between 2 and 120, 'auto', or 'none') |
'auto' |
|
##### Examples
```ruby
lvm_logical_volume 'home' do
group 'vg00'
size '25%VG'
filesystem 'ext4'
mount_point '/home'
stripes 3
mirrors 2
end
```
---
#### `lvm_volume_group`
Manages LVM volume groups.
##### Actions