• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 24, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

How to Add New Disks Using LVM to an Existing Linux System

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
155
VIEWS
Share on FacebookShare on Twitter

LVM (Logical Volume Management) is a flexible and advanced option available to manage hard disks in most of the major Linux distributions. It is easy to manage the disks with LVM than the tradition tools like fdisk, parted or gparted.

Some of the terms which you need to understand while using LVM:

  • Physical Volume (PV): Consists of Raw disks or RAID arrays or other storage devices.
  • Volume Group (VG): Combines the physical volumes into storage groups.
  • Logical Volume (LV): VG’s are divided into LV’s and are mounted as partitions.

In this article, we will take you through the steps to configure Disks using LVM in existing Linux machine by creating PV, VG’s and LV’s.

Note: If you don’t what to use LVM, you can add disk directly to an existing Linux system using these guides.

  1. How to Add a New Disk to Linux System
  2. How to Add a New Disk Larger Than 2TB to Linux System

Let’s consider a scenario where there are 2 HDD of 20GB and 10GB, but we need to add only 2 partitions one of 12GB and another 13GB. We can achieve this using LVM method only.

Once the disks has been added, you can list them using the following command.

# fdisk -l
How to Add New Disks Using LVM to an Existing Linux System

Verify Hard Disks

1. Now partitions both the disks /dev/xvdc and /dev/xvdd using fdisk command as shown.

# fdisk /dev/xvdc
# fdisk /dev/xvdd

Use n to create the partition and save the changes with w command.

How to Add New Disks Using LVM to an Existing Linux System

Partition Hark Disks

2. After partitioning, use the following command to verify the partitions.

# fdisk -l
How to Add New Disks Using LVM to an Existing Linux System

Verify New Partitions

3. Create Physical Volume (PV).

# pvcreate /dev/xvdc1
# pvcreate /dev/xvdd1
How to Add New Disks Using LVM to an Existing Linux System

Create Physical Volume

4. Create Volume Group (VG).

# vgcreate testvg /dev/xvdc1 /dev/xvdd1

Here, “testvg” is the VG name.

How to Add New Disks Using LVM to an Existing Linux System

Create Volume Group

5. Now use “vgdisplay” to list all details about the VG’s in the system.

# vgdisplay
OR
# vgdisplay testvg
How to Add New Disks Using LVM to an Existing Linux System

List Volume Group

6. Create Logical Volumes (LV).

# lvcreate -n lv_data1 --size 12G testvg
# lvcreate -n lv_data2 --size 14G testvg

Here, “lv_data1” and “lv_data2” are LV name.

How to Add New Disks Using LVM to an Existing Linux System

Create Logical Volumes

7. Now use “lvdisplay” to list all details about the Logical volumes available in the system.

# lvdisplay
OR
# lvdisplay testvg
How to Add New Disks Using LVM to an Existing Linux System

List Logical Volumes

8. Format the Logical Volums (LV’s) to ext4 format.

# mkfs.ext4 /dev/testvg/lv_data1
# mkfs.ext4/dev/testvg/lv_data2
How to Add New Disks Using LVM to an Existing Linux System

Format LV to Ext4 Format

9. Finally, mount the file system.

# mount /dev/testvg/lv_data1 /data1
# mount /dev/testvg/lv_data2 /data2

Make sure to create data1 and data2 directories before mounting the filesystem.

How to Add New Disks Using LVM to an Existing Linux System

Mount Filesystem

That’s it! In this article, we discussed how to create a partition using LVM. If you have any comments or queries regarding this, feel free to post in the comments.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

5 Command Line Ways to Find Out Linux System is 32-bit or 64-bit

Next Post

vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux

Next Post

vlock – A Smart Way to Lock User Virtual Console or Terminal in Linux

Leave a Reply Cancel reply

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

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet