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 revisionNext revisionBoth sides next revision | ||
tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs [2013/04/12 10:48] – KoHofer@unibz.it | tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs [2020/08/17 11:29] – [VM disk Expansion LVM with XFS/EXT4] kohofer | ||
---|---|---|---|
Line 4: | Line 4: | ||
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 want to perform a grow w/o reboot you have to add a second disk. | + | <del>If you want to perform a grow w/o reboot you have to add a second disk.</ |
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 26: | Line 26: | ||
whereby after scsi_device you need to find the correct scsi device | whereby after scsi_device you need to find the correct scsi device | ||
+ | or | ||
+ | |||
+ | apt-get install scsitools | ||
+ | rescan-scsi-bus | ||
+ | |||
+ | At the end it should list that a new device was found, note down the name/ | ||
+ | |||
+ | echo ' | ||
+ | |||
+ | IMPORTANT: Be sure to replace the 32\:0\:1\:0 with the appropriate disk for your purposes. | ||
Line 33: | Line 43: | ||
from 8GB to 15GB. The partition type is 8e. | from 8GB to 15GB. The partition type is 8e. | ||
- | cfdisk /dev/sda | + | cfdisk / |
+ | |||
+ | 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 47: | Line 67: | ||
in this example it's **base** | in this example it's **base** | ||
- | lvdisplay | + | lvdisplay |
+ | |||
+ | < | ||
--- Logical volume --- | --- Logical volume --- | ||
LV Name / | LV Name / | ||
Line 103: | Line 125: | ||
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 140: | Line 162: | ||
Now resize the filesystem | Now resize the filesystem | ||
+ | |||
+ | Debian System: | ||
resize2fs -p / | resize2fs -p / | ||
+ | Centos/ | ||
+ | |||
+ | resize4fs -p / | ||
===== For swap ===== | ===== For swap ===== | ||
Line 153: | Line 180: | ||
Check if filesystems are ok, and only then release the snapshot | Check if filesystems are ok, and only then release the snapshot | ||
+ | |||
+ | Fix issue with swap | ||
+ | |||
+ | * swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory | ||
+ | |||
+ | [[https:// | ||
Line 177: | Line 210: | ||
Hier legen wir jetzt alle unsere logischen Volumes an. Als Namen verwenden wir, etwas fantasielos, | Hier legen wir jetzt alle unsere logischen Volumes an. Als Namen verwenden wir, etwas fantasielos, | ||
- | | + | lvcreate -l +100%FREE -n lvol1 vg01 |
+ | |||
+ | oder wir könne die Größen angeben! (1500M) | ||
+ | |||
+ | lvcreate -L 1500M -n lvol1 vg01 | ||
Filesysteme anlegen | Filesysteme anlegen | ||
Line 189: | Line 226: | ||
Damit die neuen Filesysteme nun bei jedem Systemstart automatisch gemountet werden, müssen wir sie in die Datei /etc/fstab eintragen (siehe 'man fstab' | Damit die neuen Filesysteme nun bei jedem Systemstart automatisch gemountet werden, müssen wir sie in die Datei /etc/fstab eintragen (siehe 'man fstab' | ||
- | / | + | / |
+ | |||
+ | ===== Links ===== | ||
+ | |||
+ | |||
+ | [[http:// | ||
+ | [[https:// | ||
+ | [[http:// | ||
+ | [[http:// | ||
+ | [[http:// | ||
+ | [[http:// | ||
+ | [[http:// | ||
- | http:// | ||
+ | http:// | ||
http:// | http:// |
/data/www/wiki.inf.unibz.it/data/pages/tech/documentation/procedures/vm/vm_disk_expansion_lvm_xfs.txt · Last modified: 2020/10/13 16:46 by kohofer