Linux - General This 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. |
| Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
10-14-2005, 07:09 PM
|
#1
|
|
Member
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49
Rep: 
|
resync in Partitionable RAID 5.
Hello,
I got three disks and have a RAID 5 on them.
mdadm -C -l 5--auto=p -c 1024 -p ls -n 3 /dev/md_d0 /dev/sd{a,c,c}
and /proc/mdstat shows
md_d0: active raid5 sdc[3] sdb[1] sdc[0]
xxxx blocks..........balabala....
Say I have two partitions on the md_d0 and they are md_d0p1 and md_d0p2.
Now, I want to know, in case md_d0p1 gets dirty, does the resync occur on the whole md_d0 or just md_d0p1?
Do I make my question clear? I am not sure whether I got the right point or not.
Regards,
William
|
|
|
|
10-14-2005, 10:05 PM
|
#2
|
|
Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,644
|
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".
|
|
|
|
10-14-2005, 10:12 PM
|
#3
|
|
Member
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49
Original Poster
Rep: 
|
Thanks for the reply.
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?
|
|
|
|
10-15-2005, 08:43 AM
|
#4
|
|
Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,644
|
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.
|
|
|
|
10-15-2005, 09:02 AM
|
#5
|
|
Member
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49
Original Poster
Rep: 
|
Thanks for the advice.
I am just a fan and like to try new stuff. I just bought some new drives and this is the best time to try RAID.  .
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:56 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|