---
slug: "lvm-partition-extend-full-remain-volume"
title: "Expanding LVM to Full Capacity"
description: "Inspect `django-redis` cached values directly from `manage.py shell` — both `cache.get` and the raw Redis client commands."
url: "https://www.ytyng.com/en/blog/lvm-partition-extend-full-remain-volume"
publish_date: "2021-02-01T02:17:00Z"
created: "2021-02-01T02:17:00Z"
updated: "2026-05-11T13:21:36.512Z"
categories: ["Linux"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20250602/25f4aaef14fc4e4d9acbe37f0864dcb5.png.webp?width=768"
has_video: true
has_music: true
video_urls: ["https://media.ytyng.net/ytyng-blog/191/featured-video-1.mp4", "https://media.ytyng.net/ytyng-blog/191/featured-video-2.mp4", "https://media.ytyng.net/ytyng-blog/191/featured-video-3.mp4"]
music_urls: ["https://media.ytyng.net/ytyng-blog/191/featured-music-191-2.mp3?v=2", "https://media.ytyng.net/ytyng-blog/191/featured-music-191-3.mp3"]
lang: "en"
---

# Expanding LVM to Full Capacity

<p>After building a PC and installing Ubuntu, I noticed that the logical partition in LVM was not utilizing the entire storage capacity, so I decided to extend it.</p>
<p></p>
<pre>$ df -h<br />Filesystem                         Size  Used Avail Use% Mounted on<br />udev                                16G     0   16G   0% /dev<br />tmpfs                              3.2G  1.8M  3.2G   1% /run<br />/dev/mapper/ubuntu--vg-ubuntu--lv  <span style="color: #ff0000;">196G</span>   75G  112G  41% /</pre>
<p>Even though I was using 1TB of storage, only a 196GB partition was created.</p>
<p></p>
<pre>$ lsblk<br />NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT<br />...<br />nvme0n1                   259:0    0 931.5G  0 disk<br />├─nvme0n1p1               259:1    0     1M  0 part<br />├─nvme0n1p2               259:2    0     1G  0 part /boot<br />└─nvme0n1p3               259:3    0 930.5G  0 part<br />  └─ubuntu--vg-ubuntu--lv 253:0    0   <span style="color: #ff0000;">200G</span>  0 lvm  /</pre>
<p>The physical partition is 930GB, but the logical partition is 200GB.</p>
<p></p>
<p>Use <code>lvextend -l +100%FREE</code> to extend it to the maximum capacity.</p>
<pre>$ lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv<br /> Size of logical volume ubuntu-vg/ubuntu-lv changed from 200.00 GiB (51200 extents) to &lt;930.51 GiB (238210 extents).<br /> Logical volume ubuntu-vg/ubuntu-lv successfully resized.<br />$ lsblk<br />NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT<br />...<br />nvme0n1 259:0 0 931.5G 0 disk<br />├─nvme0n1p1 259:1 0 1M 0 part<br />├─nvme0n1p2 259:2 0 1G 0 part /boot<br />└─nvme0n1p3 259:3 0 930.5G 0 part<br /> └─ubuntu--vg-ubuntu--lv 253:0 0 <span style="color: #ff0000;">930.5G</span> 0 lvm /</pre>
<p>It has been extended.</p>
<p></p>
<pre>$ df -h<br />Filesystem                         Size  Used Avail Use% Mounted on<br />udev                                16G     0   16G   0% /dev<br />tmpfs                              3.2G  1.8M  3.2G   1% /run<br />/dev/mapper/ubuntu--vg-ubuntu--lv  <span style="color: #ff0000;">196G</span>   75G  112G  41% /</pre>
<p>Since it has not yet been reflected in the file system, proceed with resize2fs.</p>
<pre>$ sudo resize2fs /dev/ubuntu-vg/ubuntu-lv<br />[sudo] password for xxxxx:<br />resize2fs 1.45.5 (07-Jan-2020)<br />Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required<br />old_desc_blocks = 25, new_desc_blocks = 117<br />The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 243927040 (4k) blocks long.<br /><br />$ df -h<br />Filesystem                         Size  Used Avail Use% Mounted on<br />udev                                16G     0   16G   0% /dev<br />tmpfs                              3.2G  1.7M  3.2G   1% /run<br />/dev/mapper/ubuntu--vg-ubuntu--lv  <span style="color: #ff0000;">915G</span>   75G  802G   9% /<br />...</pre>
<p>It has been extended.</p>

<h2>Note: For Non-LVM Partitions</h2>
<p>Memo for cases when extending EBS on EC2. For non-LVM partitions.</p>
<p>Case of extending EBS from 100GB to 200GB. Since it's not LVM, <code>lvextend</code> cannot be used. Instead, use <code>growpart</code>.</p>
<pre>$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
...
nvme0n1     259:0    0  200G  0 disk
└─nvme0n1p1 259:1    0  <span style="color: #ff0000;">100G</span>  0 part /

$ sudo growpart /dev/nvme0n1 1
CHANGED: partition=1 start=16065 old: size=209699102 end=209715167 new: size=419414302 end=419430367

$ sudo resize2fs /dev/nvme0n1p1
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/nvme0n1p1 is mounted on /; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 13
The filesystem on /dev/nvme0n1p1 is now 52426787 (4k) blocks long.

$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
...
nvme0n1     259:0    0  200G  0 disk
└─nvme0n1p1 259:1    0  <span style="color: #ff0000;">200G</span>  0 part /</pre>
