click below
click below
Normal Size Small Size show me how
Manage Partitions
Logical Volume Manager (LVM)
| Question | Answer |
|---|---|
| An alternative method to manage partitions that give more flexibility in allocating storage on a system | Logical Volume Manager (LVM) |
| Instead of /dev/sda, Logical volumes can be identified by: | Descriptive names (such as research or marketing) |
| While the logical volumes are still mounted and running you can: | Resize and move |
| Command to initialize a physical volume for later use by the LVM | pvcreate |
| Example: Create a PHYSICAL volume on the second hard disk | pvcreate /dev/sdb |
| Scan all disks for PHYSICAL volumes and display the results (and their associated groups) | pvscan |
| Display a PHYSICAL volume that gives name, pv size etc | pvdisplay |
| Create a new VOLUME group | vgcreate |
| Adds one or more initialized physical volumes to an EXISTING volume group to extend its size | vgextend |
| Example: Add the third hard disk (physical volume) to a volume group named "Sales" | vgextend Sales /dev/sdc |
| Display created volume groups | vgdisplay |
| Create a new LOGICAL volume in a volume group | lvcreate |
| Specify the logical volume size | lvcreate -L |
| Specify the logical volume name | lvcreate -n |
| Example: Create a 3 Terabyte logical volume, named "figures" on the "sales" volume group | lvcreate -L 2T -n figures sales |
| Scans all volume groups or supported LVM block devices in the system for logical volumes and display the results | lvscan |
| Extends the size of a volume group | lvextend |
| lvextend Options: Specify the new size of the volume | lvextend -L +size |
| Example: Extend the data logical volume to 30 Gigabytes | lvextend -L 30G data - (without the -L option the volume will increase by the amount of free space on the physical volume) |
| lvextend Options: specify which logical volume to extend | lvextend {logicalvolume} |
| Example: Extend the Sales logical volume to all the free space on the physical volume /dev/sdd | lvextend Sales /dev/sdd |
| lvextend Options: Specify the physical volume to use fr the extension | lvextend {physicalvolume} |