Header Shadow Image


Extending the size of your mdadm array.

Extending the size of your mdadm array.  Now that you've replaced all the failed disks, we can double the size of our array to 8TB from 4TB.

We start off with this array:

[root@mbpc-pc log]# mdadm –detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Mon Mar 26 00:06:24 2012
     Raid Level : raid6
     Array Size : 3907045632 (3726.05 GiB 4000.81 GB)
  Used Dev Size : 976761408 (931.51 GiB 1000.20 GB)
   Raid Devices : 6
  Total Devices : 6
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Mar 29 23:02:24 2018
          State : active
 Active Devices : 6
Working Devices : 6
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

           Name : mbpc:0
           UUID : 2f36ac48:5e3e4c54:72177c53:bea3e41e
         Events : 1333503

    Number   Major   Minor   RaidDevice State
       8       8       64        0      active sync   /dev/sde
       9       8       32        1      active sync   /dev/sdc
       7       8       16        2      active sync   /dev/sdb
      11       8       48        3      active sync   /dev/sdd
       6       8       80        4      active sync   /dev/sdf
      10       8        0        5      active sync   /dev/sda
[root@mbpc-pc log]#

So let's do this:

[root@mbpc-pc log]#
[root@mbpc-pc log]# mdadm –grow /dev/md0 –size=max
mdadm: component size of /dev/md0 has been set to 1953513536K
unfreeze
[root@mbpc-pc log]# mdadm –detail /dev/md0
/dev/md0:
        Version : 1.2
  Creation Time : Mon Mar 26 00:06:24 2012
     Raid Level : raid6
     Array Size : 7814054144 (7452.06 GiB 8001.59 GB)
  Used Dev Size : 1953513536 (1863.02 GiB 2000.40 GB)
   Raid Devices : 6
  Total Devices : 6
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Mar 29 23:42:32 2018
          State : active, resyncing
 Active Devices : 6
Working Devices : 6
 Failed Devices : 0
  Spare Devices : 0

         Layout : left-symmetric
     Chunk Size : 64K

  Resync Status : 51% complete

           Name : mbpc:0
           UUID : 2f36ac48:5e3e4c54:72177c53:bea3e41e
         Events : 1333507

    Number   Major   Minor   RaidDevice State
       8       8       64        0      active sync   /dev/sde
       9       8       32        1      active sync   /dev/sdc
       7       8       16        2      active sync   /dev/sdb
      11       8       48        3      active sync   /dev/sdd
       6       8       80        4      active sync   /dev/sdf
      10       8        0        5      active sync   /dev/sda
[root@mbpc-pc log]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid6 sdd[11] sde[8] sdc[9] sdb[7] sdf[6] sda[10]
      7814054144 blocks super 1.2 level 6, 64k chunk, algorithm 2 [6/6] [UUUUUU]
      [==========>……….]  resync = 51.5% (1007560660/1953513536) finish=373.8min speed=42168K/sec
      bitmap: 7/8 pages [28KB], 131072KB chunk

unused devices: <none>
[root@mbpc-pc log]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid6 sdd[11] sde[8] sdc[9] sdb[7] sdf[6] sda[10]
      7814054144 blocks super 1.2 level 6, 64k chunk, algorithm 2 [6/6] [UUUUUU]
      [==========>……….]  resync = 51.5% (1007603712/1953513536) finish=405.9min speed=38830K/sec
      bitmap: 8/8 pages [32KB], 131072KB chunk

unused devices: <none>
[root@mbpc-pc log]#

And now you wait.  Once done, use the usual LVM commands such as PVS, VGS, LVS to resize those components.

Some reading available here.

Now that you've done that, it's time to resize the LVM physical volume:

[root@mbpc-pc ~]# pvs
  PV         VG          Fmt  Attr PSize   PFree
  /dev/md0   MBPCStorage lvm2 a–    3.64t 931.70g
  /dev/sdg2  mbpcvg      lvm2 a–    1.18t      0
  /dev/sdg4  mbpcvg      lvm2 a–  465.75g 415.75g
[root@mbpc-pc ~]# pvresize /dev/md0
  Physical volume "/dev/md0" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
[root@mbpc-pc ~]# pvs
  PV         VG          Fmt  Attr PSize   PFree
  /dev/md0   MBPCStorage lvm2 a–    7.28t   4.55t
  /dev/sdg2  mbpcvg      lvm2 a–    1.18t      0
  /dev/sdg4  mbpcvg      lvm2 a–  465.75g 415.75g
[root@mbpc-pc ~]# vgs
  VG          #PV #LV #SN Attr   VSize   VFree
  MBPCStorage   1   1   0 wz–n-   7.28t   4.55t
  mbpcvg        2   3   0 wz–n-   1.64t 415.75g
[root@mbpc-pc ~]# lvs
  LV         VG          Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  MBPCBackup MBPCStorage -wi-ao—-   2.73t
  fmlv       mbpcvg      -wi-ao—-   1.15t
  rootlv     mbpcvg      -wi-ao—-  81.25g
  swaplv     mbpcvg      -wi-ao—-   4.00g
[root@mbpc-pc ~]#

 

And you're set.

Cheers,
TK

Leave a Reply

You must be logged in to post a comment.


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License