ISProvision

Provision: Upgrade Disk Space KVM Linux

Upgrade disk on 2022 for VPS

Upgrade the Disk Space through Solusvm to your desired disk space and then you have to reboot the VM through Solusvm to take the effect.

Then login to the VM and start to install :

# yum install cloud-utils-growpart -y

then run this to grow the disk :

# growpart /dev/vda 1 
–> there are space on vda 1

# resize2fs /dev/vda3

Upgrade disk On 2022 for GPT ( shared hosting )

Upgrade the Disk Space through Solusvm to your desired disk space and then you have to reboot the VM through Solusvm to take the effect.

Then login to the VM and start to install :

# yum install cloud-utils-growpart gdisk -y

Before that you have to check first the disk by using lsbk command :

# df -h

then run this to grow the disk :

# growpart /dev/vda 3 --> there are space on vda 3

CHANGED: partition=3 start=33560576 old: size=3187662336 end=3221222912 new: size=4261406686 end=4294967262

Last, you run this command to extend :

# xfs_growfs /dev/vda3
meta-data=/dev/vda3 isize=512 agcount=435, agsize=917248 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=398457792, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 398457792 to 532675835
# df -h

For some cases, especially night shift you will be asked to do provision by upgrading disk space kvm vps when needed. This usually has been scheduled and customer (Primary Email) has agreed by this schedule.

Schedule

Since upgrade disk need restart or reboot we usually scheduled in on midnight. We tell customer only need reboot, however in technical term there are some steps need to do for kvm server.

IMPORTANT : If you want to schedule with customer, make sure you have their correct root login.

Update Disk space

Now login to SolusVM first and update resource correctly. In this part, you need to increment 1 GB as additional disk, this will be marked as swap. For example, customer wants to upgrade from 10 GB to 20 GB. Then we added 1 GB as additional swap later. So it will be 21 GB

Set Boot as gparted

After logged in into SolusVM, search which vps that need to be upgrade. Set first boot order as CD ROM and second as Harddisk. Make sure you mount gparted as well.

After that reboot the server and do console remote through TightVNC or VNC or anything. Do not use html5 remote from browser, it won’t work. I told you.

You can proceed and follow the instruction until server boot up into gparted graphical interface.

Access VNC

Now our goal is : Extend the disk /dev/vda1 by adding additional 20 GB unallocated disk.

Remove the red disk partition /dev/vda2 (swap), because in order to merge 2 disk, we need to remove the partition that separate unallocated disk.

Now we Resize/Move the entire unallocated disk to a new size. You can drag it, make sure you drag and leave disk 1 GB as swap later.

Now unallocated disk should be 1 GB or 1024 MB. We add as new partition and add as linux-swap partition. And apply the changes.

Now we have to revert back everything. Make sure the boot from harddisk and gparted has been unmounted. Make sure to configure it correctly.

Now login as their root and check the disk. If the disk hasn’t increased yet, then we can exapand it manually by running this command.

resize2fs /dev/vda1

After then check the disk again.

df -h

Done.

Leave a Reply

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