# How can this raid partition fail?

## Bullet Dodger

Hi.

I've got 2 HDs, a and b.

I have a 20Gb partition on each, which make up a raid1 array.

My gentoo linux is on HD b and is not raided.

If HD a fails, i replace the HD, create a new 20Gb partition and add it to the raid array. All sorted.

But what if HD b fails?

I replace the HD, reinstall the OS.

Then can i mount the partition on HD a, as a stand alown partition?

Or do i have to set up raid and add it to a new raid array be for i can access it??

Cheers

----------

## NeddySeagoon

Bullet Dodger,

You can safely mount half a raid1 set read only but you can bring it up in degraded mode as a raid, then add the replacement partition.

Thats safer. You may still use the raid as it syncs the new partition.

----------

## Bullet Dodger

I think you've answered the question, but i think u missed the point of what i was saying.

If my HD a fails i lose half a raid1 with OS still intact. This HD can be replaced and added to the raid array and it will be as good as new.

If my HD b fails it will take with it my OS, as my OS is not rided and only lives on HD b.

So if HD b fails, i would have 2 replace the HD and reinstall the OS.

The main reason for asking the question was to find out the earliest stage that i could access this raid partition in the case of HD b (and therefore the OS) going down.

From you reply if sounds like i found re-install gentoo and mount the surviving partition from HD a by its self (ie not as a raid device), before i reinstall the raid setup but why read only? (Not that it matters, cos if this happened read only would be good enough to copy all the data to a cd).

Cheers

----------

## Bullet Dodger

I was looking through my emails and when looking at the one from this forum, i got a targeted advertisment from gmail from these people http://www.drivecrash.com/raidSystems.php

They claim they can recover data from a raid array.

Now i might be missing someting here but, unless you have a non redundent raid array ie. raid0 why would you ever need them?

The whole idea of alot of raid levels are to provide redundancy (ie. raid1) so that your data survives a DH failure.

Have i missed somthing, or are these people trying to take some people for a ride. (Like the people with the money, but no idea?)

Just doesn't sound quite right to me. Unless they are talking about multi drive failures, but what is the chance of that !!

----------

## NeddySeagoon

Bullet Dodger,

You can mount your 1/2 a raid set as an ordinary volume but if you allow it to be written in this mode, things get out of step.

Hence read only.

However, you don't need both parts of the mirror to mount it as /dev/mdX, only raid1 support in your kernel.

you can then mount your degraded raid quite safely in read write mode. This is safest.

The Gentoo liveCD can do either.

RAID1, 5, or 6 guards against failures of disks. There are other single points of failure that can cause you to loose more drives than raid alone can cope with. e.g. a drive controller with two drives attached. You may want to help to recover your raid data then.

Of course, raid is not intended as an alternative to backups. rm <file> removes the file from the raid, so you still need backups to get it back.

----------

## Bullet Dodger

 *Quote:*   

> 
> 
> Of course, raid is not intended as an alternative to backups. rm <file> removes the file from the raid, so you still need backups to get it back.
> 
> 

 

I agree. But i don't make backup as often as i should (or would like to). A very common problem, i think you'll agree.

But i have alot of digital pictures of my 1 year old son. (my 1st son) and really do not want to lose any of em. so decided a raid partition could protect against a single drive failure in the lose of any of these pics. I've had 3 computers and never had a HD failure, but a friend of my has just lost a HD. unfortunatly he had alot of work related stuff on there that was not backed up!! And paid quite a bit out of his own pocket to a HD recovery company.

I think a raid patition and a little less than desired back up to CD should be good enough for my requirements.

Cheers.

----------

## Bullet Dodger

i have a second question related to raid and hot-swapable devices.

i read that all hardware when used with linux is hot-swappable with the exception of ram.

so i decied to test my raid setup (on the fly) against the advice of the howto (http://www.tldp.org/HOWTO/Software-RAID-HOWTO.html#toc3)

With my gentoo box running i pulled the data bus to HD a.

When i tried to access my raid1 partition, after a sort delay, HD "a" was marked as bad and every thing carried on as expected.

I then reconnected my HD "a", and tried to re-add the partition back to the array, but couldn't.

I tried:

```

fdisk /dev/sda

```

but was told this drive was inaccessable ?!?

So with the HD data bus connected i pulled the HD power and reconnected it, thinking there is maybe some sort of inisialisation on power up. but still the HD was inaccessable.

(a reboot sorted this, hda became accessable and a could re-add it to the arrray)

So my question is, is there some trick to inserting a HD when the box is powered and getting linux to recognize it?

(1 of my reasons for likeing linux over M$ windows is that linux does not need a reboot after every little operation, but oviously not the only 1).

Cheers

----------

## schwicky

If you plug in your device while the system is running, you need to have your controller recognize it. It's a feature of your controller and of its driver. AndI guess not all disk controllers are hot-plug-compatible.

----------

## schwicky

 *Bullet Dodger wrote:*   

> 
> 
> If my HD b fails it will take with it my OS, as my OS is not rided and only lives on HD b.
> 
> So if HD b fails, i would have 2 replace the HD and reinstall the OS. 
> ...

 

The question is why you did not make a raid-1 of your OS partition? If you do that and install your boot loader on both disks mbr then you will be able to boot and access your data no matter which of both disks dies.

----------

## NeddySeagoon

Bullet Dodger,

Linux is begining to support hot swap everything, including RAM and CPUs (as long as you don't remove all the RAM or all the CPUs)

However, a lot of hardware does not support hot swap.

Hot Swap is a part of the SATA hardware standard but the kernel is only now getting support in the driver software.

With pulling (or failing) a drive, you not only have to get the hot swap to work, you also have to rebuild the raid set from the good drive.

Its contents may have changed while the partner was missing. That step is not normally automatic.

----------

