Giter Club home page Giter Club logo

virtualbox-disk-resize's Introduction

Guide: Extending Virtual Machine Disk Size (For Ubuntu Server 22.04 LTS)

Important: Before you begin, make sure to back up your virtual machine to prevent any data loss.

Step 1: Turn off the virtual machine Ensure that the virtual machine is powered off before proceeding with the disk resizing.

Step 2: Prepare GParted

  • Download the GParted Live ISO file with a name like "gparted-live-x.x.x-x-amd64.iso".
  • In the VirtualBox host OS, go to VirtualBox > File > Virtual Media Manager.
  • Resize the virtual disk by adjusting the slider.

Step 3: Mount GParted ISO In the virtual machine settings, mount the GParted ISO file.

Step 4: Boot into GParted Start your virtual machine and boot into GParted using the mounted ISO.

Step 5: Resize the partition

  • In GParted, locate your virtual drive partition, e.g., /dev/sda2.
  • Right-click on the partition and choose "Resize/Move."
  • Expand the partition to use all available unallocated space.
  • Confirm the operation by clicking the check mark.
  • Exit the GParted GUI and restart your virtual machine with Ubuntu Server.

Step 6: Verify the partition size Open the terminal and run the following commands as the root user:

  • vgdisplay (Check that VG Size matches the resized partition size)
  • lvdisplay (Verify the LV Size)

Step 7: Resize the logical volume Run the following command to resize the logical volume:

bash

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

Step 8: Verify the logical volume size Run lvdisplay again and ensure that the LV Size is now larger.

Step 9: Adjust the volume size Check the current size of the volume with:

bash

df -h

Step 10: Resize the volume Adjust the size of the volume using the following command:

bash

resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Step 11: Verify the size Run df -h once more to confirm that the volume size has increased.

Step 12: Completion Congratulations! You have successfully extended the virtual machine disk size. The process is now complete.

Please remember that disk operations are critical, and following the steps carefully and backing up data is essential to prevent any potential data loss.

virtualbox-disk-resize's People

Contributors

rl-balaguer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.