tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs [2019/08/21 13:02] – [For swap] kohofer | tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs [2020/10/13 16:46] (current) – [VM disk Expansion LVM with XFS/EXT4] kohofer | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== VM disk Expansion LVM with XFS/EXT4 ======= | ====== VM disk Expansion LVM with XFS/EXT4 ======= | ||
- | |||
- | <note important> | ||
Expand the original disk or add a second vdisk from **Infrastructure Client**.\\ | Expand the original disk or add a second vdisk from **Infrastructure Client**.\\ | ||
- | < | ||
If you are on a kernel newer or equal to 2.6.32 then you can issue the command | If you are on a kernel newer or equal to 2.6.32 then you can issue the command | ||
Line 41: | Line 38: | ||
Create an additional partition on the free space, say you increased the existing disc | Create an additional partition on the free space, say you increased the existing disc | ||
+ | |||
from 8GB to 15GB. The partition type is 8e. | from 8GB to 15GB. The partition type is 8e. | ||
cfdisk /dev/sda or cfdisk /dev/sdb | cfdisk /dev/sda or cfdisk /dev/sdb | ||
+ | |||
+ | |||
+ | **RESIZE ORIGINAL DISK** | ||
+ | |||
+ | Resize the already existing partition, e.g. /dev/sda4 to the newly created free partition. | ||
+ | |||
+ | cfdisk /dev/sda or cfdisk /dev/sdb | ||
+ | |||
+ | Now resize the Physical Volume to the new size | ||
+ | |||
+ | pvresize /dev/sda4 | ||
+ | |||
+ | extend the logical volume | ||
+ | |||
+ | lvextend -l +100%FREE | ||
+ | |||
+ | next resize the file system | ||
+ | |||
+ | resize2fs -p / | ||
+ | |||
+ | |||
+ | If you get a error: | ||
+ | |||
+ | <color # | ||
+ | |||
+ | run this command: | ||
+ | |||
+ | parted -l | ||
+ | |||
+ | and when asked to Fix/Cancel? type **F** | ||
# for example if the new partition is /dev/sda3 | # for example if the new partition is /dev/sda3 | ||
Line 57: | Line 85: | ||
in this example it's **base** | in this example it's **base** | ||
- | lvdisplay | + | lvdisplay |
+ | |||
+ | < | ||
--- Logical volume --- | --- Logical volume --- | ||
LV Name / | LV Name / | ||
Line 113: | Line 143: | ||
Read ahead sectors | Read ahead sectors | ||
Block device | Block device | ||
+ | </ | ||
and we assume the new partition is /dev/sda3 | and we assume the new partition is /dev/sda3 | ||
Line 173: | Line 203: | ||
* swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory | * swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory | ||
- | [[https:// | + | [[https:// |
+ | |||
+ | <del>[[https:// | ||
Line 227: | Line 259: | ||
[[http:// | [[http:// | ||
+ | [[https:// | ||
http:// | http:// | ||
http:// | http:// |
/data/www/wiki.inf.unibz.it/data/attic/tech/documentation/procedures/vm/vm_disk_expansion_lvm_xfs.1566385348.txt.gz · Last modified: 2019/08/21 13:02 by kohofer