Task: Create LVM partition on 4 TB disk.
Step 1: Identify the Disk
First, list available disks to identify your 4TB hard disk.
Assume the new disk is /dev/sdb (replace it with the actual disk name if different).
Step 2: Partition the Disk
Use
fdiskorpartedto create a partition.Using
fdisk:Press
n(New partition)Press
p(Primary partition)Press Enter (Default first sector)
Press Enter (Default last sector to use the full disk)
Press
t(Change partition type)Enter
8e(Linux LVM)Press
w(Write changes)
Alternatively, using
parted(for disks >2TB using GPT):mklabel gpt(Creates GPT partition table)mkpart primary 1MiB 100%(Creates a full-disk partition)set 1 lvm on(Sets the partition as LVM)quit
Step 3: Create a Physical Volume (PV)
Initialize the partition for LVM:
Check:
Step 4: Create a Volume Group (VG)
Create a volume group (e.g., vg_data):
Check:
Step 5: Create a Logical Volume (LV)
Create a logical volume (e.g., lv_storage with full 4TB size):
Check:
Step 6: Format the Logical Volume
Format it with ext4 or xfs:
For ext4:
For xfs:
Step 7: Mount the Volume
Create a mount point and mount it:
To make it persistent, add it to /etc/fstab:
Replace ext4 with xfs if using XFS.
Step 8: Verify
Check the mount and LVM status:
Now, your 4TB LVM storage is ready! ? Let me know if you need any clarifications.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article