mdadm Rebuilding Raid 1 on 2 new disks problems
Hi All,
I had a mdadm raid-1 with 4 devices (md0, md1, md2 and md3) on two 300GB disks. I failed, and removed 1 disk and replaced it with a 1Tb disk. I partitioned the disk the same as the original and re-built (added) the array one device at a time with the new disk. Everything seemed to go OK. I went ahead and failed and removed the other 300GB disk and added the 2nd 1Tb disk. I partitioned the disk the same as the original and rebuilt the array one device at a time. Again, went OK but the md3 array was not using the full size of the 1TB disks. On the original disks md3 was built on top of an extended partition, (sda4 and sdb4) with a logical partition on top, (sda5 and sdb5). I tried to replicate that on the new disks, but it appears I didn't. mdstat and parted are not showing the same info, see below: Code:
[root@pequod ~]# cat /proc/mdstat Code:
[root@pequod ~]# parted -l Sorry for the length! Any help is greatly appreciated! Thanks! |
Software RAID doesn't automatically fill the devices it is built on - you have to explicitly tell mdadm to grow it once everything is in place. Then you have to expand the filesystem to use the extra space as well.
I don't know how you managed to convince mdadm that /dev/sdb5 (still) exists, but I'd be inclined to just delete md3 and rebuild it from scratch using /dev/sda4 and /dev/sdb4 and restore your data. That way you'll be using all the space, and have a working array. KISS. |
Thanks for the reply syg00!
Yes, I've done some more research and was introduced to mdadm --grow and resize2fs. I did not completely wipe md3, rather I removed sda4 as a primary partition then recreated it as an extended and built sda5 on top as a logical partiton - the same as on the original 300GB disk. I added sda5 to the array and it rebuilt! I then failed and removed sdb5 and then tried to remove the sdb5 partition with parted - it reported it didn't exist! I went ahead and removed sdb4 then recreated sdb4 as extended and sdb5 as logical as above. I added sdb5 to the array and it rebuilt. I then did mdadm --grow and it completed successfully with the full size of the disk. Then unmounted the md3 drive and used resize2fs which completed and filled the disk. Mounted md3 and all data was there and the new larger disk size is shown! I realize this is probably not "best practice" and I'm very lucky, but so far everything is running ok and after a day of reads and writes to the array no problems. However, I will keep an eye on this array and maintain regular backups. Thanks again! |
Whatever works is good. If you are happy to play around, you'll never stop learning something.
|
All times are GMT -5. The time now is 04:12 AM. |