Resize VM Disk: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 23: Line 23:


== Step 2 ==
== Step 2 ==
To increase the disk partition:
Resize the Partition to Use the Extra Space:
* In the VM, first get the partition table for info (Assuming the disk is /dev/sda) with `fdisk -l /dev/sda | grep ^/dev`
 
Output should something like this:
[[File:Fdisk-output.png|thumb]]
* Resize using 'parted':
* Resize using 'parted':
   * parted /dev/sda
This is assuming that you need to resize /dev/sda2 (which the 'print' command will help you determine)
   * print
   * `parted /dev/sda`, opens the partition table editor for /dev/sda
   * resizepart 2 100%
   * `print`, double-checks the disk layout
   * quit
   * `resizepart 2 100%`, choose partition you want to resize, here partition 2 is resized to use all available space
This is assuming that you need to resize /dev/sda2 (which the 'print' will help you determine)
   * `quit`, exit parted
 
== Step 3 ==
== Step 3 ==
To increase file system's size:
To increase file system's size:
* 'resize2fs /dev/sda2' (Assuming you need to increase /dev/sda2)
* 'resize2fs /dev/sda2' (Assuming you need to increase /dev/sda2)
92

edits

Navigation menu