cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 157 Views

Scenario & a solution

Happy Friday! Let's work through a hands-on scenario.

Scenario: a new, unformatted 5 GiB disk has been added to your system. Your task is to:

  1. Create a new logical volume named lv_data01 that is 2 GiB in size.

  2. Place it in a new volume group named vg_database.

  3. Format the logical volume with the xfs file system.

  4. Ensure it's automatically mounted on /srv/data at boot.

Without looking at the man pages, what are the main commands (pvcreate, vgcreate, lvcreate, etc.) you would use in order to accomplish this? Let's map out the steps!

5 Replies
TudorRaduta
Community Manager
Community Manager
  • 156 Views

My first step would be to use lsblk to identify the device name of the new disk...

shashi01
Moderator
Moderator
  • 119 Views

# 1. Identify the new disk (e.g., /dev/sdb)
lsblk

# 2. Initialize the disk as a Physical Volume
pvcreate /dev/sdb

# 3. Create a Volume Group named 'vg_database'
vgcreate vg_database /dev/sdb

# 4. Create a 2 GiB Logical Volume named 'lv_data01'
lvcreate -L 2G -n lv_data01 vg_database

# 5. Format the Logical Volume with XFS filesystem
mkfs.xfs /dev/vg_database/lv_data01

# 6. Create the mount point directory
mkdir -p /srv/data

# 7. Get the UUID of the Logical Volume (for fstab)
blkid /dev/vg_database/lv_data01

# 8. Edit /etc/fstab to ensure automatic mounting at boot
vim /etc/fstab

# 9. Reboot the system to validate fstab mount
 systemctl reboot

# 10. Verify it's mounted
df -h /srv/data

Screenshot From 2025-09-26 16-24-25.png

Chetan_Tiwary_
Community Manager
Community Manager
  • 52 Views

I would nominate @Trevor   @ARoumiantsev  for this challenge! 

Trevor
Commander Commander
Commander
  • 38 Views

Chetan,

I accept your nomination!!!  Bear with me on the submission of
my solution.  For the next 3 days, I'm a little engaged with a
Cybersecurity conference.  For sure, after I'm free, I've got to
take a bite of this!!

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 9 Views

sure @Trevor take your time !

0 Kudos
Join the discussion
You must log in to join this conversation.