Manage Logical Volumes Flashcards
1
Q
What is the order to create a logical volume?
A
Hard Disks (/dev/sda, /dev/sdb, /dev/sdc)
Partitions (/dev/sda1, /dev/sdb1, /dev/sdc1)
Physical Volume (/dev/sda1, /dev/sdb1, /dev/sdc1)
Volume Group (datavg)
Logical Volume (datalv)
File System (datafs)
2
Q
What are the steps to creating a logical volume?
A
- Create Partition
fdisk /dev/sdc
n - new partition
p - primary partition type
default - partition number
default - first sector
default - last sector
p - for checking work
t - change partition system id
L - to find LVM
8e=LVM
8e - then enter
w - write to partition table - Create Physical Volume
pvcreate /dev/sdc1 - creates physical volume
pvdisplay - displays physical volume - Create Volume Group
vgcreate redhat_vg - Creates volume group
assigned to /dev/sdc1
vgdisplay redhat_vg - Displays volume group - Create Logical Volumes
lvcreate -n redhat_lv –size 100G redhat_vg
lvdisplay - displays logical volume - Assign File System
mkfs.xfs /dev/mapper/redhat_vg/redhat_lv - Mount Directory
mkdir /redhat
mount /dev/mapper/redhat_vg/redhat_lv
/redhat
3
Q
What are the steps to extend disk space using LVM?
A
- Partition Disk
fdisk /dev/sdc
n - new partition
p - primary partition type
default - partition number
default - first sector
default - last sector
p - for checking work
t - change partition system id
L - to find LVM
8e=LVM
8e - then enter
w - write to partition table - Create Physical Volume
pvcreate /dev/sdd1 - Extend
vgextend redhat_vg /dev/sdd1
lvextend -L+1024M (or -l+100%FREE)
/dev/mapper/redhat_vg-redhat_lv
xfs_growfs /dev/mapper/redhat_vg-redhat_lv