الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

معمل 15.1RHCSA 10, الفصل 15

Create LVM volumes with extents

المستوى
متوسط
35 دقيقة
الأجهزة
server1
الحالة
لم يبدأ

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

الهدف

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

قبل أن تبدأ

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

المهام

  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.

تحقّق من عملك

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.

تلميحات

اعرض التلميحات

الحل

اعرض الحل
  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'

ملاحظاتي

لا توجد ملاحظات بعد.

دروس هذا المعمل

الأوامر في هذا المعمل