LVM Configuration - RHEL 8 (EX294)
LVM Configuration - RHEL 8 (EX294)
LVM Configuration - RHEL 8 (EX294)
[root@localhost ~]#
:wq!
OR
Note: IN rhel8 you will run lvresize command directly rather then
lvextend and xfs_growfs
Second Task task:- If Filesystem type is in Ext-2, Ext-3 & Ext-4 -----
--Support in Rhel-7 + RHEL8
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# lvresize -L 500M -r /dev/myvg1/mylv2
Do you want to unmount "/lvm2" ? [Y|n] y
fsck from util-linux 2.32.1
/dev/mapper/myvg1-mylv2: 1902/203200 files (0.2% non-contiguous),
62726/819200 blocks
resize2fs 1.44.3 (10-July-2018)
Resizing the filesystem on /dev/mapper/myvg1-mylv2 to 512000 (1k)
blocks.
The filesystem on /dev/mapper/myvg1-mylv2 is now 512000 (1k) blocks
long.
Size of logical volume myvg1/mylv2 changed from 800.00 MiB (200
extents) to 500.00 MiB (125 extents).
Logical volume myvg1/mylv2 successfully resized.
[root@localhost ~]#
Note:- First we will create one more Volume group to perform this
operation.
Selected partition 4
First sector (10487808-20971519, default 10487808): Blank Enter
Last sector, +sectors or +size{K,M,G,T,P} (10487808-20971519, default
20971519): Blank Enter
[root@localhost ~]#
We need to reboot the machine here if we are using the fdisk command
but
if you will try same thing with parted command , will not give you the
errors.
Simple you can run #partprobe /dev/sdb { to update the partition
table }
next steps:----
:wq!
Next Task:-
1 PE : 8 MB
Format : ext3
mount : /lvm4
[root@localhost ~]#
[root@localhost ~]# partprobe /dev/sdb
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# pvcreate /dev/sdb6
Physical volume "/dev/sdb6" successfully created.
[root@localhost ~]#
[root@localhost ~]#
:wq!
File: /etc/lvm/archive/fedora_00004-1374339324.vg
VG name: fedora
Description: Created *before* executing 'lvremove
/dev/fedora/redhat'
Backup Time: Sun Sep 1 01:55:22 2019
File: /etc/lvm/backup/fedora
VG name: fedora
Description: Created *after* executing 'lvremove
/dev/fedora/redhat'
Backup Time: Sun Sep 1 01:55:22 2019
....................
......................
Note: Copy "before" indexing numbner and paste it into this
command
[root@localhost ~]# vgcfgrestore -f /etc/lvm/archive/fedora_00004-
1374339324.vg fedora
File: /etc/lvm/archive/fedora_00005-967194627.vg
VG name: fedora
Description: Created *before* executing 'lvremove
/dev/fedora/redhat'
Backup Time: Sun Sep 1 02:01:12 2019
File: /etc/lvm/archive/fedora_00006-548712493.vg
VG name: fedora
Description: Created *before* executing 'vgremove /dev/fedora'
Backup Time: Sun Sep 1 02:01:17 2019
Note: First we will restore the volume group after then LVM....
Commands Help
************************************************
:wq
[root@localhost ~]#
[root@localhost ~]# partprobe /dev/sdb
[root@localhost ~]#
[root@localhost ~]# udevadm settle
[root@localhost ~]#
**************************End *********************************