Jump to content

Query about RAID 1 arrays


tim.tdj

Recommended Posts

Hi Everyone

I have read that RAID 1 arrays work in such a way that when a file is copied to a RAID 1 array, it is copied to all of the hard drives in the array simultaneously. In other words, it is not copied to just one of the hard drives and then copied from this hard drive to the others.

I have also read that if a bad sector occurs on one hard drive in the array, the resulting data corruption can spread to the other drives.

What I don't understand is how both of the above statements can be true at the same time because how can the corruption spread if data is not being copied between the hard drives in the array?

Thank you very much.

Kind regards

Tim

Link to comment
Share on other sites

1 hour ago, tim.tdj said:

Hi Everyone

I have read that RAID 1 arrays work in such a way that when a file is copied to a RAID 1 array, it is copied to all of the hard drives in the array simultaneously. In other words, it is not copied to just one of the hard drives and then copied from this hard drive to the others.

I have also read that if a bad sector occurs on one hard drive in the array, the resulting data corruption can spread to the other drives.

What I don't understand is how both of the above statements can be true at the same time because how can the corruption spread if data is not being copied between the hard drives in the array?

Thank you very much.

Kind regards

Tim

You are right, both of these statements cannot be true for RAID 1 and this one is not:
 

Quote

I have also read that if a bad sector occurs on one hard drive in the array, the resulting data corruption can spread to the other drives.

Thhe above is true for RAID 0 (stripe), for an array of drives in RAID 1 it will stay functional as long as at least one HDD is functional:
https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_1

Edited by koti
Link to comment
Share on other sites

13 minutes ago, koti said:

You are right, both of these statements cannot be true for RAID 1 and this one is not:
 

Thhe above is true for RAID 0 (stripe), for an array of drives in RAID 1 it will stay functional as long as at least one HDD is functional:
https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_1

Hi Koti

Thank you very much for your reply.

It has just occurred to me that a hard drive in a RAID 1 array can possibly remain "functional" in the array even when it has some bad sectors and that file corruption due to bad sectors can spread when RAID 1 arrays are rebuilding after a hard drive has been replaced. Is this true?

Link to comment
Share on other sites

8 minutes ago, tim.tdj said:

Hi Koti

Thank you very much for your reply.

It has just occurred to me that a hard drive in a RAID 1 array can possibly remain "functional" in the array even when it has some bad sectors and that file corruption due to bad sectors can spread when RAID 1 arrays are rebuilding after a hard drive has been replaced. Is this true?

In simple terms; if you have 2 drives 1Tb each and array them into RAID 1 you will end up with 1Tb of usable space - each sector will be mirrored so if you have a bad sector on one of the drives youre good as theres a copy of that sector on the other drive. The array does not rebuild in such a manner that it could use a bad sector as usable data, thats the whole idea behind RAID 1 - redundancy. The mirror can be done or 2 or more drives (more redundancy)

Link to comment
Share on other sites

1 minute ago, koti said:

In simple terms; if you have 2 drives 1Tb each and array them into RAID 1 you will end up with 1Tb of usable space - each sector will be mirrored so if you have a bad sector on one of the drives youre good as theres a copy of that sector on the other drive. The array does not rebuild in such a manner that it could use a bad sector as usable data, thats the whole idea behind RAID 1 - redundancy. The mirror can be done or 2 or more drives (more redundancy)

Hi Koti

You seem to be implying that the RAID 1 system can always detect if it is attempting to read data from a bad sector and if this is the case, it will get the data it was attempting to get from the other disk instead. Am I correct?

Link to comment
Share on other sites

1 hour ago, tim.tdj said:

Hi Koti

You seem to be implying that the RAID 1 system can always detect if it is attempting to read data from a bad sector and if this is the case, it will get the data it was attempting to get from the other disk instead. Am I correct?

A RAID 1 array makes a real time copy of everything it contains. If an error occurs in one of the copies, it substitutes the bad data with the remaining good copy - not the other way around.

RAID 1 consists of an exact copy (or mirror) of a set of data on two or more disks; a classic RAID 1 mirrored pair contains two disks. This configuration offers no parity, striping, or spanning of disk space across multiple disks, since the data is mirrored on all disks belonging to the array, and the array can only be as big as the smallest member disk. This layout is useful when read performance or reliability is more important than write performance or the resulting data storage capacity.[13][14]

The array will continue to operate so long as at least one member drive is operational.[15]

Edited by koti
Link to comment
Share on other sites

1 hour ago, koti said:

If an error occurs in one of the copies, it substitutes the bad data with the remaining good copy - not the other way around.

Hi Koti

Thank you very much for your reply.

I was not actually meaning the other way round.

Can RAID 1 systems detect all types of errors that can occur on a disk or are there some types of data error it can't detect and therefore wrongly think it is the correct data?

Link to comment
Share on other sites

45 minutes ago, tim.tdj said:

Hi Koti

Thank you very much for your reply.

I was not actually meaning the other way round.

Can RAID 1 systems detect all types of errors that can occur on a disk or are there some types of data error it can't detect and therefore wrongly think it is the correct data?

Most RAID 1 systems use error detection built into the hard drives themselves. If a drive in the array reports an error, the RAID rewrites data from the other disc.

RAID 1 or any other type of RAID can be configured through software or through a dedicated hardware RAID controller. It provides a level of abstraction which tells your operating system to treat a set of hardrives as a configurable logical unit. There are hundreds of ways you can configure a RAID array depending on the hardware/software and cisrcumstances. Your question seems to boil down to whether it is possible for a RAID 1 to fail and the answer is ofcourse Yes, it is possible depending on factors and circumstances. 

Edited by koti
Link to comment
Share on other sites

4 minutes ago, koti said:

Most RAID 1 systems use error detection built into the hard drives themselves. If a drive in the array reports an error, the RAID rewrites data from the other disc.

Hi Koti

Thank you.

Do you know if there are any circumstances whereby an error (such as a single bit flip) can develop on a hard drive without the hard drive detecting it? Or do all of the latest hard drives use mechanisms such as checksums to detect errors?

Link to comment
Share on other sites

36 minutes ago, tim.tdj said:

Hi Koti

Thank you.

Do you know if there are any circumstances whereby an error (such as a single bit flip) can develop on a hard drive without the hard drive detecting it? Or do all of the latest hard drives use mechanisms such as checksums to detect errors?

Single parity bit check is the most common error detection method in hard drives that I know of. Also check error handling which is a different concept from detection. Normally hard drives loose capacity due to error occurance (bad sectors) as far as I know there are error detection and correction mechanisms built into HDD's since the first PC days, my 286 XT machine in late 80's had a 20 megabite HDD (which needed to have its head parked btw) with some sort of error detection and correction. Nowdays all the drives have complex multi level error detection and correction systems. You seem to be asking if its possible for a specific method of HDD error detection/correction to fail and the answer is always yes, everything can and will fail if used long enough under load. 

Edited by koti
Link to comment
Share on other sites

2 minutes ago, koti said:

Single parity bit check is the most common error detection method in hard drives that I know of. Also check error handling which is a different concept from detection. Normally hard drives loose capacity due to error occurance (bad sectors) as far as I know there are error detection and correction mechanisms built into HDD's since the first PC days, my 286 XT machine in late 80's had a 20 megabite HDD (which needed to have it head parked btw) with some sort of error detection and correction. Nowdays all the drives have complex multi level error detection and correction systems. You seem to be asking if its possible for a specific method of HDD error detection/correction to fail and the answer is always yes, everything can and will fail if used long enough under load. 

Hi Koti

Thank you very much indeed for all your help. I have just one more question:

If I was to create a RAID 1 array with four hard drives and I was to use the btrfs file system, do you think that this would be pretty bulletproof against data corruption or can you see any potential flaws in this set-up?

Link to comment
Share on other sites

5 minutes ago, tim.tdj said:

Hi Koti

Thank you very much indeed for all your help. I have just one more question:

If I was to create a RAID 1 array with four hard drives and I was to use the btrfs file system, do you think that this would be pretty bulletproof against data corruption or can you see any potential flaws in this set-up?

If its for home use I would skip on RAID alltogether use ext and just buy good quality drives. If you want to keep safe just use a backup system of some sort and enrcyption, RAID's are kind of useless in home environment these days.  

Link to comment
Share on other sites

2 minutes ago, koti said:

If its for home use I would skip on RAID alltogether use ext and just buy good quality drives. If you want to keep safe just use a backup system of some sort and enrcyption, RAID's are kind of useless in home environment these days.  

Hi Koti

Thank you very much.

Why do you think that RAIDs are useless in home environments?

Link to comment
Share on other sites

38 minutes ago, tim.tdj said:

Hi Koti

Thank you very much.

Why do you think that RAIDs are useless in home environments?

RAID is useful when uptime is the most important factor so database servers, online stores and similar services which require five nine high availability. RAID should not be used as a backup so unless youre running Amazon from your home you really don’t need it. Unless you want to play around and test things that is :) 

Edited by koti
Link to comment
Share on other sites

8 minutes ago, koti said:

RAID is useful when uptime is the most important factor so database servers, online stores and similar services which require five nine high availability. RAID should not be used as a backup so unless youre running Amazon from your home you really don’t need it. Unless you want to play around and test things that is :) 

What if i want to be as close to 100% as i can get that none of my data will be corrupted? Surely If I just backup to one other drive, I am still a bit vulnerable?

Link to comment
Share on other sites

2 hours ago, tim.tdj said:

What if i want to be as close to 100% as i can get that none of my data will be corrupted? Surely If I just backup to one other drive, I am still a bit vulnerable? 

...there is never 100% certainty...

You need to make backups 1) every day 2) every hour 3) every minute.. (I doubt your data are so valuable to be worth backing them up so often)

Do you have UPS?

https://en.wikipedia.org/wiki/Uninterruptible_power_supply

https://www.ebay.com/b/Computer-Uninterruptible-Power-Supplies-UPS/99265/bn_317517

That's the first stage of making the more reliable computer system, rather than RAID. Lack of power will shutdown computer in random moment.. and you might lose of data in the blink of eye..

 

Edited by Sensei
Link to comment
Share on other sites

7 hours ago, tim.tdj said:

...Surely If I just backup to one other drive, I am still a bit vulnerable?

Backing up to another drive is essentially what RAID 1 is doing. With the addition of the array controller being vulnerable in the RAID scenario thats why everything is doubled, trippled in high availability systems. So essencially, at home it is safer just to keep backup on another drive than to use RAID. Unless you want to use redundancy - 3 of everything - drives, controller, RAM, CPU, power supply, everything. At the end you will end up building a high availability cluster which will cost you hundreds of thousands of dollars and will be completely useless for home use.

Edited by koti
Link to comment
Share on other sites

18 hours ago, tim.tdj said:

Hi Everyone

I have read that RAID 1 arrays work in such a way that when a file is copied to a RAID 1 array, it is copied to all of the hard drives in the array simultaneously. In other words, it is not copied to just one of the hard drives and then copied from this hard drive to the others.

I have also read that if a bad sector occurs on one hard drive in the array, the resulting data corruption can spread to the other drives.

What I don't understand is how both of the above statements can be true at the same time because how can the corruption spread if data is not being copied between the hard drives in the array?

Thank you very much.

Kind regards

Tim

 

Data preservation and backup is a wide topic.

The first question I would ask is

What 'data' do you wish to preserve?

You should distinguish between  (long term) archiving, the immediate data in use in the processor and other registers  and the intermediate data you may want in the near future.

Each of these has its own best solution.

In particular it is not efficient to make the equipment wade through masses of ancient data to find what is currently needed.
So storing a party list from five years ago should be done offline in some readily available manner.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.