Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:logical_volume_management_lvm [2015/12/23 13:33] billdozor |
linux_wiki:logical_volume_management_lvm [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 6: | Line 6: | ||
**Checklist** | **Checklist** | ||
- | * The hard disk being formatted is not in use/blank. These steps will erase all data on the target disk. | + | * Distro(s): Any |
+ | * Other: | ||
---- | ---- | ||
Line 14: | Line 15: | ||
Whether expanding or creating new storage, the summarized steps are: | Whether expanding or creating new storage, the summarized steps are: | ||
* Add virtual disk to VM | * Add virtual disk to VM | ||
- | * Re-Scan SCSI Bus (if needed) | + | * Scan SCSI Bus (if needed) |
* Format the Disk with a partition | * Format the Disk with a partition | ||
* Create physical volume using the new disk's partition | * Create physical volume using the new disk's partition | ||
Line 20: | Line 21: | ||
---- | ---- | ||
- | ===== Add Disk ===== | + | ===== Add/ |
- | Add disk to the system either physically or virtually if a VM. | + | Add or expand the disk to the system either physically or virtually if a VM. |
---- | ---- | ||
- | ===== Re-Scan SCSI Bus ===== | + | ==== Add Disk: Scan SCSI Bus ==== |
If adding a disk to a virtual machine and the new disk does not show up: | If adding a disk to a virtual machine and the new disk does not show up: | ||
+ | |||
+ | \\ | ||
+ | **One Liner Method**< | ||
+ | |||
+ | \\ | ||
+ | **Manual Method** | ||
* Find the host bus number< | * Find the host bus number< | ||
* Example return value:< | * Example return value:< | ||
Line 35: | Line 42: | ||
* Example from returned value< | * Example from returned value< | ||
* The hyphens represent controller, | * The hyphens represent controller, | ||
+ | |||
+ | ==== Expand Disk: Re-Scan SCSI Bus ==== | ||
+ | |||
+ | If you have expanded an existing disk, rescan the scsi bus<code bash> | ||
+ | |||
+ | Where "< | ||
---- | ---- | ||
Line 120: | Line 133: | ||
- **Option 1(Preferred)**: | - **Option 1(Preferred)**: | ||
- There may be a performance hit if a logical volume is spanned across multiple VMDKs, so this method is preferred.< | - There may be a performance hit if a logical volume is spanned across multiple VMDKs, so this method is preferred.< | ||
- | lvextend / | + | lvextend |
- | - Option 2: Give the logical volume all of the space from the newly added physical volume< | + | - Option 2: Give the logical volume all of the space from the newly added physical volume< |
- | - Option 3: Give the logical volume a specific amount of additional free space from a specific physical volume< | + | - Option 3: Give the logical volume a specific amount of additional free space from a specific physical volume< |
- | - Option 4: Give the logical volume all of the free space available to the volume group (potentially across multiple physical volumes)< | + | - Option 4: Give the logical volume all of the free space available to the volume group (potentially across multiple physical volumes)< |
+ | |||
+ | ==== Extending a Logical Swap Volume ==== | ||
+ | |||
+ | Extending a swap volume is slightly different, as the " | ||
+ | |||
+ | - Example: Specify the total size of the logical swap volume< | ||
+ | - Disable all swap< | ||
+ | - Create a new swap area, overwriting the original< | ||
+ | - Enable swap< | ||
+ | - Verify< | ||
---- | ---- | ||
Line 133: | Line 156: | ||
- Volume Group: <code bash> | - Volume Group: <code bash> | ||
- Physical Volumes: <code bash> | - Physical Volumes: <code bash> | ||
+ | |||
+ | |||
+ | **Logical Volume Location(s) on Physical Volumes** | ||
+ | |||
+ | If you would like to see what logical volumes reside where, a nice command to view physical extent to logical volume mappings is:<code bash> | ||
---- | ---- | ||
===== Grow File System ===== | ===== Grow File System ===== | ||
+ | |||
+ | **Skip if you used the " | ||
- Grow the file system | - Grow the file system | ||
Line 171: | Line 201: | ||
Login to the virtualization user interface and delete the old disk from inventory. | Login to the virtualization user interface and delete the old disk from inventory. | ||
+ | |||
+ | \\ | ||
+ | **Errors During LVM Commands** | ||
+ | * If you see errors during LVM commands like this after a device delete from vmware< | ||
+ | /dev/sdc: read failed after 0 of 4096 at 0: Input/ | ||
+ | /dev/sdc: read failed after 0 of 4096 at 17179803648: | ||
+ | /dev/sdc: read failed after 0 of 4096 at 17179860992: | ||
+ | /dev/sdc: read failed after 0 of 4096 at 4096: Input/ | ||
+ | /dev/sdc1: read failed after 0 of 4096 at 17178755072: | ||
+ | /dev/sdc1: read failed after 0 of 4096 at 17178812416: | ||
+ | /dev/sdc1: read failed after 0 of 4096 at 0: Input/ | ||
+ | /dev/sdc1: read failed after 0 of 4096 at 4096: Input/ | ||
+ | PV | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | * Fix by rebooting the system or<code bash> | ||
+ | * Where " | ||
---- | ---- |