# Disk failing - RAID questions

## colo

I'm operating a small homeserver w/ 4x160Gb Seagate HDDs in RAID1/RAID5. One of the disks incorporated in those arrays is about to fail, as you can see here:

```
md1 : active raid1 hdd1[3] hdc1[2] hdb1[1] hda1[0]

      72192 blocks [4/4] [UUUU]

md3 : active raid1 hdd3[3] hdc3[2] hdb3[1] hda3[4](F)

      2008000 blocks [4/3] [_UUU]

md5 : active raid5 hdd5[3] hdc5[2] hdb5[1] hda5[4](F)

      24024768 blocks level 5, 64k chunk, algorithm 2 [4/3] [_UUU]

md6 : active raid0 hdd6[3] hdc6[2] hdb6[1] hda6[0]

      4015616 blocks 64k chunks

md7 : active raid5 hdd7[3] hdc7[2] hdb7[1] hda7[0]

      432573888 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
```

I'm currently not able to access the beast via ssh, though I'll be on site tomorrow and able to inspect the issue further. I guess I'll need to replace the drive entirely, and I've got a few questions about that process.

Will I be able to keep the machine running with only 3 out of 4 drives left for the time being? (Of course I don't intend to try pulling the disk out while the system is powered on  :Wink: )

Will I have to manually issue commands to rebuild the array(s) when the replacement disk is installed, or does md handle all that by itself?

Has anyone made experiences with Seagate's RMA process yet? How did you fare with it?

Is thre any way of easily repliacting the partition layout of a drive? Cloning the very first sector of the drive does not contain infos about the extended partitions, so this will not take care of the majority of my partitions...

Any other tips on how to make things go as smooth as possible?

Cheers, and thanks for your support in advance  :Smile: 

----------

## mbar

 *colo wrote:*   

> 
> 
> Has anyone made experiences with Seagate's RMA process yet? How did you fare with it?
> 
> 

 

Yep, something like ~3 years ago I had to replace 60 GB Barracuda IV. I misflashed it (in a stupid way -- file with firmware was on THE SAME drive as being flashed  :Smile:  ) and ofcourse it stopped working, but everythig else (mechanics, electronics) was OK. I filled RMA on their site www.seagate.com, got RMA number and shipping address. Then I had to send my drive form Poland to Holland (I paid for that, they paid for returning package) and wait for a few weeks. I got a replacement drive, but thanks to them sending value package (50 USD stamped on it) I had to pay duty tax... Only that part was annoying, cause I already paid duty tax when buing drive in Poland, I didn't buy a new one in Holland. No use struggling with duty officers  :Very Happy: 

----------

## colo

Thanks for your reply.  :Smile: 

Anyone else who wants to contribute?

----------

## rasmussen

```
md1 : active raid1 hdd1[3] hdc1[2] hdb1[1] hda1[0]

      72192 blocks [4/4] [UUUU]

md3 : active raid1 hdd3[3] hdc3[2] hdb3[1] hda3[4](F)

      2008000 blocks [4/3] [_UUU]

md5 : active raid5 hdd5[3] hdc5[2] hdb5[1] hda5[4](F)

      24024768 blocks level 5, 64k chunk, algorithm 2 [4/3] [_UUU]

md6 : active raid0 hdd6[3] hdc6[2] hdb6[1] hda6[0]

      4015616 blocks 64k chunks

md7 : active raid5 hdd7[3] hdc7[2] hdb7[1] hda7[0]

      432573888 blocks level 5, 64k chunk, algorithm 2 [4/4] [UUUU]
```

Okay, I may be wrong but AFAICT if hda is failing, md[1,3,5,7] will not be affected when you remove the drive. They should be able to handle that. 

But, because it's RAID0, md6 will be destroyed when you remove hda. So unless md6 is a scratch drive, you'll be wanting to backup that _before_ you remove hda.

----------

## widan

 *colo wrote:*   

> Will I have to manually issue commands to rebuild the array(s) when the replacement disk is installed, or does md handle all that by itself?

 

You will need to partition the new drive in the same way as the old one (don't forget to set the type on the partitions to 0xfd [RAID Autodetect]). Then you add each partition to its array (you need to do it for each array, with the proper partition):

```
mdadm --manage --add /dev/md1 /dev/hda1
```

The kernel will then rebuild the arrays in the background (this will take some time).

For the RAID0 array, you will need to recreate it (it's not redundant, so it won't survive the disk swap).

 *colo wrote:*   

> Is there any way of easily repliacting the partition layout of a drive?

 

Before pulling the old one, run "sfdisk -d /dev/hda > /root/partition-layout". After you install the new one, "cat /root/partition-layout | sfdisk /dev/hda" should write it to the new disk. Be careful: sfdisk doesn't ask for confirmation ! So be sure that you are writing to the correct drive.

----------

## colo

Hey guys, great thanks for your step-by-step-instructions  :Smile: 

Since md6 (the RAID0-Array) is just /tmp, I won't have much of a hassle getting that one up again, I guess.

----------

## widan

 *colo wrote:*   

> Since md6 (the RAID0-Array) is just /tmp, I won't have much of a hassle getting that one up again, I guess.

 

Just don't forget to "chmod 1777 /tmp" after you mount it the first time, else the cause of (non-root) programs failing to start/work properly can be difficult to track down...

----------

## Woolong

 *widan wrote:*   

>  *colo wrote:*   Will I have to manually issue commands to rebuild the array(s) when the replacement disk is installed, or does md handle all that by itself? 
> 
> You will need to partition the new drive in the same way as the old one (don't forget to set the type on the partitions to 0xfd [RAID Autodetect]). Then you add each partition to its array (you need to do it for each array, with the proper partition):
> 
> ```
> ...

 

Do you need to format the partitions before they are added back to the array or it doesn't matter?

----------

## widan

 *Woolong wrote:*   

> Do you need to format the partitions before they are added back to the array or it doesn't matter?

 

No, RAID arrays work below filesystems, they do not know about formatting.

----------

