- Log in to post comments
- Check Available Disk
[root@testsvr01~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 59G 0 part
├─rhel-root 253:0 0 35.6G 0 lvm /
├─rhel-swap 253:1 0 6G 0 lvm [SWAP]
└─rhel-home 253:2 0 17.4G 0 lvm /home
sdb 8:16 0 250G 0 disk
sdc 8:32 0 250G 0 disk
sr0 11:0 1 376K 0 rom
sr1 11:1 1 1024M 0 rom
- Create Physical Disk Group
[root@testsvr01~]# pvcreate /dev/sdb /dev/sdc
Physical volume "/dev/sdb" successfully created.
Physical volume "/dev/sdc" successfully created.
- Create Volumn Group
[root@testsvr01~]# vgcreate vg_data /dev/sdb /dev/sdc
Volume group "vg_data" successfully created
- Create Logical Volumn
[root@testsvr01~]# lvcreate -n lv_data -l 100%FREE vg_data
Logical volume "lv_data" created.
- List Logical Volumn
[root@testsvr01~]# lvdisplay
--- Logical volume ---
LV Path /dev/vg_data/lv_data
LV Name lv_data
VG Name vg_data
LV UUID Wbnxhc-fh6E-pqfh-TtXZ-edYe-S2w1-Abxtgk
LV Write Access read/write
LV Creation host, time testsvr01, 2022-12-15 15:06:22 +0530
LV Status available
# open 0
LV Size 499.99 GiB
Current LE 127998
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:3
- Format Logical Volumn with XFS Partition
[root@testsvr01~]# mkfs.xfs /dev/vg_data/lv_data
meta-data=/dev/vg_data/lv_data isize=512 agcount=4, agsize=32767488 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=0 inobtcount=0
data = bsize=4096 blocks=131069952, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=63999, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
Discarding blocks...Done.
- Add New Directory for Mounting
[root@testsvr01~]# mkdir /data
- Append Entry for Mount Logical Volumn at startup
[root@testsvr01~]# vi /etc/fstab
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=968d0f4a-9ff1-4450-8629-78323e566bbd /boot xfs defaults 0 0
/dev/mapper/rhel-home /home xfs defaults 0 0
/dev/mapper/rhel-swap none swap defaults 0 0
/dev/vg_data/lv_data /data xfs defaults 0 0
- Reload Systemctl daemon
[root@testsvr01~]# systemctl daemon-reload
- Check Mount status before Mount
[root@testsvr01~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 8.8M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/rhel-root 36G 2.5G 34G 7% /
/dev/sda1 1014M 380M 635M 38% /boot
/dev/mapper/rhel-home 18G 157M 18G 1% /home
tmpfs 3.2G 0 3.2G 0% /run/user/0
- Mount New Logical Volumn
[root@testsvr01~]# mount -a
- Check Mount status after mount command
[root@testsvr01~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 8.8M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/rhel-root 36G 2.5G 34G 7% /
/dev/sda1 1014M 380M 635M 38% /boot
/dev/mapper/rhel-home 18G 157M 18G 1% /home
tmpfs 3.2G 0 3.2G 0% /run/user/0
/dev/mapper/vg_data-lv_data 500G 3.6G 497G 1% /data