rhcsa - 7-10 - tasks
7. create a new 2gb volume group vgprac
8. create 500 mb logical lvprac inside the vgprac
9. lvprac xfs and mount to /mnt/lvprac
10. exptend lvprac by 500 mb
7. solution:
[root@localhost ~]# fdisk /dev/sdb
--create partition /dev/sdb1 -> 2GB
[root@localhost ~]# partprobe
[root@localhost ~]# lsblk -p
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
/dev/sda 8:0 0 15G 0 disk
├─/dev/sda1 8:1 0 1G 0 part /boot
└─/dev/sda2 8:2 0 14G 0 part
├─/dev/mapper/cs-root 253:0 0 12.5G 0 lvm /
└─/dev/mapper/cs-swap 253:1 0 1.5G 0 lvm [SWAP]
/dev/sdb 8:16 0 10G 0 disk
└─/dev/sdb1 8:17 0 2G 0 part
/dev/sr0 11:0 1 1024M 0 rom
[root@localhost ~]# vgcreate vgprac /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
Volume group "vgprac" successfully created
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cs 1 2 0 wz--n- <14.00g 0
vgprac 1 0 0 wz--n- <2.00g <2.00g
[root@localhost ~]#
8. [root@localhost ~]# lvcreate -L 500M -n lvprac vgprac
Logical volume "lvprac" created.
9.
[root@localhost ~]# vi /etc/fstab
[root@localhost ~]# mkdir -p /mnt/lvprac
[root@localhost ~]# mount -a
[root@localhost ~]# df -hT /mnt/lvprac
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vgprac-lvprac xfs 495M 29M 466M 6% /mnt/lvprac
10.
[root@localhost ~]# df -hT /mnt/lvprac
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vgprac-lvprac xfs 495M 29M 466M 6% /mnt/lvprac
[root@localhost ~]# lvextend -L +500M -r /dev/mapper/vgprac-lvprac
Size of logical volume vgprac/lvprac changed from 500.00 MiB (125 extents) to 1000.00 MiB (250 extents).
Logical volume vgprac/lvprac successfully resized.
meta-data=/dev/mapper/vgprac-lvprac isize=512 agcount=4, agsize=32000 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=128000, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=1368, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 128000 to 256000
[root@localhost ~]# df -hT /mnt/lvprac
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vgprac-lvprac xfs 995M 33M 963M 4% /mnt/lvprac
[root@localhost ~]#
Žiadne komentáre:
Zverejnenie komentára