[linux-lvm] Can't mount LVM RAID5 drives

Peter Rajnoha prajnoha at redhat.com
Tue Apr 22 11:14:20 UTC 2014


On 04/18/2014 08:23 PM, Ryan Davis wrote:
> Hi Peter,
> 
> I made a backup copy of /dev/sdc using dd as you suggested.  This took a
> while to get a drive to copy this data to.
> 
> I started today with the resizing of the LV and hit a few snags and was
> wondering if you could shine some light on what is going on.
> 
> #pvdisplay --maps /dev/sdc1
> 
> --- Physical volume ---
>   PV Name               /dev/sdc1
>   VG Name               vg_data
>   PV Size               3.64 TB / not usable 3.97 MB
>   Allocatable           yes (but full)
>   PE Size (KByte)       4096
>   Total PE              953668
>   Free PE               0
>   Allocated PE          953668
>   PV UUID               8D67bX-xg4s-QRy1-4E8n-XfiR-0C2r-Oi1Blf
>    
>   --- Physical Segments ---
>   Physical extent 0 to 953667:
>     Logical volume	/dev/vg_data/lv_home
>     Logical extents	0 to 953667
> 
> 
> Is the Allocatable yes (but Full) a deal breaker?
> 

That's OK and it's not a stopper here...

> # lvchange -an /dev/vg_data/lv_home
> 
> [root at hobbes ~]# lvscan
>   inactive          '/dev/vg_data/lv_home' [3.64 TB] inherit
> 
> [root at hobbes ~]# lvreduce -r -l -1 /dev/vg_data/lv_home
>   Logical volume lv_home must be activated before resizing filesystem
> 

Ah, I see. Well, we have to do that a bit more manually then...

> [root at hobbes ~]# pvresize /dev/sdc1
>   /dev/sdc1: cannot resize to 953667 extents as 953668 are allocated.
>   0 physical volume(s) resized / 1 physical volume(s) not resized
> 
> 
> What should I do now?  Did I miss something along the way?
> 

This should do the job then (I've tried this exact sequence on my machine):

- deactivate the problematic LV:
	lvchange -an vg_data/lv_home

- reduce the size of the LV by 1 extent:
	lvreduce -l -1 vg_data/lv_home

- make the PV size to be in sync with the real device size:
	pvresize /dev/sdc1

- activate the LV:
	lvchange -ay vg_data/lv_home

- run fsck for the FS on the LV:
	e2fsck -f -n /dev/vg_data/lv_home

- resize the FS to be in sync with new LV size:
	fsadm resize /dev/vg/lvol0

- check the resized filesystem:
	e2fsck /dev/vg_data/lv_home

Let me know if it works for you.

-- 
Peter




More information about the linux-lvm mailing list