From LedHed's Wiki
Jump to: navigation, search
(Created page with "== Overview == Sometimes you have to resize a VMs disk. This is a fairly trivial process, open the VMs settings, increase the disks size. Go to guest and resize the partition...")
 
(No difference)

Latest revision as of 09:11, 14 February 2023

Overview

Sometimes you have to resize a VMs disk. This is a fairly trivial process, open the VMs settings, increase the disks size. Go to guest and resize the partition and filesystem, done!
What happens if your VM doesn't see the increase in disk size?

Ubuntu (and probably other flavors of Linux)

As root run the following command to initiate a rescan of the disk.

echo 1 >/sys/class/block/sdb/device/rescan

You can verify the size changes by running:

fdisk -l /dev/sdb

You can also grow the partition by running:

growpart /dev/sdb 1

This will grow the first partition to fill the disk

You can also resize the filesystem by running:

resize2fs /dev/sdb1


Reference

https://kerneltalks.com/disk-management/how-to-rescan-disk-in-linux-after-extending-vmware-disk/