Comments on How To Resize RAID Partitions (Shrink & Grow) (Software RAID)
How To Resize RAID Partitions (Shrink & Grow) (Software RAID) This article describes how you can shrink and grow existing software RAID partitions. I have tested this with non-LVM RAID1 partitions that use ext3 as the file system. I will describe this procedure for an intact RAID array and also a degraded RAID array.
6 Comment(s)
Comments
Thank you for tutorial it is very useful. Actually resize is not working with RAID0
mdadm --grow /dev/md0 --size=188743680
mdadm: raid0 array /dev/md0 cannot be reshaped.
mdadm --grow --help
This version supports changing the number of
devices in a RAID1/5/6, changing the active size of all devices in
a RAID1/4/5/6, adding or removing a write-intent bitmap, and changing
the error mode for a 'FAULTY' array.
Regards
Ubuntu rescue edition CD ISO has ddrescue which allows you to get most of the data off a failing disk. If you're lucky without too much corruption!
Using the resize command
mdadm --grow /dev/md2 --size=max
and you get the error:
mdadm: Cannot set device size for /dev/md2 - Device or resource busy
check these (commands are just example):
- make sure there is no RAID rebuild in progress (cat /proc/mdstat)
- make sure there is no opened file (lsof | grep md2)
- make sure it's not mounted (mount | grep md2)
- see if it's the bitmap issue (google for that)
Boot into rescue mode.
I have a /dev/md0 Raid1 array comprising /dev/sdb1 and /dev/sdc1.
Both partitions are half the capacity of their disks. IE /dev/sdc1 is have the size of /dev/sdc.
How can I resize /dev/md0 to use all the space on the disks?
Hi Falko.
Thanks for the Tutorial.
I have a few questions or hints:
when i run your Commands as above:
. cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_orig
mdadm --examine --scan >> /etc/mdadm/mdadm.conf
It always creates duplicates at the end of mdadm.conf.
If i run:
e2fsck -f /dev/md2
I get the Error:
root@nas:~# e2fsck -f /dev/md2
e2fsck 1.44.5 (15-Dec-2018)
/dev/md2 is mounted.
e2fsck: Cannot continue, aborting.
So should i unmount the RAID and try again?
Best regards
Philipp