Eliminar el volumen físico del grupo de volúmenes LVM sin borrar datos

Eliminar el volumen físico del grupo de volúmenes LVM sin borrar datos

Tengo un grupo de volumen:

$ vgdisplay
  --- Volume group ---
  VG Name               Ethan-PC
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  19
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               1
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               <3.86 TiB
  PE Size               4.00 MiB
  Total PE              1010969
  Alloc PE / Size       1004569 / 3.83 TiB
  Free  PE / Size       6400 / 25.00 GiB
  VG UUID               ixrl2q-Alsc-UvxQ-q55x-7M3G-S2vq-fNr1wC

dos volúmenes lógicos:

$ sudo lvdisplay
  --- Logical volume ---
  LV Path                /dev/Ethan-PC/root
  LV Name                root
  VG Name                Ethan-PC
  LV UUID                Mde88v-pIYX-ubVw-dYgY-IuaJ-K59r-xHEtXP
  LV Write Access        read/write
  LV Creation host, time archiso, 2018-12-15 10:04:22 -0600
  LV Status              available
  # open                 1
  LV Size                200.00 GiB
  Current LE             51200
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0
   
  --- Logical volume ---
  LV Path                /dev/Ethan-PC/home
  LV Name                home
  VG Name                Ethan-PC
  LV UUID                Q4m5VI-QH2q-J0oK-XT3z-Ip7c-dk4f-KLCGAs
  LV Write Access        read/write
  LV Creation host, time Ethan-PC, 2018-12-15 17:50:50 -0600
  LV Status              available
  # open                 0
  LV Size                <3.64 TiB
  Current LE             953369
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

y dos volúmenes físicos:

pvdisplay                                                                      
  --- Physical volume ---
  PV Name               /dev/nvme0n1p2
  VG Name               Ethan-PC
  PV Size               223.08 GiB / not usable <3.57 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              57108
  Free PE               5908
  Allocated PE          51200
  PV UUID               XeW7X2-OKDy-D4aG-clfq-db7N-1g3X-5cJLXP
   
  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               Ethan-PC
  PV Size               <3.64 TiB / not usable <2.82 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              953861
  Free PE               492
  Allocated PE          953369
  PV UUID               g0OSPs-AXTd-6YuE-tEAM-fkmy-O2Ke-ieFXnN

Todos los datos del homeLV están activados /dev/sda1y todos los datos del LV rootestán activados /dev/nvme0n1p2.

# note: irrelevant entries have been removed
$ lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                  8:0    0   3.6T  0 disk  
└─sda1               8:1    0   3.6T  0 part  
  └─Ethan--PC-home 254:1    0   3.6T  0 lvm   
nvme0n1            259:2    0 476.9G  0 disk  
└─nvme0n1p2        259:4    0 223.1G  0 part  
  └─Ethan--PC-root 254:0    0   200G  0 lvm   /

Quiero eliminarlo /dev/sda1del grupo de volúmenes.Puedo hacer esto fácilmente, pero ese procedimiento implica la pérdida de los datos almacenados en el homeLV. Quiero conservar los datos en el disco en caso de que necesite consultarlos más adelante. ¿Cómo eliminaría /dev/sda1del VG sin borrar los datos?

¡Gracias!

Respuesta1

Yo haría lo siguiente:

  • desmontar / inicio
  • vgsplit Ethan-PC homevg /dev/sda1

Obtendrías 2 VG diferentes:

  • Ethan-PC con pv /dev/nvme0n1p2
  • iniciovg con pv /dev/sda1

Después de eso, todavía tienes que reconstruir y montar un /home, ya sea desde /dev/homevg/home o desde /dev/Ethan-PC/home (debe crearse y formatearse)

información relacionada