From 0d3918ac45468311644ac8cbc5ee14932b644ebc Mon Sep 17 00:00:00 2001 From: Fascinated Date: Tue, 27 Jun 2023 11:42:56 +0100 Subject: [PATCH] first ubuntu guide - how to expand a lvm --- guides/ubuntu/home.md | 13 +++++ guides/ubuntu/pages/expanding-a-lvm.md | 66 ++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 guides/ubuntu/home.md create mode 100644 guides/ubuntu/pages/expanding-a-lvm.md diff --git a/guides/ubuntu/home.md b/guides/ubuntu/home.md new file mode 100644 index 0000000..ace72f7 --- /dev/null +++ b/guides/ubuntu/home.md @@ -0,0 +1,13 @@ +--- +title: Ubuntu Home +description: Ubuntu guides +published: true +date: 2023-06-27T11:35:30.081Z +tags: ubuntu +editor: markdown +dateCreated: 2023-06-27T11:35:59.640Z +--- + +# Pages + +- [Expanding a LVM](/guides/ubuntu/pages/expanding-a-lvm) diff --git a/guides/ubuntu/pages/expanding-a-lvm.md b/guides/ubuntu/pages/expanding-a-lvm.md new file mode 100644 index 0000000..5edbc1c --- /dev/null +++ b/guides/ubuntu/pages/expanding-a-lvm.md @@ -0,0 +1,66 @@ +--- +title: Expanding a LVM +description: How to expand a LVM +published: true +date: 2023-06-27T07:54:18.672Z +tags: linux, server +editor: markdown +dateCreated: 2023-06-27T07:54:18.672Z +--- + +# Expanding a LVM + +This guide provides instructions on how to expand a LVM. _This was tested on Ubuntu 22.04._ + +## Get Started + +- Begin by opening a terminal and running the following command: + +```bash +lvdisplay +``` + +This command will display the volume groups. + +You should see something like this: + +```bash +--- Logical volume --- +LV Path /dev/ubuntu-vg/ubuntu-lv +LV Name ubuntu-lv +VG Name ubuntu-vg +LV UUID eIxgxf-ABCD-EFGH-IJKL-MNOP-QRsT-UVWxYz +LV Write Access read/write +LV Creation host, time ubuntu, 2023-06-27 08:00:00 +0000 +LV Status available +# open 1 +LV Size 50.00 GiB +Current LE 12800 +Segments 1 +Allocation inherit +Read ahead sectors auto +- currently set to 256 +Block device 253:0 +``` + +You can find the volume we will be expanding by looking at the `LV Path` it should be something like `/dev/ubuntu-vg/ubuntu-lv`. + +- Next, you need to expand the volume. Run the following command: + +```bash +lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv +``` + +This command will expand the volume to use all available space. + +- Finally, you need to expand the filesystem. Run the following command: + +```bash +resize2fs /dev/ubuntu-vg/ubuntu-lv +``` + +This command will expand the filesystem to use all available space. + +## Finished + +You now have a LVM that has been expanded to use all available space.