Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lvm-extend.md #1079

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion source/operatingsystems/linux/basics/lvm-extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,21 @@ I added 5G to the VM, and this disk is ~5G in size, so we've identified where it

# Resized disk method

We've identified that one of the disks has been resized - `sdb` in this case.
We've identified that one of the disks has been resized - ```sdb``` in this case.

## Expand the partition if necessary

If the LVM PV refers to a partition on a disk (e.g. ```/dev/sdb3```) rather than a complete disk (```/dev/sdb```), you'll first need to expand the partition to use the new space. Use the ```growpart``` command to do this:

```growpart <disk> <partition number>```

for example

```growpart /dev/sdb 3```

Note that it is intentional that there is a space between the ```/dev/sdb``` and ```3```. It's also important to note that this will only work if the partition number is the highest numbered on on the disk. For example, if you had ```/dev/sdb1```, ```/dev/sdb2```, ```/dev/sdb3```, ```/dev/sdb4```, and your PV was ```/dev/sdb3```, you couldn't expand ```/dev/sdb3``` because ```/dev/sdb4``` would be in the way. Contact support for advice if you find yourself in this situation.

The ```growpart``` command isn't always installed by default on a server, you may need to install it first using ```yum``` / ```apt``` / ```dnf``` as appropriate.

## Resize the physical volume to use the new space

Expand Down
Loading