mirror of https://gitlab.com/curben/blog
29 lines
1.0 KiB
Markdown
29 lines
1.0 KiB
Markdown
---
|
|
title: Extending LVM partition after disk expansion
|
|
date: 2026-01-17
|
|
---
|
|
|
|
1. Boot GParted Live as this is best done offline.
|
|
2. GParted may prompt to fix the GPT header due to metadata mismatch about the disk size, select "Fix".
|
|
3. Using GParted program, deactivate the LVM partition.
|
|
4. Resize the LVM partition by dragging the right-arrow to the end.
|
|
5. Click tick ✓ to apply. Resizing should take only a few seconds, if it's not finished within a minute, reboot GParted Live and repeat; this may happen if Steps 2-3 are skipped.
|
|
6. Launch Terminal,
|
|
|
|
```
|
|
sudo -s
|
|
vgs
|
|
lvs
|
|
```
|
|
|
|
7. `vgs` may show non-zero VFree value meaning the volume group contains unallocated space. `lvs` lists the volume group and logical volume, the values are used in `lvresize`; Ubuntu defaults to `ubuntu-vg/ubuntu-lv`, the slash is not an _OR_, both values with a slash are required.
|
|
|
|
```
|
|
lvresize -l +100%FREE --resizefs VG-name/LV-name
|
|
vgs
|
|
```
|
|
|
|
8. `vgs` should now show zero VFree value.
|
|
9. In GParted program, activate the LVM partition.
|
|
10. Reboot.
|