Question

I have four 1.5TB drives raid 5'd with mdadm. According to mdadm, this raid group has a size of 4.5TB (makes sense as the cost of RAID 5 is ~1 disk's worth of space). On top of this mdraid, I have a lvm group. LVM reports (via pvdisplay) that only 3000GB (or 2.73 TiB) is available for the volume. What is going on here?

Here is the output of various commands that might be useful:

sudo mdadm --detail /dev/md2
/dev/md2:
Version : 1.2
Creation Time : Sat May 26 18:28:26 2012
Raid Level : raid5
Array Size : 4395406848 (4191.79 GiB 4500.90 GB)
Used Dev Size : 1465135616 (1397.26 GiB 1500.30 GB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent

Update Time : Mon Nov 19 08:38:30 2012
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0

    Layout : left-symmetric
Chunk Size : 512K

      Name : azrael:2  (local to host azrael)
      UUID : ce4a7da2:fc2ba60b:72ed1a6e:5e3eb181
    Events : 100

Number Major Minor RaidDevice State
0 8 33 0 active sync /dev/sdc1
1 8 49 1 active sync /dev/sdd1
2 8 65 2 active sync /dev/sde1
3 8 81 3 active sync /dev/sdf1

sudo pvdisplay
--- Physical volume ---
PV Name /dev/md2
VG Name vg01
PV Size 2.73 TiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 715398
Free PE 0
Allocated PE 715398
PV UUID Q3kFut-usmr-g6L0-VBx7-lMWK-BgxQ-uvlOW7

sudo pvscan
PV /dev/md2 VG vg01 lvm2 [2.73 TiB / 0 free]

sudo lvdisplay -v /dev/vg01
Using logical volume(s) on command line
--- Logical volume ---
LV Path /dev/vg01/home
LV Name home
VG Name vg01
LV UUID A3QEEr-9LQg-P0Ra-ZFbo-WYGF-ufdn-JIyqc9
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 232.83 GiB
Current LE 59604
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 6144
Block device 253:1

--- Logical volume ---
LV Path /dev/vg01/storage
LV Name storage
VG Name vg01
LV UUID 1G0boL-pQGJ-lZln-H8DE-7ISi-jRh9-TfkjGT
LV Write Access read/write
LV Creation host, time ,
LV Status available
# open 1
LV Size 2.50 TiB
Current LE 655794
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 6144
Block device 253:2

Was it helpful?

Solution

Not sure why the original PV was created with only part of the capacity of the underlying /dev/md2 device, but this should resize the PV to use the full capacity:

pvresize /dev/md2

You could also use that to only partially extend the PV, or even to shrink it, I think, provided you make sure that the portion you're removing is not currently allocated to any LVs. The manual page for pvresize should have more information on the options you may need for each scenario.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top