docs: update gofurther/resize

This commit is contained in:
lukas 2024-07-13 13:11:10 +00:00
parent 09c5849352
commit 8dd051ecde

View File

@ -2,7 +2,7 @@
title: Resize an existing virtual disk title: Resize an existing virtual disk
description: description:
published: true published: true
date: 2022-01-31T13:20:51.295Z date: 2024-07-13T13:11:07.613Z
tags: tags:
editor: markdown editor: markdown
dateCreated: 2021-11-13T11:41:29.087Z dateCreated: 2021-11-13T11:41:29.087Z
@ -10,36 +10,35 @@ dateCreated: 2021-11-13T11:41:29.087Z
# Resize a disk # Resize a disk
> *Instructions only applies to Linux guests.*
{.is-info}
## Background ## Background
A virtual machine's disk may have to be resized, typically due to lack of space. This page explains how to do so. A virtual machine's disk may have to be resized, typically due to lack of space. This page explains how to do so.
The process involves creating a new blank virtual disk of the desired size and grow the former disk into the new one. ## Usage for Linux guests
## Usage > In-place expansion is not supported. A new disk of the desired size has to be created.
> *In-place expansion is not supported. A new disk of the desired size has to be created.*
{.is-info} {.is-info}
* *Move to the location that contains the existing image* * Navigate to the location that contains the existing image.
``` ```
cd /var/lib/libvirt/images cd /var/lib/libvirt/images
``` ```
* Create a new blank disk image of the desired size
* *Create a new disk image* Use the following command to create a disk of 20 GB called `guest_20G.img`.
Use the following command to create a disk of 15 GB called `phyllome-bigger.img`.
``` ```
qemu-img create -f raw phyllome-bigger.img 15G qemu-img create -f raw guest_20G.img 20G
``` ```
* *Expand the root partition* * Identify the filesystem layout of the existing disk
* Expand the root partition
> *This command expects the root partition to be located on the vda3 partition. It has only been tested against the `ext4`filesystem.* > *This command expects the root partition to be located on the vda3 partition. It has only been tested against the `ext4`filesystem.*
{.is-warning} {.is-warning}
@ -48,7 +47,7 @@ qemu-img create -f raw phyllome-bigger.img 15G
virt-resize --expand /dev/vda3 phyllome.img phyllome-bigger.img virt-resize --expand /dev/vda3 phyllome.img phyllome-bigger.img
``` ```
* *The following should appear* * The following should appear
``` ```
[ 0.0] Examining phyllome.img [ 0.0] Examining phyllome.img