I have 2 500gb drives in a RAID1 setup that I needed to upgrade for more space. I mdadm --fail'ed each drive in turn and I used dd to copy each drive to it's respective larger drive (2tb each), removed the smaller drives and replaced them with the larger drives, and reassembled the array and forced a resync. So now I've got a 500gb RAID1 sitting on 2TB drives, and wish to grow them.

The plan is to use mdadm --manage /dev/md0 --grow to grow them, then boot a rescue cd, assemble the array under that environment, and do the resize2fs on them. Can I use mdadm --grow on a mounted and live filesystem? Also, do I need more options to make sure the grow operation stays raid1?

  • also, how long can I expect each operation to take? – Chris Dec 23 '10 at 15:06

Sorry, I know I'm not replying the right way, but I couldn't figure out how to get my unregistered user registered.

I couldn't just copy the data over as I couldn't risk losing new data that showed up on the old drives during the copy. I had to have the server lose as little uptime as possible, so I couldn't take it down during the copy. I could really only spare enough downtime to swap drives.

Managed to make it work:

Removed one old drive plugged in one new drive synced the raid partiton across to the new drive unplugged the remaining old drive, replaced it with the remaining new drive synced again mdadm --grow'ed it resize2fs'ed it

the grow and the resize2fs happened live. It was fairly low drama.

| improve this answer | |

Yes, you can grow a raid online, but I'm unsure if you can grow a FS online. You don't need more specific options.

The standard rebuild speed is limited, you can speed it up (make it use more resources), by echoing a value to /proc/sys/dev/raid/speed_limit_max and /proc/sys/dev/raid/speed_limit_min

| improve this answer | |

Wrong Approach.

Just insert the two new drives, create an array and copy the data over.

| improve this answer | |

Look at https://raid.wiki.kernel.org/index.php/Growing

When new disks are added, existing raid partitions can be grown to use the new disks. After the new disk was partitioned, the RAID level 1/4/5/6 array can be grown for example using this command (assuming that before growing it contains three drives):

mdadm --add /dev/md1 /dev/sdb3
mdadm --grow --raid-devices=4 /dev/md1

The process can take many hours or even days. There is a critical section at start, which cannot be backed up. To allow recovery after unexpected power failure, an additional option --backup-file= can be specified. Make sure this file is on a different disk or it defeats the purpose.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.