1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux Growing active RAID

Discussion in 'Software' started by LAGMonkey, 11 Apr 2009.

  1. LAGMonkey

    LAGMonkey Group 7 error

    Joined:
    4 Aug 2004
    Posts:
    1,507
    Likes Received:
    8
    Ok, ive done my searching and looked at the man-pages for mdadm however i havnt found a satifying answer to the question of...

    Can i grow my Active RAID 5 from 3 drives to 4 or do i have to take it offline for the entire process?

    in other words, i want to be able to read from my raid array while its growing from 3 drives to 4.

    Writing i have the sneaky suspision would be a v. bad idea but surely reading cant hert can it?

    NOTE:

    ill be using the following commands to grow my array once the new drive arrives...

    mdadm --add /dev/md0 /dev/sdd1
    mdadm --grow --raid-devices=4 /dev/md0

    sdd1 will be the new 4th drive, md0 is my raid array.
     
  2. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    I don't know 100% sure if you can grow raid devices on the fly, I think you can. This makes me a bit more confident, because it states:
    And there are RAID5 examples too: http://scotgate.org/2006/07/03/growing-a-raid5-array-mdadm/

    However, you probably run into a problem with the FS on the device, since that has to grow too. Most FS support online expanding, but some require an aditional tool to be installed.
     
    Krikkit and LAGMonkey like this.
  3. LAGMonkey

    LAGMonkey Group 7 error

    Joined:
    4 Aug 2004
    Posts:
    1,507
    Likes Received:
    8
    well the OS is installed on a seperate drive that wont be touched. The RAID is XFS so i guess id better have a hunt arround the MAN pages.
    Thanks Glider, helpful as usual.

    *looks at rep'y point thing'y and presses*

    EDIT::

    i think that im all ok, as a quick google spat out this...

     
  4. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    XFS is indeed great for such things... It even requires you to mount it ;) Take that Windows!
     
  5. LAGMonkey

    LAGMonkey Group 7 error

    Joined:
    4 Aug 2004
    Posts:
    1,507
    Likes Received:
    8
    well its the moment of truth, after a mega delay in shipping thanks to UPS i have my new 500 gig drive installed and currently the status is...

    Personalities : [raid6] [raid5] [raid4]
    md0 : active raid5 sdc1[3] sda1[0] sdd1[2] sdb1[1]
    976767744 blocks super 0.91 level 5, 128k chunk, algorithm 2 [4/4] [UUUU]
    [>....................] reshape = 1.0% (5051264/488383872) finish=1003.4min speed=8028K/sec

    unused devices: <none>

    so in about 17 hours or so all ill have to do is grow_xfs to fill the new space. Just got to hope that nothing F**ks up in the mean time as everything is mounted and active :worried:
     
  6. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Don't worry too much, if it gets interupted, it will just restart afterwards ;) (/bin/there/done/that)
     
  7. C-Sniper

    C-Sniper Stop Trolling this space Ądmins!

    Joined:
    17 Jun 2007
    Posts:
    3,028
    Likes Received:
    126
    yep yep, I can attest to this as well.
     
  8. LAGMonkey

    LAGMonkey Group 7 error

    Joined:
    4 Aug 2004
    Posts:
    1,507
    Likes Received:
    8
    Personalities : [raid6] [raid5] [raid4]
    md0 : active raid5 sdc1[3] sda1[0] sdd1[2] sdb1[1]
    976767744 blocks super 0.91 level 5, 128k chunk, algorithm 2 [4/4] [UUUU]
    [===========>.........] reshape = 55.8% (272912384/488383872) finish=481.5min speed=7457K/sec

    unused devices: <none>


    eee so exciting. and as for being interupted, ive got my server and cable modem hooked up to a UPS so if the power goes out ill still have internet!!! granted if the power goes out big time the cable headend wont be working but its symbolic.
     
  9. LAGMonkey

    LAGMonkey Group 7 error

    Joined:
    4 Aug 2004
    Posts:
    1,507
    Likes Received:
    8
    final post just to round things up with this thread...

    Managed to get some sleep last night and awoke this morning to the good news of...

    Personalities : [raid6] [raid5] [raid4]
    md0 : active raid5 sdc1[3] sda1[0] sdd1[2] sdb1[1]
    1465151616 blocks level 5, 128k chunk, algorithm 2 [4/4] [UUUU]

    unused devices: <none>

    so a quick hunt through the interweb (i was tired... ) and the next command was issued.

    xfs_growfs /dev/md0

    all sorted now...

    /dev/md0: 1397.28GiB raid5 4 devices, 0 spares. Use mdadm --detail for more detail.

    :clap:
    now the GF can go back to downloading and using it as a repository for some questionable content from my point of view (I found Paris Hiltons BBF on there the other week! ) :wallbash:
     
  10. C-Sniper

    C-Sniper Stop Trolling this space Ądmins!

    Joined:
    17 Jun 2007
    Posts:
    3,028
    Likes Received:
    126
    congrats at everything working well. Remember keep the pimp hand strong!:lol:
     

Share This Page