add extra raid disk
2020.01.05 18:10
https://zackreed.me/adding-an-extra-disk-to-an-mdadm-array/
Initial State
If you remember from part one, we setup a (3) disk mdadm RAID5 array, created a filesystem on it, and set it up to automatically mount. In this part, we’ll add a disk to an existing array to first as a hot spare, then to extend the size of the array. Growing a RAID-5 array with mdadm is a fairly simple (though slow) task. First you will need to prepare the new drive in the same we we prepared the initial drives in [part 1](http://zackreed.me/articles/38-software-raid-5-in-debian-with-mdadm). To start the actual growing of the array we then add the new drive to the array as a spare:
Then we grow the array onto this device. Because I had 3 drives before, the new drive obviously makes 4. Make sure to change this to whatever number you now have! Let’s set up some options to make the array rebuild / recover faster… In this example, set it to 50000 K/Sec, enter:
As when creating the array, we can follow the progress by checking the file /proc/mdstat.
Again, I like to wait for the operation to finish before attempting to grow the filesystem, but you should be able to do it while the array syncs if you’d like. At this point, you’ve added the disk to the array, and it should show up as a hot spare like this.
Growing the array and the filesystem
Adding this new drive to the array is ridiculously easy.
As when creating the array, we can follow the progress by checking the file /proc/mdstat.
Again, I like to wait for the operation to finish before attempting to grow the filesystem, but you should be able to do it while the array syncs. Since, I err on the side of caution, I let the array finish syncing and run a filesystem check to make sure everything is in order before I grow the array. Before we can run a filesystem check, we need to unmount it:
Now that it is unmounted we can run a filesystem check to make sure everything is in order:
If any issues arise, let it attempt to fix them for you. Once the filesystem has been checked we can perform the resize. If you decided to use something other than ext2/3/4 this will be done differently, but for the ext2/3/4 filesystems we use the resize2fs tool.
This will automatically grow the filesystem to the new size of the device. But, whenever you make a change to mdadm, you always want to remember to update your mdadm.conf file so that it reassembles correctly after a reboot.
You can now remount the drive and start filling it up again!
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
1671 | 음란전화.... | 윤재원 | 2000.07.10 | 3884 |
1670 | 재원님이 퍼온 심리테스트...하하하 읽어봐라 | 재원님~ | 2000.07.12 | 3624 |
1669 | 의욕상실 | 채영광 | 2000.07.13 | 3949 |
1668 | Re: 의욕상실 | 한승석 | 2000.07.13 | 3407 |
1667 | Re: 사진 더 추가해줘잉 | 한승석 | 2000.07.13 | 3215 |
1666 | 비천무는 잼있다! | 채영광 | 2000.07.16 | 4091 |
1665 | 음악 니가 다 정리한 거야? | 채영광 | 2000.07.18 | 4489 |
1664 | 아주아주 멋진 시...한편..꼭 읽어봐랑~ | 재원님~ | 2000.07.18 | 3653 |
1663 | 승석아 오늘 오스키는 잘 보았니? | 채영광 | 2000.07.23 | 3605 |
1662 | Re: 비천무는 잼없다! | 헬로우멤 | 2000.07.24 | 3460 |
1661 | 비천무...말이지~~~ | 윤재원 | 2000.07.26 | 3619 |
1660 | 승석아 다다음주 말이야. | 채영광 | 2000.07.31 | 3468 |
1659 | 똑똑똑~~ | 조각가 | 2000.08.01 | 3641 |
1658 | 승석이오빠아...ㅜ.ㅜ 설가면 맛난거 사주우.ㅠ.ㅠ | 김승욱 | 2000.08.06 | 4337 |
1657 | 승석 X-ray는 많이 찍었니? | 정석원 | 2000.08.07 | 3837 |