INTRODUCTION

+ You have probably experienced the confusing situation when you upgrade Cloud Server’ storage (purchase extra storage). Yet, you observe that your server’s storage capacity has not increased

→ Reason being, you have not mounted the additional storage that 1Byte provides.

+ This tutorial from 1Byte will instruct you on mounting your updated storage into your server.

PREREQUISITES

+ A running Cloud Serve (OS: Ubuntu or CentOS) has been upgraded storage

+ Data should be backed up off-site (to another server or to cloud-based internet storage), not only on the server you’re now using. Considering how easily it is to accidentally delete everything off the hard drive by fiddling with it, it’s best to avoid doing so.

ADDITIONAL KNOWLEDGE

+ Before diving in, it’s important that you should have a brief grasp of the following Storage in Linux:

  • sda means the first physical hard drive. If you have the second physical hard drive, that drive will be named sdb, and the third one will be sdc
  • sda1, sda2, sda3, …etc are partitions generated from hard disk sda. It is similar to letter drive C, D, E in Windows
  • vgubuntu-root is the name of the logical volume (LM) of root
  • Keep in mind that a partition is not where your file system or data resides. They are kept on the Logical Volume

WORKFLOWS

1)  Create a new Partitions from Physical Hard Drive

2) Extend the Partition to the Volume Group that you want it to resize

3) Add Volume Group into Logical Volume

4) Now you can store Linux system file into Logical Volume

upgrade-storage-ubuntu-1byte
Logical Volume Manager In Linux

STEP-BY-STEP

0. Check Storage Info Of Your Server

+ Using the ” lsblk “command to display information about block devices in a system 

				
					#Check Server's Storage 
lsblk
				
			

+ Check out an example below

1Byte-Recurring-Payment
Before Upgrade Storage: 50GB
upgrade-storage-ubuntu-1byte
After Upgrade Storage: 150GB

+ The left side of the image shows an original Cloud Server. A 100GB increase has been added to the sda (physical hard drive), as seen in the image on the right

+ However in the right image, when we attempt a sum of the sdas (sda1, sda2, sda3, and sda5). The total capacity is still only 50GB

+ Or you see the total storage of vgubuntu-root is 50GB

→ This proves that your physical hard drive sda has 150GB, but you have only used 50GB

1. Create A New Partition From The Disk

+ Using ” fdisk ” command is used to create and delete partitions on the hard drive

+ And the hard drive we need to interact is sda. Then run the command below

				
					#Proceed to interact with the sda
fdisk /dev/sda

#Press "m" to check the help menu of fdisk command
				
			
upgrade-storage-ubuntu-1byte
3 commands need to use when using fdisk

+ In general, in this step we will do the following 3 steps
– 1.1: Create a new partition, in my case, this partition will have a capacity of 100GB (the storage that we upgrade) → command ” n ” – add a new partition type

– 1.2: Switch type partition to LVM command ” t “- change a partition type

– 1.3: Save the changes and exit → command ” w ” – write table to disk and exit 

				
					#Step 1:
#1.1: Press " n " to create a new parititon
#1.2: Press " p " to choose primary partition type
#1.3: Press " Enter " to get the new first sector. This will prevent overlap with existing sectors
#1.4: Press " Enter " to get the new last sector. This will prevent overlap with existing sectors
				
			

NOTE:

+ It should be take a notice that in my case, my system created partition number 4 → sda4

+ It is possible for your case, the system will create another partition number (not sda4). It could be sda3, sda5, sda6,…etc

				
					#Step 2:
#2.1: Press " t  " to switch partition type
#2.2: Press "partition number". In my case, partition number is 4 (sda4)
#2.3: Press " L  " to list all types of partition
#2.4: Press " 8e " to choose partition type is Linux LVM 
				
			
upgrade-storage-ubuntu-1byte
Remember to choose the correct partition number and partition type is Linux LVM
				
					#Step 3:
#Type " w " to save all the changes and exit
				
			

2. Extend Volume Group From Newly Created Partition

+ The ” vgs ” command provides volume group information in a configurable form, displaying one line per volume group

				
					#Check logical volumne info
vgs
				
			

+Volume group vgubuntu now only has 49.50GB

→ We need to expand this volume more 100GB

				
					#Expand volumne group
#Remember to change your partition number correctly
vgextend vgubuntu /dev/sda4
				
			

+Volume group vgubuntu now is extend up to 150GB

3. Extend Logical Volume (LM) To Reach The Maximum Storage Of Volume Group

				
					#Extend vgubuntu-root to /dev/sda4
lvextend /dev/vgubuntu/root /dev/sda4

#Verify Volume Group again
vgs
				
			

+ As you can see, we are successfully extend the volume of vgubuntu-root from 48.51GB to 148.50GB

+ Finally, run ” lsblk ” again to check whether the storage of vgubuntu-root reach to 148.50GB or not?

Bravo!!! The vgubuntu-root now is reach its maximum storage

FINAL WORDS

+ If you read this far, congrats!!!

+ For any questions or concerns during the installation process, don’t hesitate to get in touch with us

MORE REFERENCES

+ To get the latest promotions, events. Please check out this link

+ To get the fastest answer, the FAQ Page is the best place to look for

+ Keep up with 1Byte’s YouTube channel to make it simpler to comprehend

+ As always, 1Byte would bring you fresh content and exclusive deals in the future. STAY TUNED!!!

JOINT OUR GROWING FAMILY