Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Lab 15.1RHCSA 10, Hoofdstuk 15

Create LVM volumes with extents

Niveau
Gemiddeld
35 min
Machines
server1
Status
Nog niet begonnen

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Doel

Build a volume group with a fixed extent size and two logical volumes that are mounted at every boot.

Voordat je begint

  • You need an empty disk of at least 5 GiB (in this lab /dev/vdc; check with lsblk). Work as root.

Taken

  1. Create a partition of 4 GiB of the type LVM on the disk and make it a physical volume.
  2. Create the volume group vgfiles with an extent size of 8 MiB.
  3. Create the logical volume lvfiles with exactly 50 extents. Format it with XFS and mount it on /files at every boot.
  4. Create the logical volume lvdocs with the rest of the free space. Format it with ext4 and mount it on /docs at every boot.
  5. Show the size of lvfiles in MiB and the PE size of the VG.

Controleer je werk

pvs; vgs vgfiles; lvs vgfiles
vgdisplay vgfiles | grep 'PE Size'
findmnt /files; findmnt /docs
df -h /files /docs
  • vgdisplay shows PE Size 8.00 MiB.
  • lvfiles is 400 MiB (50 × 8 MiB).
  • Both file systems are mounted after a reboot.

Hints

Toon de hints

Oplossing

Toon de oplossing
  1. Partition and PV.
    fdisk /dev/vdc
    Command (m for help): g
    Command (m for help): n          (Enter, Enter, +4G)
    Command (m for help): t          (lvm)
    Command (m for help): w
    pvcreate /dev/vdc1
  2. VG with 8 MiB extents.
    vgcreate -s 8M vgfiles /dev/vdc1
  3. lvfiles with 50 extents, XFS, fstab.
    lvcreate -n lvfiles -l 50 vgfiles
    mkfs.xfs /dev/vgfiles/lvfiles
    mkdir /files
    echo "/dev/vgfiles/lvfiles /files xfs defaults 0 0" >> /etc/fstab
  4. lvdocs with the rest, ext4, fstab.
    lvcreate -n lvdocs -l 100%FREE vgfiles
    mkfs.ext4 /dev/vgfiles/lvdocs
    mkdir /docs
    echo "/dev/vgfiles/lvdocs /docs ext4 defaults 0 0" >> /etc/fstab
    systemctl daemon-reload; mount -a
  5. Sizes.
    lvs --units m vgfiles
    vgdisplay vgfiles | grep 'PE Size'

Mijn notities

Nog geen notities.

Lessen voor dit lab

Commando's in dit lab