nerdexam
CompTIA

XK0-005 · Question #10420

A Linux system is getting an error indicating the root filesystem is full. Which of the following commands should be used by the systems administrator to resolve this issue? (Choose three.)

The correct answer is A. df -h / C. growpart /dev/mapper/rootvg-rootlv E. lvresize -L +10G -r /dev/mapper/rootvg-rootlv. To resolve a full root filesystem managed by LVM, an administrator must first diagnose the usage, then extend the underlying storage if needed, and finally resize the logical volume and its filesystem.

Troubleshooting

Question

A Linux system is getting an error indicating the root filesystem is full. Which of the following commands should be used by the systems administrator to resolve this issue? (Choose three.)

Options

  • Adf -h /
  • Bfdisk -1 /dev/sdb
  • Cgrowpart /dev/mapper/rootvg-rootlv
  • Dpvcreate /dev/sdb
  • Elvresize -L +10G -r /dev/mapper/rootvg-rootlv
  • Flsblk /dev/sda
  • Gparted -l /dev/mapper/rootvg-rootlv
  • Hvgextend /dev/rootvg /dev/sdb

How the community answered

(24 responses)
  • A
    71% (17)
  • B
    4% (1)
  • D
    17% (4)
  • F
    8% (2)

Why each option

To resolve a full root filesystem managed by LVM, an administrator must first diagnose the usage, then extend the underlying storage if needed, and finally resize the logical volume and its filesystem.

Adf -h /Correct

`df -h /` is the initial command to check the disk space usage of the root filesystem, providing a human-readable overview of consumed and available space.

Bfdisk -1 /dev/sdb

`fdisk -l /dev/sdb` lists partition tables on `/dev/sdb`, which is for inspection, not for resolving a full root filesystem.

Cgrowpart /dev/mapper/rootvg-rootlvCorrect

If the physical disk has been logically expanded (e.g., in a virtual machine), `growpart` is used to extend the underlying disk partition that contains the LVM Physical Volume, making the newly available space usable for LVM.

Dpvcreate /dev/sdb

`pvcreate /dev/sdb` creates a Physical Volume on a new disk, which is a preparatory step for adding new storage, not for extending an existing full filesystem directly.

Elvresize -L +10G -r /dev/mapper/rootvg-rootlvCorrect

`lvresize -L +10G -r /dev/mapper/rootvg-rootlv` extends the `rootlv` Logical Volume by 10 gigabytes, and the crucial `-r` option automatically resizes the filesystem on that logical volume to fill the newly available space, directly addressing the 'filesystem full' issue.

Flsblk /dev/sda

`lsblk /dev/sda` lists block devices on `/dev/sda`, serving as an inspection tool rather than a solution for a full filesystem.

Gparted -l /dev/mapper/rootvg-rootlv

`parted -l /dev/mapper/rootvg-rootlv` is used to display partition tables and is not suitable for resizing an LVM logical volume.

Hvgextend /dev/rootvg /dev/sdb

`vgextend /dev/rootvg /dev/sdb` adds a Physical Volume (`/dev/sdb`) to a Volume Group (`/dev/rootvg`), which increases the VG's capacity but does not directly extend a Logical Volume or its filesystem.

Concept tested: LVM root filesystem expansion and diagnosis

Source: https://linuxconfig.org/how-to-resize-lvm-root-partition-on-linux

Topics

#Linux#LVM#Filesystem Management#Disk Expansion

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice