|
|
@ -1,13 +1,22 @@ |
|
|
|
--- |
|
|
|
title: "How to expand VM Disks" |
|
|
|
description: "How to expand the virtual disks for CentOS and Debian VMs" |
|
|
|
summary: "How to expand the virtual disks for CentOS and Debian VMs under Proxmox." |
|
|
|
date: 2021-02-20T17:15:17+01:00 |
|
|
|
draft: false |
|
|
|
TocOpen: true |
|
|
|
keywords: |
|
|
|
- CentOS |
|
|
|
- RHEL |
|
|
|
- Debian |
|
|
|
- Virtual Machine |
|
|
|
- Proxmox |
|
|
|
- LVM |
|
|
|
- XFS |
|
|
|
- ext4 |
|
|
|
tags: |
|
|
|
- Proxmox |
|
|
|
categories: |
|
|
|
- tutorial |
|
|
|
- Homelab |
|
|
|
--- |
|
|
|
This post will set out to explain how you can increase the disk size of a virtual disk inside a VM after increasing its size in your hypervisor. |
|
|
|
It does assume some familiarity with Linux and partitioning. |
|
|
@ -63,9 +72,8 @@ This assumes a fairly standard Debian install that uses ext4. |
|
|
|
## TL;DR |
|
|
|
```shell |
|
|
|
sudo cfdisk |
|
|
|
sudo pvresize /dev/sda3 |
|
|
|
sudo lvextend -l 100%FREE /dev/mapper/cl-root |
|
|
|
sudo xfs_growfs / |
|
|
|
sudo partprobe /dev/sda |
|
|
|
sudo resize2fs /dev/sda5 |
|
|
|
``` |
|
|
|
|
|
|
|
## Step 0: Hypervisor |
|
|
@ -87,14 +95,16 @@ This is simply just doing: |
|
|
|
```shell |
|
|
|
sudo partprobe /dev/sda |
|
|
|
``` |
|
|
|
where `/dev/sda` is your expanded partion. |
|
|
|
where `/dev/sda` the disk which you expanded. |
|
|
|
|
|
|
|
## Step 3: Resize filesystem |
|
|
|
Finally you can resize the actual filesystem with `resize2fs` like so: |
|
|
|
Finally you can resize the actual filesystem on the disk's partition with `resize2fs` like so: |
|
|
|
```shell |
|
|
|
sudo resize2fs /dev/sda5 |
|
|
|
``` |
|
|
|
where `/dev/sda5` is the partition mounted as root. |
|
|
|
where `/dev/sda5` is the root partition. |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
# Appendix |
|
|
|
Some useful notes that aren't necessarily part of the rest of this how-to. |
|
|
|