NEW VPS PLANS

Experience Ultra-high Performance of NVMe Storage on New UK VPS Plans.

Deploy Instantly
  • +357 2425 0808
  • Login
  • English

Home

Blog

How To Create LVM Storage in Linux Serve...

How To Create LVM Storage in Linux Server

How To Create LVM Storage in Linux Server

NetShop ISP

NetShop ISP · Blog Author

Apr 10, 2023 · Dedicated Servers

LVM (Logical Volume Management) is a flexible and powerful storage management system that allows you to manage your storage devices more efficiently. With LVM, you can create logical volumes that span multiple physical disks, resize them, and move them between physical disks without having to shut down your system. In this tutorial, we will cover the following topics:

  1. Benefits of using LVM storage
  2. Prerequisites for creating LVM storage
  3. Steps to create LVM storage in a Linux server
  4. Adding new disks to LVM storage
  5. Removing disks from LVM storage

So, let’s get started.

1. Benefits of using LVM storage

The benefits of using LVM storage are many. Some of the key benefits include:

  • Greater flexibility: With LVM, you can easily resize your partitions, without having to format, delete or recreate them.
  • Better performance: LVM allows you to distribute data across multiple disks, which can improve performance by reducing I/O bottlenecks and increasing throughput.
  • Easier backup and restore: With LVM, you can quickly and easily take snapshots of your logical volumes, which can be used for backup and restore purposes.
  • Increased reliability: By mirroring your logical volumes across multiple disks, you can increase the reliability and availability of your data.

2. Prerequisites for creating LVM storage

Before you can create LVM storage, you need to ensure that you have the following prerequisites in place:

  • One or more physical disks that are not being used by any partition.
  • A running Linux server with root privileges.
  • The LVM2 package installed on your system.

3. Steps to create LVM storage in Linux

Now that you have the prerequisites in place, you can follow these steps to create LVM storage:

Step 1: Create a new partition on your disk

First, you need to create a new partition on your disk that will be used for LVM storage. To do this, you can use the fdisk command:

# fdisk /dev/sdb

Once you are in fdisk, type m to see the available commands.

Then, type n to create a new partition, and follow the prompts to specify the partition size, type and location.

Step 2: Create a physical volume from the new partition

Next, you need to create a physical volume from the new partition that you just created. To do this, you can use the pvcreate command:

# pvcreate /dev/sdb1

This command will initialize the partition as an LVM physical volume.

Step 3: Create a volume group

Now that you have created a physical volume, you need to create a volume group that contains one or more physical volumes.

To do this, you can use the vgcreate command:

# vgcreate myvg /dev/sdb1

This command will create a new volume group called myvg that includes the physical volume /dev/sdb1.

Step 4: Create a logical volume

Finally, you can create a logical volume within the volume group that you just created. To do this, you can use the lvcreate command:

# lvcreate -L 10G -n mylv myvg

This command will create a new logical volume called mylv within the volume group myvg, with a size of 10GB.

4. Adding new disks to LVM storage

If you need to add a new disk to your LVM storage, you can follow these steps:

Step 1: Create a new partition on the new disk using fdisk.
Step 2: Create a new physical volume using the pvcreate command.
Step 3: Add the new physical volume to the existing volume group using the vgextend command.
Step 4: Resize the logical volume using the lvresize command.

5. Removing disks from LVM storage

If you need to remove a disk from your LVM storage, you can follow these steps:

Step 1: Remove the logical volume using the lvremove command.
Step 2: Remove the physical volume from the volume group using the pvmove command.
Step 3: Remove the physical volume using the pvremove command.

Conclusion

In this tutorial, we explained how to create LVM storage in Linux server. By following the steps outlined in this tutorial, you can create flexible and powerful storage solutions that can be easily resized, backed up, and restored.

Press Releases
74

Free VPS Trial

No Credit Card Required.

Recent Posts

NetShop ISP to Attend iFX EXPO International 2024 and Announce Global Infrastructure Expansion

NetShop ISP to Attend iFX EXPO International 2024 and Announce Global Infrastructure Expansion

23 May, 2024

TNFX Broker Partners with NetShop ISP to Offer Low-Latency Forex VPS to Traders

TNFX Broker Partners with NetShop ISP to Offer Low-Latency Forex VPS to Traders

14 May, 2024

How to Install Nginx, MySQL, PHP on Ubuntu 22.04 (LEMP)

How to Install Nginx, MySQL, PHP on Ubuntu 22.04 (LEMP)

10 May, 2024

How To Migrate from MongoDB Atlas to self-hosted Ubuntu 22.04 Server

How To Migrate from MongoDB Atlas to self-hosted Ubuntu 22.04 Server

15 April, 2024

How NetShop ISP Improves Trading Infrastructure Resilience through Equinix LD7 Data Center Hosting

How NetShop ISP Improves Trading Infrastructure Resilience through Equinix LD7 Data Center Hosting

21 March, 2024

#letushostyou

Award Winning Hosting Provider established in 2004.

120 Faneromenis Avenue, Imperial Tower, 2nd Floor, Larnaca 6031, Cyprus

Products

Bare Metal Servers

Customized Servers

Virtual / Cloud Servers

Forex VPS

Storage VPS

cPanel Web Hosting

Reseller Web Hosting

Colocation

Addons

Premium DNS

Email Hosting

Cloud Backup

DDoS Protection

Licenses

SSL Certificates

Domain Names

Premium SLAs

About Us

Data Center Locations

Looking Glass

Our Company

Contact Us

Careers in Cyprus

Become a Partner

Awards

Certifications

© 2024 S.S. NetShop Internet Services Ltd. All rights reserved.  Terms & Conditions  |  Privacy Policy
CY Reg. Number: HE 217340 | EU VAT Number: CY10217340J

Visa
Mastercard
PayPal
Bitcoin
Tether
Ethereum
Litecoin
Wise
Revolut
Wire Transfer