How do you increase disk file system with vyos?

So in our setup, we use VMware esxi and the vyos router is setup as a guest.

How do we tell vyos to increase its disk allocation after doing the disk increase in VMware.

Found this as vyos is on debian linux version, this should work, need to test this out

Tested this in test lab, vyos 1.1.7 as virtual guest on Vmware ESXi 5.5 host with objective of increasing the Disk size from 4GB to 8GB.
Reference:

a. Vyos router disk space – 4GB uses /dev/sda1

b. Log into vyos console - Take note of the start and end cylinders
β€’ fdisk -l
c. Increase the VM disk space from 4GB to 8GB
β€’ Select the VM
β€’ Select Settings
β€’ Change the harddisk size(G) from 4 to 8
β€’ Click ok

d. Take a vmware disk snapshot, as a backup

e. Login via root – some commands don’t work on sudo

f. Rescan the Disk in root
β€’ First identify the scsi disk
ls /sys/class/scsi_device
ls /sys/class/scsi_disk/
2:0:0:0
i. The scsi disk is 2:0:0:0
β€’ Rescan the Disk
β€’ echo 1 > /sys/class/scsi_device/2:0:0:0/device/rescan
g. Recheck the disk size
β€’ fdisk -l

h. Delete the existing partion
β€’ fdisk /dev/sda
β€’ p (print partition)
β€’ d (delete partition)
β€’ p (print partition)

i. Create a new partition and take note of the Start and increase the End cylinder
β€’ n (create a new partition)
β€’ p (select primary)
β€’ 1 (select 1 since this only partition)
β€’ 2 (this first cylinder saw in b) )
β€’ 12191 (last cylinder - 1 )
β€’ w (press w for writing change)

j. Recheck the partition by running partprobe; if there is an error – just reboot
β€’ partprobe - In our case the device busy so this requires a reboot

k. Reboot & relogin
β€’ reboot

l. Confirm that partition size
β€’ partx /dev/sda

m. Tell the Linux Kernel about the Change in disk size
β€’ resize2fs /dev/sda1

n. Reconfirm the increase disk size
β€’ df –h (the Disk increased to 8GB)

I would just spin up the machine using gparted live CD GParted -- Live CD/USB/PXE/HD
Simply resize data partition in gui, and apply changes

1 Like