add documentation how to resize a vm harddisk

This commit is contained in:
2024-02-13 11:35:38 +01:00
parent fbd19aae63
commit 0d8d5e4a95
4 changed files with 73 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ chapters:
- file: admin-guide/configuration/services
- file: admin-guide/configuration/mount
- file: admin-guide/configuration/distribute_files
- file: admin-guide/configuration/resize_vm_disk
- file: admin-guide/configuration/vgroot
- file: admin-guide/configuration/networking
- file: admin-guide/configuration/xrdp

View File

@@ -0,0 +1,72 @@
# Resice VM Disk
To increase the harddisk of a VM, go to vcenter.psi.ch, select the machine, right click, and select __Edit Settings ...__
![](resize_vm_disk/resize_vm_disk_01.png)
Increase the harddisk size to the value you need to have:
![](resize_vm_disk/resize_vm_disk_02.png)
Now connect to the system and change to root.
List block devices:
```bash
[root@awi-ci-01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 42G 0 disk
├─sda1 8:1 0 600M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 32.4G 0 part
├─vg_root-lv_root 253:0 0 14G 0 lvm /
├─vg_root-lv_var_tmp 253:1 0 2G 0 lvm /var/tmp
├─vg_root-lv_var_log 253:2 0 3G 0 lvm /var/log
├─vg_root-lv_var 253:3 0 8G 0 lvm /var
├─vg_root-lv_tmp 253:4 0 2G 0 lvm /tmp
└─vg_root-lv_home 253:5 0 2G 0 lvm /home
```
Extend partition:
```bash
[root@awi-ci-01 ~]# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 45.1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 630MB 629MB fat32 EFI System Partition boot, esp
2 630MB 1704MB 1074MB ext4
3 1704MB 36.5GB 34.8GB lvm
(parted) resizepart 3
End? [36.5GB]? -0
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 45.1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 630MB 629MB fat32 EFI System Partition boot, esp
2 630MB 1704MB 1074MB ext4
3 1704MB 45.1GB 43.4GB lvm
(parted) quit
```
Resize physical volume:
```bash
[root@awi-ci-01 ~]# pvresize /dev/sda3
Physical volume "/dev/sda3" changed
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
```
Now the effective volumes of the machine can be extended as documented [Resize System Volumes](vgroot.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB