Adding a new volume to the existing volume group

  • Post author:
  • Post category:IT / RedHat

You can use the vgs command to display the attributes of the new volume group.
vgs

[root@elkbserver ~]# vgs
 VG #PV #LV #SN Attr VSize VFree
 cl 1 2 0 wz--n- 15.00g 0
 mynew-vg 2 2 0 wz--n- 19.99g 8.99g

Displaying Logical Volumes
lvcsan – scans forall logical volumes in the system and lists them.

[root@elkbserver ~]# lvscan
 ACTIVE '/dev/mynew-vg/vol101' [10.00 GiB] inherit
 ACTIVE '/dev/mynew-vg/new_logical_volume' [1.00 GiB] inherit
 ACTIVE '/dev/cl/swap' [1.60 GiB] inherit
 ACTIVE '/dev/cl/root' [13.39 GiB] inherit

Create the logical volume from the volume group you have created or exiting volume group. I have a existing volume grou named mynew-vg with enough space.

lvcreate -L 1G -n new_logical_volume mynew-vg

Logical volume “new_logical_volume” created


Create a file system on the logical volume. The following command creates a xfs file system on the logical volume.

mkfs.xfs /dev/mynew-vg/new_logical_volume

[root@elkbserver ~]# mkfs.xfs /dev/mynew-vg/new_logical_volume
meta-data=/dev/mynew-vg/new_logical_volume isize=512 agcount=4, agsize=65536 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=262144, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

create mount dir

mkdir oracle

Mount the logical volume

mount /dev/mynew-vg/new_logical_volume /oracle

.