Force (command) to resize root partition

Created by Srividya Anantapatnaikuni, Modified on Thu, 8 Feb at 12:20 PM by Srividya Anantapatnaikuni

Article review date2024-02-08
Validated for VyOS versions1.3.5, 1.4.0

The command force root-partition-auto-resize resizes the root partition automatically to the maximum available space on the disk on system boot.

Total 9.1GB is allocated to the root partition in VyOS VM:

vyos@vyos:~$ df -kh
Filesystem Size Used Avail Use% Mounted on
udev 982M 0 982M 0% /dev
tmpfs 200M 6.1M 194M 4% /run
/dev/sda1 9.1G 364M 8.3G 5% /usr/lib/live/mount/persistence
/dev/loop0 306M 306M 0 100% /usr/lib/live/mount/rootfs/1.3.5.squashfs
tmpfs 998M 0 998M 0% /usr/lib/live/mount/overlay
overlay         9.1G  364M  8.3G   5% /
tmpfs           998M   84K  998M   1% /dev/shm

Now execute the below command followed by reboot to allocate the available free disk space to root partition:

vyos@vyos:~$ force root-partition-auto-resize
vyos@vyos:~$ reboot now

Post reboot, the total available space is 20 GB.

vyos@vyos:~$ df -kh
Filesystem      Size  Used Avail Use% Mounted on
udev            982M     0  982M   0% /dev
tmpfs           200M  3.5M  197M   2% /run
/dev/sda1        20G  365M   19G   2% /usr/lib/live/mount/persistence
/dev/loop0      306M  306M     0 100% /usr/lib/live/mount/rootfs/1.3.5.squashfs
tmpfs           998M     0  998M   0% /usr/lib/live/mount/overlay
overlay          20G  365M   19G   2% /
tmpfs           998M   84K  998M   1% /dev/shm

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article