forked from linux/documentation
update example to RHEL9
This commit is contained in:
1 parent
3d78092842
commit
a320dfffc8
1 file changed
+42
-32
@@ -12,19 +12,21 @@ Increase the harddisk size to the value you need to have:
|
||||
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
|
||||
```
|
||||
# lsblk
|
||||
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
|
||||
sda 8:0 0 100G 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
|
||||
├─sda3 8:3 0 4G 0 part [SWAP]
|
||||
└─sda4 8:4 0 94.4G 0 part
|
||||
├─vg_root-lv_root 253:0 0 16G 0 lvm /
|
||||
├─vg_root-lv_var_log 253:1 0 4G 0 lvm /var/log
|
||||
├─vg_root-lv_var 253:2 0 70G 0 lvm /var
|
||||
├─vg_root-lv_tmp 253:3 0 2G 0 lvm /tmp
|
||||
└─vg_root-lv_home 253:4 0 2G 0 lvm /home
|
||||
sr0 11:0 1 1024M 0 rom
|
||||
#
|
||||
```
|
||||
|
||||
The command will probably not show the correct disk size. For this the VM either needs to be rebooted or you can trigger a re-read of the disksize without a reboot with this command (replace `sda` with the correct diskname you resized):
|
||||
@@ -34,45 +36,53 @@ echo 1 > /sys/block/sda/device/rescan
|
||||
|
||||
|
||||
Extend partition:
|
||||
```bash
|
||||
[root@awi-ci-01 ~]# parted /dev/sda
|
||||
GNU Parted 3.2
|
||||
```
|
||||
# parted /dev/sda
|
||||
GNU Parted 3.5
|
||||
Using /dev/sda
|
||||
Welcome to GNU Parted! Type 'help' to view a list of commands.
|
||||
(parted) print
|
||||
(parted) print
|
||||
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 209715200 blocks) or continue with the current setting?
|
||||
Fix/Ignore? fix
|
||||
Model: VMware Virtual disk (scsi)
|
||||
Disk /dev/sda: 45.1GB
|
||||
Disk /dev/sda: 215GB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: gpt
|
||||
Disk Flags:
|
||||
Disk Flags:
|
||||
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 630MB 629MB fat32 EFI System Partition boot, esp
|
||||
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
|
||||
3 1704MB 5999MB 4295MB linux-swap(v1) swap
|
||||
4 5999MB 107GB 101GB lvm
|
||||
|
||||
(parted) resizepart 3
|
||||
End? [36.5GB]? -0
|
||||
(parted) print
|
||||
(parted) resizepart 4
|
||||
End? [107GB]? -0
|
||||
(parted) print
|
||||
Model: VMware Virtual disk (scsi)
|
||||
Disk /dev/sda: 45.1GB
|
||||
Disk /dev/sda: 215GB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: gpt
|
||||
Disk Flags:
|
||||
Disk Flags:
|
||||
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 630MB 629MB fat32 EFI System Partition boot, esp
|
||||
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
|
||||
3 1704MB 5999MB 4295MB linux-swap(v1) swap
|
||||
4 5999MB 215GB 209GB lvm
|
||||
|
||||
(parted) quit
|
||||
(parted) quit
|
||||
Information: You may need to update /etc/fstab.
|
||||
|
||||
#
|
||||
```
|
||||
|
||||
Resize physical volume:
|
||||
```bash
|
||||
[root@awi-ci-01 ~]# pvresize /dev/sda3
|
||||
Physical volume "/dev/sda3" changed
|
||||
```
|
||||
# pvresize /dev/sda4
|
||||
Physical volume "/dev/sda4" 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 [Partitioning](partitioning.md)
|
||||
Reference in new issue
Block a user