Because why not

Learning through breakage

Replace a Drive in a Raid Array

I built a raid 5 array some time ago, but never really tested it. I wanted to figure out if I knew what to do in case a drive failed on me before I started loading them up with important data. This is what I went through to remove a drive, partition a new one and add it to the array.

Removing a Drive

In order to remove a drive, it must be makred as faulty. It may be marked faulty through failure or manually.

To manually mark a drive as faulty you can do it by using the -f/—fail flag, lisk so: sudo mdadm /dev/md0 -f /dev/sdd1 where /dev/md0 is your array and /dev/sdd1 is the drive to be marked faulty.

You can see the drive has been marked as faulty in the array details.

$ sudo mdadm --detail /dev/md0

 Number   Major   Minor   RaidDevice State
   0       8       97        0      active sync   /dev/sdg1
   1       0        0        1      removed
   3       8       33        2      active sync   /dev/sdc1

   1       8       17        -      faulty spare   /dev/sdb1

Hello World!

After trying to get a blog up so many times in the past, I finally just forced myself to do it. Thankfully there are loads of options that will make it easy for anyone to get up and going.

My primary reason for starting this is to keep track of my technical thoughts and understandings. I read a wide variety of technical tutorials, blogs, books, etc., and learn a lot. Sadly, things get foggy after some time. So to combat that feeling, I’m going to use this as notes to what I have learned. Reminds me of college days, escept that, hopefully I find these notes more useful.

Let the games begin!