Skip to content

add extra raid disk

2020.01.05 18:10

WHRIA 조회 수:80

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!

번호 제목 글쓴이 날짜 조회 수
1626 하드 디스크 교체 WHRIA 2008.07.20 8502
1625 Medieye Server 이전 WHRIA 2007.10.15 8477
1624 리눅스는 망했다. WHRIA 2012.12.25 8437
1623 yahoo 데이터 가져오기 WHRIA 2012.04.25 8423
1622 convert to wav WHRIA 2007.08.12 8397
1621 버릴 것은 쓰레기통에 WHRIA 2007.09.30 8393
1620 Url Finder file WHRIA 2008.06.07 8390
1619 의미없게... 승석이방을 방문하고.. 노지호 2000.06.08 8367
1618 홈페이지 대회있다고 해서 불나게 고쳤습니다. 한승석 2000.06.07 8338
1617 United Airline 에서 당첨 WHRIA 2007.08.01 8299
1616 84 인치 TV 도 파는군. WHRIA 2013.01.12 8276
1615 MedicalPhoto Release 1.0.2 WHRIA 2008.04.05 8262
1614 airvideo compile WHRIA 2011.06.15 8236
1613 vc2005 problem WHRIA 2008.02.23 8165
1612 To airboard WHRIA 2007.08.07 8134

Powered by Xpress Engine / Designed by Sketchbook

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소