Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Basically you have data bits and a parity bit spread across the 3 drives. If a data bit is seen to be bad then it will use the remaining data bit and the partiy bit to recreate the missing data bit. If a parity bit goes bad it will use the two data bits to recalculate the parity and recreate that.
The parity is spread across the disks so that your block of data might have data data parity and your next data parity data and your next parity data data etc...
Typically the only time you really see any kind of "resync" is if one of the drives goes bad and gets replaced. After you replace the bad drive it will rebuild all the missing bits on the replaced drive which as noted above will be some data and some parity.
In that case all your partitions would be affected because some part of each of them will be spread across the 3 drives. The only way to avoid this would be to have a separate RAID set comprised of completely different drives than the first RAID set.
Note by "bit" above I just mean a piece (block/stripe) rather than the technical term "bit".
Talking like disk replacement. I know that will activate the resync for the whole disk.
But, for example, I only mount the first partition md_d0p1, and in the middle of an operation I press reset button. Now what will happen to md_d0p2? will it be excluding from resyncing or the resync will happen to the whole md_d0?
Resync deals with making data and parity bits agree. So although it might "resync the whole disk" in point of fact the only writes ought to be for the data or parity bits that are incorrect. It depends much on implementation.
Of course the above assumes your theoretical "reset" only corrupted one of the 3 bits for a given piece of data. If it was disruptive enough to harm 1 bit on 1 disk there is no reason to assume it wouldn't disrupt 2 bits on 2 disks and if they're the same stripe you're hosed because it doesn't have enough information to recreate that stripe.
However GENERALLY reset/hard power downs are more likely just to cause the filesystem (a structure laid out on top of disks or RAID sets) to just mark the filesystem as needing an fsck. If you have a non-journaling filesystem and corrupt the superblock and don't have any copies that are uncorrupted then you're hosed even if the RAID 5 itself is still intact. The number of times I've seen a power off event corrupt a filesystem to the point of irrecoverability in 15 years of Unix/Linux administration can be counted on one hand. In fact recently I had a laptop get fried by a lightning strike and simply moving its hard drive to another laptop got me up and going in short order because the drive itself was unaffected. You are more likely to experience a whole disk failure than one bad bit of data and usually its a mechanical/electrical failure within the drive itself rather than an external event.
Having said that though you really do NOT want to be doing a reset or leaving your system off UPS. If its important enough to you to have 3 disks and RAID 5 its probably important enough to do basic power protection. The UPS not only allows you to survive low power or power outage situations but usually has line conditioning to avoid power spikes.