Navigate
ScaleArc Customer Support
  • Login to Ignite Global Support
or
Contact Us
  • Get in touch

    Send us an email

  • Submit Feedback

    Feedback and suggestions submitted by customers like you

  • Knowledgebase Read help articles
  • Feedback Custom suggestions
  • Downloads Browse our downloads
  • Contact Us We are here to help
  • Portal
  • Knowledgebase
  • Support Procedures
  • OS Management Procedure
  • How to extend the existing LVM or add disk to LVM.
Subscribe Download PDF

How to extend the existing LVM or add disk to LVM.

Abhijit Dhumal
2017-05-31
0 Comments
in OS Management Procedure

Release Classification Level DB Platform Categories
3.2+ How To ALL Configuration

 

OBJECTIVE

How to extend the existing LVM or add disk to LVM.

PROCEDURE

ScaleArc uses logical volumes to mount the "/root" and "/data" volumes.
In case we have a disk shortage and we need to expand the disk, we can use the LVM to increase the size of /data or /root.
This process is extremely easy to do with LVM as it can be done on the fly with no downtime needed, you can perform it on a mounted volume without interruption.
Before working through the resizing process it’s important you first understand some basic concepts around physical volumes, volume groups, logical volumes, and the file system.

  • Physical Volume (PV): This can be created on a whole physical disk (think /dev/sda) or a Linux partition.
  • Volume Group (VG): This is made up of at least one or more physical volumes.
  • Logical Volume (LV): This is sometimes referred to as the partition, it sits within a volume group and has a file system written to it.
  • File System: A file system such as ext4 will be on the logical volume.

The procedure to extend the LVM is as follows:

  • In order to increase the size of a logical volume, the volume group that it is in must have free space available.
  • To view the free space of your volume group, run vgdisplay command as shown below and look at the “Free PE / Size” field.

 

 

  • If there is free storage available we can expand the LVM using the following command

# lvextend -L<Size>G <Volume Group Path>

  • If there are not much free space available in Physical Volume and Volume group.
  • We can’t extend the lvm size, for extending we need to add one Physical volume (PV).
  • Then we have to extend the volume group by extending the Volume group (VG).

Step 1: Add a New physical disk and create a partition:

  • We will get enough space to extend the Logical volume size. So first we are going to add one physical volume.
  • To add a physical volume we need to add disk additional storage to ScaleArc Instance.
  • Use the following commands to Scan the new device added:
  • To detect a new hard drive attached you need to first get your host bus number used using command
               # grep mpt /sys/class/scsi_host/host?/proc_name
  • You should get a output like below
                 /sys/class/scsi_host/host2/proc_name:mptspi
  • So as you see your host2 is the relevant fields where you need to reset the storage buffer values. Run the below command
                     # echo "- - -" > /sys/class/scsi_host/host2/scan
  • Once done verify if you can see the new hard drive "/dev/sdc"
                          # fdisk -l

 

 

  • For adding a new PV we have to use fdisk to create the LVM partition on the storage.
  1. To Create new partition Press n.
  2. Choose primary partition use p.
  3. Choose which number of partition to be selected to create the primary partition.
  4. Press 1 if no other partition is created on the disk.
  5. Change the type using t.
  6. Type 8e to change the partition type to Linux LVM.
  7. Use p to print the create partition
  8. Press w to write the changes.

 

 

  • Verify if the new partition is visible by "fdisk /dev/sdc"

 

 

 

  • If the partition is not visible in "/dev/" run the command partprobe to make the computer rescan the disk for partitions.
  • If the device is still not listed, reboot the instance. (Rarely Needed)
  • Now the device can be seen listed under /dev/ add the partition to the Volume group

$ vgextend scalearc /dev/sdc2

  •   Verify if the device is displayed under Volume group

# vgs

 

 
Step 2: Add the Partition to Volume group and Extend the Logical volume.
  • Extended the Logical Volume "data" (No need to unmount the /data volume)

$ lvextend /dev/scalearc/data  /dev/sdc2

 

 

  • Verify if the Volume is extended

$ lvs

 

 

  • Resize the File System on LVM "lv_data"

$ resize2fs /dev/vg_data/lv_data

 

 

  • Make sure the /data is expanded.

$ df -ah

 

 

 

 


If you are experiencing issues with ScaleArc or with any of it's features, please contact ScaleArc Support. We are available 24x7 by phone at 855 800 7225 or +1 408 412 7315. For general support inquiries, you can also e-mail us at support@scalearc.com.

Copyright ©2014 ScaleArc, Inc. All rights reserved. Contact Support |  Contact ScaleArc |  Feedback

2901 Tasman Drive Santa Clara, CA 95054 | Email:  support@scalearc.com

Permalink: https://support.scalearc.com/kb/articles/4330

Rate the quality of this page

This page was helpful :) :( This page was not helpful

7 of 18 people found this page helpful


Quick Jump
  • ScaleArc Customer Support
  • Knowledgebase
  • Downloads
  • Feedback
  • Contact Us
Top
Helpdesk software provided by DeskPRO