linux_wiki:logical_volume_management_lvm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:logical_volume_management_lvm [2016/06/12 22:12]
billdozor [Grow File System]
linux_wiki:logical_volume_management_lvm [2019/05/25 23:50] (current)
Line 30: Line 30:
  
 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**<code bash>echo "- - -" > /sys/class/scsi_host/$(grep mpt /sys/class/scsi_host/host?/proc_name | grep -o -E '(host[0-9])')/scan</code>
 +
 +\\
 +**Manual Method**
   * Find the host bus number<code bash>grep mpt /sys/class/scsi_host/host?/proc_name</code>   * Find the host bus number<code bash>grep mpt /sys/class/scsi_host/host?/proc_name</code>
     * Example return value:<code bash>/sys/class/scsi_host/host2/proc_name:mptspi</code>     * Example return value:<code bash>/sys/class/scsi_host/host2/proc_name:mptspi</code>
Line 131: Line 137:
     - Option 3: Give the logical volume a specific amount of additional free space from a specific physical volume<code bash>lvextend --resizefs --size +10G /dev/vglocal/lvhome /dev/sdb1</code>     - Option 3: Give the logical volume a specific amount of additional free space from a specific physical volume<code bash>lvextend --resizefs --size +10G /dev/vglocal/lvhome /dev/sdb1</code>
     - Option 4: Give the logical volume all of the free space available to the volume group (potentially across multiple physical volumes)<code bash>lvextend --resizefs --extents +100%FREE /dev/vglocal/lvhome</code>     - Option 4: Give the logical volume all of the free space available to the volume group (potentially across multiple physical volumes)<code bash>lvextend --resizefs --extents +100%FREE /dev/vglocal/lvhome</code>
 +
 +==== Extending a Logical Swap Volume ====
 +
 +Extending a swap volume is slightly different, as the "--resizefs" flag will not work.
 +
 +  - Example: Specify the total size of the logical swap volume<code bash>lvextend --size 8G /dev/vglocal/lvswap /dev/sdb1</code>
 +  - Disable all swap<code bash>swapoff -a</code>
 +  - Create a new swap area, overwriting the original<code bash>mkswap /dev/vglocal/lvswap</code>
 +  - Enable swap<code bash>swapon -a</code>
 +  - Verify<code bash>swapon -s</code>
  
 ---- ----
Line 185: 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<code bash>root@llsrlscd01 home $ pvs
 +  /dev/sdc: read failed after 0 of 4096 at 0: Input/output error
 +  /dev/sdc: read failed after 0 of 4096 at 17179803648: Input/output error
 +  /dev/sdc: read failed after 0 of 4096 at 17179860992: Input/output error
 +  /dev/sdc: read failed after 0 of 4096 at 4096: Input/output error
 +  /dev/sdc1: read failed after 0 of 4096 at 17178755072: Input/output error
 +  /dev/sdc1: read failed after 0 of 4096 at 17178812416: Input/output error
 +  /dev/sdc1: read failed after 0 of 4096 at 0: Input/output error
 +  /dev/sdc1: read failed after 0 of 4096 at 4096: Input/output error
 +  PV         VG      Fmt  Attr PSize   PFree
 +  /dev/sda2  vglocal lvm2 a--   19.50g 3.50g
 +  /dev/sdd1  vglocal lvm2 a--  250.00g    0
 +  /dev/sde1  vglocal lvm2 a--   40.00g    0</code>
 +    * Fix by rebooting the system or<code bash>echo 1 > /sys/block/sdX/device/delete</code>
 +      * Where "sdX" is the device, such as 'sdc' in the above example.
  
 ---- ----
  • linux_wiki/logical_volume_management_lvm.1465783958.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)