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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the steps to creating a logical volume?

A
  1. 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
  2. Create Physical Volume
    pvcreate /dev/sdc1 - creates physical volume
    pvdisplay - displays physical volume
  3. Create Volume Group
    vgcreate redhat_vg - Creates volume group
    assigned to /dev/sdc1
    vgdisplay redhat_vg - Displays volume group
  4. Create Logical Volumes
    lvcreate -n redhat_lv –size 100G redhat_vg
    lvdisplay - displays logical volume
  5. Assign File System
    mkfs.xfs /dev/mapper/redhat_vg/redhat_lv
  6. Mount Directory
    mkdir /redhat
    mount /dev/mapper/redhat_vg/redhat_lv
    /redhat
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the steps to extend disk space using LVM?

A
  1. 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
  2. Create Physical Volume
    pvcreate /dev/sdd1
  3. 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly