本卡组中的卡片 (30)

正在搜索...
  • 1

    What are the three layers of LVM architecture?


    • Physical Volumes (PV)
    • Volume Groups (VG)
    • Logical Volumes (LV)
    lvm architecture
  • 2

    Which command creates a physical volume?


    pvcreate /dev/sdb1

    lvm commands
  • 3

    Which command shows brief physical volume information?


    pvs

    lvm commands
  • 4

    What command creates a volume group named vgdata?


    vgcreate vgdata /dev/sdb1

    lvm commands
  • 5

    Which command extends a volume group with a new PV?


    vgextend vgname /dev/sdc1

    lvm commands
  • 6

    What command shows brief volume group information?


    vgs

    lvm commands
  • 7

    How to create a 2GB logical volume named lvdata?


    lvcreate -L 2G -n lvdata vgname

    lvm commands
  • 8

    Which command creates an LV using all free space in VG?


    lvcreate -l 100%FREE -n lvname vgname

    lvm commands
  • 9

    How to extend a logical volume by 1GB?


    lvextend -L +1G /dev/vgname/lvname

    lvm commands
  • 10

    How to extend an XFS filesystem after extending LV?


    xfs_growfs /mount/point

    lvm filesystems
  • 11

    What command extends an ext4 filesystem after LV extension?


    resize2fs /dev/vgname/lvname

    lvm filesystems
  • 12

    Can you reduce an XFS filesystem?


    No, XFS filesystems cannot be reduced, only extended.

    lvm filesystems
  • 13

    What must you do before reducing an ext4 filesystem?


    Unmount the filesystem and check it with e2fsck -f.

    lvm filesystems
  • 14

    What is the correct order for reducing ext4?


    • Unmount
    • Check filesystem
    • Reduce filesystem
    • Reduce LV
    • Remount
    lvm filesystems
  • 15

    How to create an LVM snapshot?


    lvcreate -L 1G -s -n snapname /dev/vgname/lvname

    lvm snapshots
  • 16

    What partition type code is used for LVM in fdisk?


    8e (Linux LVM) or type 31 in newer versions.

    lvm partitioning
  • 17

    Which command displays detailed logical volume information?


    lvdisplay

    lvm commands
  • 18

    What is RAID 0?


    Striping improves performance but no redundancy, minimum 2 disks.

    raid levels
  • 19

    What is RAID 1?


    Mirroring provides redundancy, minimum 2 disks.

    raid levels
  • 20

    What is RAID 5?


    Striping with parity redundancy + performance, minimum 3 disks, can lose 1 disk.

    raid levels
  • 21

    How to create a RAID 1 array?


    mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1

    raid commands
  • 22

    Which file shows current RAID status?


    /proc/mdstat or use cat /proc/mdstat.

    raid status
  • 23

    Which command shows detailed RAID information?


    mdadm --detail /dev/md0

    raid commands
  • 24

    Where should RAID configuration be saved for persistence?


    /etc/mdadm.conf using mdadm --detail --scan >> /etc/mdadm.conf.

    raid configuration
  • 25

    How to create a Stratis pool?


    stratis pool create poolname /dev/sdb

    stratis commands
  • 26

    What command creates a Stratis filesystem?


    stratis filesystem create poolname fsname

    stratis filesystem commands
  • 27

    Where are Stratis filesystems mounted from?


    /stratis/poolname/fsname

    stratis filesystem mounting
  • 28

    What service must be running for Stratis?


    stratisd service

    stratis service requirements
  • 29

    What option in /etc/fstab ensures Stratis mounts correctly?


    x-systemd.requires=stratisd.service

    stratis fstab mounting
  • 30

    What command merges an LVM snapshot back to original?


    lvconvert --merge /dev/vgname/snapname

    lvm snapshot commands
学习笔记

LVM Architecture

Three Layers of LVM

  • Physical Volumes (PV): Actual devices used for storage.
  • Volume Groups (VG): Collections of PVs that create a pool of storage.
  • Logical Volumes (LV): Virtual partitions that can be created from VG.

Managing Physical Volumes

  • Create Physical Volume: pvcreate /dev/sdb1
  • Show Physical Volume Information: pvs

Managing Volume Groups

  • Create a Volume Group: vgcreate vgdata /dev/sdb1
  • Extend a Volume Group: vgextend vgname /dev/sdc1
  • Show Volume Group Information: vgs

Managing Logical Volumes

  • Create a 2GB Logical Volume: lvcreate -L 2G -n lvdata vgname
  • Use All Free Space for LV: lvcreate -l 100%FREE -n lvname vgname
  • Extend a Logical Volume by 1GB: lvextend -L +1G /dev/vgname/lvname

Filesystem Extension After LV Changes

  • Extend XFS Filesystem: xfs_growfs /mount/point
  • Extend ext4 Filesystem: resize2fs /dev/vgname/lvname

Reducing Filesystems

  • Reducing XFS: Not possible, only extend.
  • Before Reducing ext4: Unmount and run e2fsck -f.
  • Order for Reducing ext4:
  • Unmount
  • Check filesystem
  • Reduce filesystem
  • Reduce LV
  • Remount

LVM Snapshots

  • Create LVM Snapshot: lvcreate -L 1G -s -n snapname /dev/vgname/lvname
  • Merge Snapshot Back: lvconvert --merge /dev/vgname/snapname

Partition Type Code for LVM

  • Code: 8e (Linux LVM) or 31 in newer versions.

Detailed Information Commands

  • Show Detailed LV Information: lvdisplay

RAID Overview

RAID Levels

  • RAID 0: Striping for improved performance; no redundancy; minimum 2 disks.
  • RAID 1: Mirroring for redundancy; minimum 2 disks.
  • RAID 5: Striping with parity; allows losing 1 disk; minimum 3 disks.

Managing RAID

  • Create RAID 1 Array: mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
  • Check Current RAID Status: cat /proc/mdstat
  • Show Detailed RAID Information: mdadm --detail /dev/md0
  • Save Configuration for Persistence: mdadm --detail --scan >> /etc/mdadm.conf

Stratis Filesystems

  • Create a Stratis Pool: stratis pool create poolname /dev/sdb
  • Create a Stratis Filesystem: stratis filesystem create poolname fsname
  • Mount Path: /stratis/poolname/fsname
  • Required Service: Ensure stratisd service is running.
  • Fstab Option: x-systemd.requires=stratisd.service ensures correct mounting.