expandir_root_lvm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
expandir_root_lvm [2024/10/17 21:42] – external edit 127.0.0.1expandir_root_lvm [2024/11/01 19:26] (current) – [Solución:] oso
Line 18: Line 18:
  
 ===== Solución: ===== ===== Solución: =====
 +
 +==== Ejemplos: ====
 +
 +
 +=== Expanding Root Filesystem in LVM on Ubuntu ===
 +
 +
 +To use all available disk space in a VM with LVM, follow these steps:
 +
 +1. **Resize the partition**:
 +Start by resizing the partition to fill the remaining space on the disk.
 +
 +<code bash>
 +sudo parted /dev/sda
 +</code>
 +
 +In the ''parted'' prompt, resize the nth (e.g. the third partition ''sda3'') to the maximum size:
 +
 +<code bash>
 +(parted) resizepart 3 100%
 +(parted) quit
 +</code>
 +
 +2. **Extend the Logical Volume**:
 +Use the ''lvextend'' command to allocate all available free space in the volume group to the logical volume:
 +
 +<code bash>
 +sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
 +</code>
 +
 +3. **Resize the Filesystem**:
 +Finally, expand the filesystem to use the new space:
 +
 +<code bash>
 +sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
 +</code>
 +
 +4. **Verify**:
 +Check the expanded disk space:
 +
 +<code bash>
 +df -h
 +</code>
 + 
 +----
 +
  
 1. **Redimensionamiento de la partición:** Utiliza la herramienta `parted` para redimensionar la partición deseada. Por ejemplo: 1. **Redimensionamiento de la partición:** Utiliza la herramienta `parted` para redimensionar la partición deseada. Por ejemplo:
expandir_root_lvm.1729201353.txt.gz · Last modified: 2024/10/17 21:42 by 127.0.0.1