convert_root_to_lvm_partition

This is an old revision of the document!


Crear una partición lógica con fdisk

fdisk

n → new partition

e → extended

usar todo el espacio (o lo que haga falta) Dentro de la extendida se puede crear la partición lógica

n

l

todo el espacio

lsblk debería mostrar 3 niveles el /dev/sdx, y adentro las 2 particiones, que en realidad están superpuestas (fdisk y parted pueden mostrar esto) Supongamos que se crearon dentro del disco /dev/sdc las particiones sdc1 como extndida y sdc5 la lógica

NO es necesario crear la partición, pvcreate puede usar discos enteros.

pvcreate initializes PhysicalVolume for later use by the Logical Volume Manager (LVM). Each PhysicalVolume can be a disk partition, whole disk, meta device, or loopback file. For DOS disk partitions, the partition id should be set to 0x8e using fdisk(8), cfdisk(8), or a equivalent. For whole disk devices only the partition table must be erased, which will effectively destroy all data on that disk. This can be done by zeroing the first sector with:

dd if=/dev/zero of=PhysicalVolume bs=512 count=1

Crear el volumen físico en la partición o disco

 pvcreate /dev/sdc5
 
 
 
 
 
 

Para borrar el LVM

desactivar el LV

 lvchange -an /dev/vg_new_root/lv0

borrar lvm

lvremove /dev/vg_new_root/lv0 

borrar el grupo

vgremove vg_new_root 

borrar el physical volume

pvremove /dev/sdc5 

si hay que borrar absolutamnete todo, wipefs

wipefs -a /dev/sdc 
convert_root_to_lvm_partition.1673966111.txt.gz · Last modified: 2024/10/17 21:42 (external edit)