Differences
This shows you the differences between two versions of the page.
linux_wiki:create_and_remove_physical_volumes_assign_physical_volumes_to_volume_groups_and_create_and_delete_logical_volumes [2016/02/29 21:31] billdozor created |
linux_wiki:create_and_remove_physical_volumes_assign_physical_volumes_to_volume_groups_and_create_and_delete_logical_volumes [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Create And Remove Physical Volumes Assign Physical Volumes To Volume Groups And Create And Delete Logical Volumes ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | About this page/ | ||
- | |||
- | ---- | ||
- | |||
- | Parition that is prepared for type LVM (8e00) | ||
- | <code bash> | ||
- | gdisk /dev/sdb | ||
- | n | ||
- | Partition number: 1 | ||
- | First sector: default | ||
- | Last sector: +30G | ||
- | Hex code type: 8e00 | ||
- | w | ||
- | </ | ||
- | |||
- | Create physical volume | ||
- | <code bash> | ||
- | pvcreate /dev/sdb1 | ||
- | </ | ||
- | |||
- | Assign physical volume to new volume group | ||
- | <code bash> | ||
- | vgcreate vglocal /dev/sdb1 | ||
- | </ | ||
- | |||
- | Assign physical volume to existing volume group | ||
- | <code bash> | ||
- | vgextend vglocal /dev/sdb1 | ||
- | </ | ||
- | |||
- | Create logical volume | ||
- | <code bash> | ||
- | lvcreate --name lvhome --size 30G vglocal | ||
- | </ | ||
- | |||
- | Create filesystem and mount logical volume | ||
- | <code bash> | ||
- | mkfs -t xfs / | ||
- | mount / | ||
- | </ | ||
- | |||
- | Display physical volumes, volume groups, or logical volumes | ||
- | <code bash> | ||
- | pvdisplay | ||
- | vgdisplay | ||
- | lvdisplay | ||
- | </ | ||
- | |||
- | Delete logical volume | ||
- | <code bash> | ||
- | lvremove / | ||
- | </ | ||
- | |||
- | Delete volume group | ||
- | <code bash> | ||
- | vgremove vglocal | ||
- | </ | ||
- | |||
- | Remove physical volume | ||
- | <code bash> | ||
- | pvremove /dev/sdb1 | ||
- | </ | ||
- | |||
- | ---- | ||