Increasing the disk size for your Master Server

Follow

Introduction

This article is a guide on the steps required to increase disk space for your Enterprise Recon Master Server. These instructions are intended for Master Servers based on CentOS 7.x.

You can check the version of CentOS in use on your Master Server by logging into the command line and typing "cat /etc/centos-release".

Master Servers installed from our 2.0.28 ISO (or newer) utilise CentOS 7.x. Customers who are using older Master Servers should contact our support team for assistance with migration.

 

 

Instructions

IMPORTANT: Before performing any steps in this article, ensure that you have performed a backup of your master server or taken a VM snapshot.

Note: These instructions are intended for a master server installed on a VM environment.

1. Perform a graceful shutdown

/etc/init.d/er2-master stop
shutdown -h now

2. For this step you have two options:

        a. Add an additional disk (recommended option)
        b. Resize an existing disk (slightly more advanced option)

The steps will vary depending on the VM host you are using. Refer to your host VM platform provider for instructions.

3. Boot up the master server and login as root.

 

 

Steps where you have added an additional disk

4. Run the following commands to check the existing disks and partitions:

ls -l /dev/sd*
lsblk

The new disk will typically show as a block device with no partitions or logical volumes.

 5. Use fdisk to list the current partitions (You should see the new virtual disk. Note the name of the new disk. e.g /dev/sdb)

fdisk -l or # fdisk | less

6. Use fdisk to create a partition on the new disk (e.g. /dev/sdb)

fdisk /dev/sdb

Note that the partition name you choose may vary.

7. Use the following fdisk commands:

n - Add a new partition
p - To choose primary partition
1 - Give the partition a number as desired.
<Enter> - Give value for first sector (press enter to choose the default value)
<Enter> - Give value for last sector (press enter to choose the default value)
p - print the partitions
t - Set type of partition
1 - Select partition number (as above)
8e - Enter the hex value for Linux LVM: 8e
w - Write the changes

8. Reboot the server

/etc/init.d/er2-master stop
shutdown -r now

9. Run the following command to view the existing physical volume:

pvdisplay

10. Verify the name of the newly created partition:

lsblk

The output should show the name you've created, for example /dev/sdb1. 

11. Use pvcreate to create a physical volume for the newly added partitioned disk (e.g. /dev/sdb1)

pvcreate /dev/sdb1

 12. Run pvdisplay to verify the new physical volume

pvdisplay

 13. Display information about the volume groups

vgdisplay

Take note of the VG name field. (e.g. VolGroup00).

14. Add the physical volume into the volume group

vgextend -t -v <Volume Group name> <new partition>

e.g. # vgextend VolGroup00 /dev/sdb1

If this command reports that the volume group was successfully extended, then execute the same command again without the -t (test option):

e.g. # vgextend -v VolGroup00 /dev/sdb1

15. Check volume group

vgdisplay

Take note of the Free PE size. You will need this value to extend the logical volume.

e.g Free PE / Size 5119 / <20.00 GiB

(the value we need for FREE_PE = 5119)

 16. Check the logical volume for the root logical volume

lvdisplay

(You may need pipe to less to view the details. e.g. lvdisplay | less)

Take note of the LV path. (e.g. LVPATH = /dev/VolGroup00/root)

17. Extend the logical volume and file system

(The -r option extends the file system by automatically calling xfs_growfs)

lvextend -l +<FREE_PE_size> -r -t -v <LVPATH>

e.g. # lvextend -l +5119 -r -t -v /dev/VolGroup/root

If all looks okay, then run the command again without the -t (test) option:

e.g. # lvextend -l +5119 -r -v /dev/VolGroup/root

18. Verify the the disk expansion has been successful:

df -h

  

 

Steps where you have resized an existing disk

4. Run the following commands to check the existing disks and partitions:

ls -l /dev/sd*

 5. Use fdisk to list the current partitions

fdisk -l or # fdisk | less

 Note: Look for the name of the device and partition which corresponds to the existing disk. e.g. /dev/sda2

6. Use fdisk to re-partition the existing disk (e.g. /dev/sda)

fdisk /dev/sda

 7. Use the following fdisk commands:

n - Add a new partition
p - To choose primary partition
3 - Give the partition a number as desired. (Warning: Do not overwrite an existing partion)
<Enter> - Give value for first sector (press enter to choose the default value)
<Enter> - Give value for last sector (press enter to choose the default value)
p - print the partitions
t - Set type of partition
3 - Select partition number (as above)
8e - Enter the hex value for Linux LVM: 8e
w - Write the changes

8.Reboot the server

/etc/init.d/er2-master stop
shutdown -r now

9. Run the following command to view the existing physical volume:

pvdisplay

 10. Verify the name of the newly created partition:

lsblk

(e.g /dev/sda3)

 11. Use pvcreate to create a physical volume for the newly added partitioned disk (e.g. sda3)

pvcreate /dev/sda3

12. Run pvdisplay to verify the new physical volume

pvdisplay

 13. Display information about the volume groups

vgdisplay

Take note of the VG name field. (e.g. VolGroup00)

14. Add the physical volume into the volume group

vgextend -t -v <Volume Group name> <new partition>

e.g. # vgextend VolGroup00 /dev/sda3

If it outputs that the volume group was successfully extended then run the same command again without the -t (test) option:

e.g. # vgextend -v VolGroup00 /dev/sda3

 15. Check volume group

vgdisplay

Take note of the Free PE size. You will need this value to extend the logical volume.

e.g

Free PE / Size 5119 / <20.00 GiB

(the value we need for FREE_PE = 5119)

16. Check the logical volume for the root logical volume

lvdisplay

(You may need pipe to less to to view the details. e.g. lvdisplay | less)

Take note of the LV path. (e.g. LVPATH = /dev/VolGroup00/root)

 17. Extend the logical volume and file system

(The -r option extends the file system by automatically calling xfs_growfs)

 lvextend -l +<FREE_PE_size> -r -t -v <LVPATH>

e.g. # lvextend -l +5119 -r -t -v /dev/VolGroup/root

 If all looks okay, then run the command again without the -t (test) option:

e.g. # lvextend -l +5119 -r -v /dev/VolGroup/root

 18. Verify the the disk expansion has been successful:

df -h 

 

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.