Create a LVM more than 2 TB

How to create an LVM (Logical Volume Management) volume of more than 2 TB from a raw disk in Linux?

Creating a larger partition you can follow below steps:

Ensure that you have a raw disk with sufficient space for your
LVM. You can check space using commads like lsblk or fdisk -l.

We can initialize the Disk (if needed):

Like if the raw disk is not initialized or contains some
existing data, you should use fdisk or parted to create a new
partition on the disk. For this example, we will create a
GPT partition:
# parted /dev/sdX
(parted) mklabel gpt
(parted) mkpart primary ext4 0% 100%
(parted) quit
Now go ahead and follow below steps to create a LVM.

Create a Physical Volume (PV):
# pvcreate /dev/sda2
Create a Volume Group (VG):
# vgcreate my_vg_name /dev/sda2
Create a Logical Volume (LV):

Create a new Logical Volume (LV) with the size you need
(more than 2 TB). For example, to create a 10 TB LV:
# lvcreate -L 10T -n my_lv_name my_vg_name
Create a Filesystem:

Create a filesystem on the new LV. You can use mkfs.ext4
for ext4 or mkfs.xfs for XFS:

For ext4:
# mkfs.ext4 /dev/my_vg_name/my_lv_name
For XFS:
# mkfs.xfs /dev/my_vg_name/my_lv_name
Mount the Logical Volume:

Create a directory where you want to mount your new LVM
volume and mount it:
# mkdir /data
# mount /dev/my_vg_name/my_lv_name /data
Automount on Boot:

If you want the LV to be mounted automatically on system boot,
add an entry to /etc/fstab. Use the same method as mentioned
in the previous responses.

Leave a Reply

Your email address will not be published. Required fields are marked *