VyOS Increase Disk Space

In this blog post, I will walk you through the process of increasing disk space on a VyOS installation. Whether you’re running VyOS on a virtual machine or a physical server, this step-by-step guide will help you seamlessly allocate more storage to keep your network operations running smoothly. From resizing partitions to adjusting file systems, we’ll cover everything you need to know to efficiently manage your VyOS environment’s disk space.

Preparation

Before you begin, ensure that you have a configuration backup of your VyOS system. This precautionary step is essential to safeguard your current settings and configurations, allowing for a quick recovery in case any issues arise during the disk space expansion process. Proper backups are crucial for maintaining the integrity and continuity of your network operations.

VyOS Commands

Here is an overview of the commands I used on the VyOS virtual machine to make it workout:

  1. Shutdown the virtual machine
  2. Increase the disk space of the boot media
  3. Start the virtual machine
  4. Run the following commands:
# Validate size
fdisk -l
df –h

# Remove partition
fdisk /dev/sda
p (print partition)
d (delete partition)
p (print partition)

# Create new partion
• 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)

# Check
sudo partprobe

# Reboot system
reboot

# Confirm that partition size
partx /dev/sda

# Tell the Linux Kernel about the Change in disk size
sudo resize2fs /dev/sda1

# Reconfirm the increase disk size
df -h

# Reboot system to verify
reboot

Wrap-up

So this is my blog post about increasing disk space on a VyOS virtual machine. Hope it was useful for someone! Please respond below if you have any comments or additional information!

Leave a Reply

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