how to remove corrupted disk from LVM?2 min read

There are certain cases either physical /logical disk gets failed due to some reasons. Recently in my case, I was using 3 disks to create a logical volume in my Linux server for storing some data. One I found that my logical volume is not accessible and when I do the pvdisplay command I got below warning.

Couldn't find device with uuid EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx.

and found the physical volume showing unknown.

 

  --- Physical volume ---
  PV Name               unknown device
  VG Name               My_data_vol
  PV Size               20.2 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              119234
  Free PE               0
  Allocated PE          119234
  PV UUID               EvbqlT-AUsZ-MfKi-ZSOz-Lh6L-Y3xC-KiLcYx

Here I had two options to restore data of that particular disk to another disk from the lvm metadata.

Another option is for me to remove the disk from the logical volume.

My requirement was to remove this smaller disk from the logical volume since I had 2 bigger disks to store data.

Below are the followed steps which I followed.

vgreduce --removemissing --force My_data_vol

My_data_vol is the logical volume group

After that when I execute pvdisplay, I can see the corrupted disk is removed.

But now the problem is that my logical volume state is showing as not available.

lvdisplay
  --- Logical volume ---
  LV Path               /dev/my_data_vol/data
  LV Name                data
  VG Name                my_data_vol
  LV UUID                1O-axxx-dxxx-qxx-xxxx-pQpz-C
  LV Write Access        read/write
  LV Status              NOT available  <==========
  LV Size                50.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto

Now the next option for me make the logical volume available, in order to do that I executed the below command which made the logical volume available and with previous data. After that I’m able to mount the logical volume in the desired mount point.

lvchange -ay /dev/my_data_vol/data

Its the LV path name


Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me
We need your support!!
Other Amount:
techrunnr.com:
#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

You may also like...

Leave a Reply