You have a CentOS Stream 9 workstation whose /home directory sits on the logical volume /dev/data_vg/home_lv. The file system is ext4 and is currently mounted. After installing a new 1 TB SSD, the device appears as /dev/sdc. You want to give the /home file system all of the space on the new drive with the fewest possible commands and without unmounting the file system. Which ordered set of commands will safely accomplish this task?
The new disk must first be turned into an LVM physical volume with pvcreate. It can then be added to the existing volume group with vgextend. Finally, lvextend -l +100%FREE -r grows the logical volume to consume every free extent in the group and, thanks to the -r (--resizefs) flag, automatically invokes fsadm/resize2fs to expand the mounted ext4 file system online. This sequence completes the job in a single short outage-free workflow.
The second choice recreates the volume group instead of extending it, which would destroy existing logical volumes. The third choice omits the -r flag and tries to run xfs_growfs on an ext4 file system, which fails. The fourth choice creates a new logical volume instead of enlarging the current one, so /home would remain the original size.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an LVM (Logical Volume Manager) and why is it used?
Open an interactive chat with Bash
What does the 'pvcreate' command do in LVM?
Open an interactive chat with Bash
What does the '-l +100%FREE -r' option in lvextend mean?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access