Editing
Raid: Growing
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Adding partitions== 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 <code>--backup-file=</code> can be specified. Make sure this file is on a different disk or it defeats the purpose. mdadm --grow --raid-devices=4 --backup-file=/root/grow_md1.bak /dev/md1 You may get an error like: '''Cannot set device size/shape for /dev/md5: Device or resource busy''' In this case, check to see if you are using a [[Write-intent bitmap|write-intent bitmap]]. If you are you must remove the bitmap first, grow the array, then re-add the bitmap. mdadm --grow /dev/mdX -b none mdadm --grow /dev/mdX -n<new number of drives> mdadm --wait /dev/mdX mdadm --grow /dev/mdX -b internal After mdadm finished growing the array it does not automatically modify '''/etc/mdadm.conf'''. Therefore you will realize that mdadm will not find the grown device '''/dev/md1'''. To make mdadm find your array edit '''/etc/mdadm.conf''' and correct the num-devices information of your Array. (btw: using ubuntu its '''/etc/mdadm/mdadm.conf''') OLD: DEVICE partitions ARRAY /dev/md1 level=raid5 num-devices=3 metadata=00.90 spares=1 UUID=b05d00ce:f6224b94:64ae041e:7a8d916f NEW: DEVICE partitions ARRAY /dev/md1 level=raid5 num-devices=4 metadata=00.90 spares=1 UUID=b05d00ce:f6224b94:64ae041e:7a8d916f Remark for Raid5/6: You will realize that (checking with 'df') the size of your array has not changed. If you added one 1TB drive to your existing 3-1TB-drive-array mdadm will not automatically add the new 1TB of space. Mdadm will just spread the old 3TB-array over 4 drives occupying 750GB of each drive and leaving 250GB on each drive blank. To change that, have your array unmounted and: resize2fs respectively resize_reiserfs or xfs_growfs /dev/md1 A full command example with options is as follows resize2fs -S 128 -p /dev/md1 630G * -S raid stride size calculated with chunk / block = 512k / 4k = 128k. These are custom numbers that will not make sense with the default. Please find your numbers and use those for this. You can also just not call this option and stick to default. * remember to set chunk in mdadm command, as chunk is set to 64? by default * higher chunk was decided upon based on info from raid wiki that research showed that high chunk size for raid-5 arrays worked good * 630G gigabytes shrink to size
Summary:
Please note that all contributions to RARForge may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RARForge:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home
All Pages
All Files
View Categories
Recent changes
Random page
Edit this menu
Tools
What links here
Related changes
Special pages
Page information