cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 82 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!

2 Replies
TudorRaduta
Community Manager
Community Manager
  • 81 Views

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

0 Kudos
shashi01
Moderator
Moderator
  • 44 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

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