364.3 - Comandos Clave: LVM Avanzado

Thin Provisioning

ComandoDescripcion
lvcreate --type thin-pool -L tamaño -n pool VGCrear thin pool
lvcreate --type thin -V tamaño_virtual --thinpool pool -n lv VGCrear thin LV
lvcreate -s --name snap VG/thin_lvSnapshot thin
lvs -a -o +data_percent,metadata_percentVer uso del pool

LVM Cache

ComandoDescripcion
lvcreate --type cache-pool -L tamaño -n pool VG /dev/ssdCrear cache pool
lvconvert --type cache --cachepool VG/pool VG/datosActivar cache
lvconvert --cachemode writeback VG/datosModo writeback
lvconvert --cachemode writethrough VG/datosModo writethrough
lvconvert --uncache VG/datosEliminar cache
lvchange --cachepolicy smq VG/datosCambiar politica
lvs -o +cache_read_hits,cache_write_hitsEstadisticas cache

LVM RAID

ComandoDescripcion
lvcreate --type raid1 -m 1 -L tamaño -n lv VGRAID 1
lvcreate --type raid5 -i N -L tamaño -n lv VGRAID 5
lvcreate --type raid6 -i N -L tamaño -n lv VGRAID 6
lvconvert --type raid1 -m 1 VG/lvConvertir a RAID 1
lvconvert --type raid5 VG/lvConvertir a RAID 5
lvs -a -o +lv_health_statusEstado de salud

VDO (Virtual Data Optimizer)

ComandoDescripcion
vdo create --name=vdo1 --device=/dev/X --vdoLogicalSize=1TCrear VDO
vdostats --human-readableEstadisticas
vdostats --verbose /dev/mapper/vdo1Stats detalladas
vdo status --name=vdo1Estado
vdo enableCompression --name=vdo1Activar compresion
vdo disableCompression --name=vdo1Desactivar compresion
vdo enableDeduplication --name=vdo1Activar deduplicacion
vdo disableDeduplication --name=vdo1Desactivar deduplicacion
vdo growLogical --name=vdo1 --vdoLogicalSize=2TExpandir logico
vdo growPhysical --name=vdo1Expandir fisico

Metadata y Backups

Comando / RutaDescripcion
/etc/lvm/backup/Backups actuales por VG
/etc/lvm/archive/Historial de cambios
vgcfgrestore VGRestaurar ultimo backup
vgcfgrestore -f archivo VGRestaurar version especifica
vgcfgbackup VGCrear backup manual

pvmove - Migracion Online

ComandoDescripcion
pvmove /dev/origen /dev/destinoMigrar todos los LVs
pvmove -n VG/lv /dev/origen /dev/destinoMigrar LV especifico
pvmove --abortCancelar migracion

Modos de Activacion

ComandoDescripcion
lvchange -a y VG/lvActivar
lvchange -a n VG/lvDesactivar
lvchange -a ey VG/lvActivar exclusivo
lvchange -a sy VG/lvActivar compartido
lvchange -a ly VG/lvActivar local

Configuracion LVM

Archivo / ParametroDescripcion
/etc/lvm/lvm.confConfiguracion principal
thin_pool_autoextend_thresholdUmbral de auto-extension (%)
thin_pool_autoextend_percentPorcentaje de extension
auto_activation_volume_listLVs que se activan automaticamente