pvremove без vgreduce

удаляем том из группы

# pvremove /dev/sda2
  Can't pvremove physical volume "/dev/sda2" of volume group "pve" without -ff

не удаляется.. ладно, заставим удалиться

# pvremove -v -ff /dev/sda2
Really WIPE LABELS from physical volume "/dev/sda2" of volume group "pve" [y/n]? y
  WARNING: Wiping physical volume label from /dev/sda2 of volume group "pve"
  Labels on physical volume "/dev/sda2" successfully wiped

ура удалился! проверим

# pvdisplay
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find all physical volumes for volume group pve.
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find all physical volumes for volume group pve.
  Volume group "pve" not found
  Skipping volume group pve
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find all physical volumes for volume group pve.
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find all physical volumes for volume group pve.
  Volume group "pve" not found
  Skipping volume group pve

о ужас! все сломалось! блин, забыл vgreduce перед pvremove! не паникуем:

# pvcreate /dev/sda2 --uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Couldn't find device with uuid 'L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO'.
  Physical volume "/dev/sda2" successfully created

тут обязательно указываем uuid из предидущих сообщений если забыли! и теперь проверим:

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               pve
  PV Size               465.26 GB / not usable 1.50 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              119106
  Free PE               119106
  Allocated PE          0
  PV UUID               L5hT2P-fPEa-Lumy-agV1-Aluk-PqTK-OATJJO
 
  --- Physical volume ---
  PV Name               /dev/md1
  VG Name               pve
  PV Size               465.26 GB / not usable 1.44 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              119106
  Free PE               1023
  Allocated PE          118083
  PV UUID               bocm1Z-yfd3-k6cl-8Lpg-OUB3-TiCz-Sxxdys

фух! тома на месте! теперь делаем как надо:

# vgreduce pve /dev/sda2
  Removed "/dev/sda2" from volume group "pve"
# pvremove /dev/sda2
  Labels on physical volume "/dev/sda2" successfully wiped

теперь без всяких вопросов!
на будущее: если задали вопрос – НЕ ТОРОПИТЕСЬ ГОВОРИТЬ YES !!!

Leave a Reply

Your email address will not be published. Required fields are marked *