How to Resize a Hard Drive in a Proxmox Ubuntu VM

This guide will teach you how to resize a hard drive in Proxmox virtual machines. This can be useful if you need to add more storage space to your VM or if you need to shrink the size of your VM’s hard drive.

Prerequisites

Before you begin, you will need to have the following:

  • A Proxmox server with at least one virtual machine
  • A backup of your VM’s data

Step 1: Clone Your VM 

It is always a good idea to create a backup of your VM before you make any changes to it. This way, if something goes wrong, you can restore your VM to its original state.

To clone your VM, follow these steps:

  1. Log in to your Proxmox server.
  2. Click on the Virtual Machines tab.
  3. Select the VM that you want to clone.
  4. Click on the Clone button.
  5. Enter a name for the cloned VM.
  6. Click on the Clone button.

Step 2: Resize the Hard Drive

Once you have cloned your VM, you can resize the hard drive.

To resize the hard drive, follow these steps:

  1. Log in to your Proxmox server.
  2. Click on the Virtual Machines tab.
  3. Select the VM that you want to resize.
  4. Click on the Hardware tab.
  5. Click on the Disks tab.
  6. Select the hard drive that you want to resize.
  7. Enter the new size of the hard drive in gigabytes.
  8. Click on the Apply button.

resize disk resize disk

Step 3: Resize the Partition

Once you have resized the hard drive, you need to resize the partition.

To resize the partition, follow these steps:

  1. Boot your VM into the operating system that is installed on the hard drive.
  2. Open a terminal window.
  3. Type the following command:
parted /dev/sda
  1. Type the following command to view the current partition table:

print

fdisk

fdisk mount

  1. Type the following command to resize the partition:
resizepart 3 100%
  1. Type the following command to save the partition table changes:
quit

Step 4: Resize the File System

Once you have resized the partition, you need to resize the file system.

To resize the file system, follow these steps:

  1. Boot your VM into the operating system that is installed on the hard drive.
  2. Open a terminal window.
  3. Type the following command to determine the filesystem type:
df -h
  1. Type the following command to resize the file system:
lvresize --extents +100%FREE --resizefs /dev/mapper/ubuntu--vg-ubuntu--lv

Step 5: Verify the Changes

Once you have completed all of the steps, you can verify the changes by typing the following command:

df -h

The output of this command should show the new size of the hard drive.


Discover more from Susiloharjo

Subscribe to get the latest posts sent to your email.

Related Posts

neuralink brain chip

Neuralink: Revolutionizing Human-Computer Interaction with Brain-Computer Interfaces

What is Neuralink? Neuralink is a revolutionary technology developed by Elon Musk and his team of neuroscientists and engineers. The primary goal of Neuralink is to create…

vector storage

Advantages of Vector Storage for LLMs and AI

In the rapidly evolving landscape of artificial intelligence (AI) and machine learning (ML), one technology stands out as a game-changer: vector storage. This specialized form of data…

GRIT

Implementing GRIT in the Workplace: A Step-by-Step Guide

This Article is based on the Book GRIT by Angela Duckworth, The Power of Passion and Perseverance, As employees, we’ve all faced challenges and obstacles that can…

behaviour-experiment

Understanding Behavioral Experiments

Behavioral experiments are practical, low-risk interventions designed to test and implement new behaviors within an organization. They are a strategic approach to driving cultural and operational change…

Can AI Help Your Company Innovate

Can AI Help Your Company Innovate?

As a business leader, you’re constantly looking for ways to innovate and stay ahead of the competition. But with the rapid pace of technological change, it can…

how AI can revolutionize olympics

How AI Can Revolutionize the Olympics

The Olympic Games, a premier international multi-sport event, has been a symbol of human achievement and excellence for over a century. As technology continues to advance, the…

Discover more from Susiloharjo

Subscribe now to keep reading and get access to the full archive.

Continue reading