跳到主要内容

Increasing your disk space (Ubuntu)

在 Disk Management 中
作者列表
已发布: 2023年11月30日|最后更新: 2023年11月30日

This guide will cover a standard Ubuntu 22.04 installation. If you are not using a standard Ubuntu 22.04 installation then we recommend looking for guides for your specific OS or filesystem you used.

Warning

We highly recommend performing a full VM backup before performing any work managing the disks on your Deskpro server.

What is LVM?Copy link to What is LVM? to clipboard

LVM, or Logical Volume Management is the default method which Ubuntu will use to manage disk mounts. It is an additional layer which sits atop of standard disk partitioning, but below the filesystem. This allows for more flexibility with managing mounts, but also adds some additional complexity.

LVM uses 3 distinct layers, Physical Volumes, Volume Groups and Logical Volumes.

  • Physical Volumes - These are the sections of the disk partitions which you want to add to LVM.

  • Volume Groups - These are groups which hold the Physical Volumes, and make the space available to Logical Volumes.

  • Logical Volumes - These are the disk mounts which will hold the filesystem, and will be mounted to your OS.

This method allows your OS to separate the disk mounts from the physical disk, meaning that you can have a logical volume that spans multiple physical volumes within the volume group.

image.png

With the example diagram above, the logical volume spans both physical volumes within the volume group, meaning if you have 2 x 50GB disks, the logical volume can be up to 100GB in size. The filesystem is then placed on top of the logical volume and mounted to the OS.

Do I have unused space available?Copy link to Do I have unused space available? to clipboard

Note

Any command mentioned below must be run as the root user on the command line of your server.

By default, Ubuntu does not allocate the full disk space on installation, so if you have installed Ubuntu from an ISO and did not allocate the full disk to the root partition, you may have some unallocated space on your disk which you can assign to grow your root partition quickly and easily.

You can check if you have any unallocated space by running the command vgdisplay, then checking for the Free PE / Size. If you have any unallocated space within your volume group, you can follow the Growing the Logical Volume guide to allocate it.

root@deskpro:~# vgdisplay --- Volume group --- VG Name ubuntu-vg System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 2 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size <98.00 GiB PE Size 4.00 MiB Total PE 25087 Alloc PE / Size 12543 / <49.00 GiB Free PE / Size 12544 / 49.00 GiB VG UUID 02DpQ3-gT1C-Xvfd-vumL-7rHi-S4P3-ioxBdt
copy

Increasing disk space on a standard Ubuntu installation.Copy link to Increasing disk space on a standard Ubuntu installation. to clipboard

There are two main ways to increase your disk space on Ubuntu.

  1. Expanding your existing disk

This requires you to increase the size of your existing disk within your hypervisor. It will keep all your data on the same virtual disk.

  1. Adding an additional disk

This requires you to add an additional disk within your hypervisor. This will span your data across multiple disks.

Both these methods will grow the free space within the Volume Group, and are completed by Growing the Logical Volume to allocate the free space to your filesystem.

有帮助没有帮助

3 人中 2 人认为这个页面有帮助

Increasing your disk space (Ubuntu) 中的页面

Expanding your existing disk
作者列表
已发布: 2023年11月30日
最后更新: 2023年11月30日
Adding an additional disk
作者列表
已发布: 2023年11月30日
最后更新: 2023年11月30日
Growing the Logical Volume
作者列表
已发布: 2023年11月30日
最后更新: 2023年11月30日
下一个页面Increasing disk space on the OVA
上一个页面How much disk space do I have available?

请登录或注册以提交评论。