LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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

Reply
 
Search this Thread
Old 10-14-2005, 07:09 PM   #1
FinalFantasy
Member
 
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49

Rep: Reputation: Disabled
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
 
Old 10-14-2005, 10:05 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,000
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
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".
 
Old 10-14-2005, 10:12 PM   #3
FinalFantasy
Member
 
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49

Original Poster
Rep: Reputation: Disabled
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?
 
Old 10-15-2005, 08:43 AM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,000
Blog Entries: 5

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
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.
 
Old 10-15-2005, 09:02 AM   #5
FinalFantasy
Member
 
Registered: Sep 2003
Location: UK
Distribution: CLFS-32bit-x86 / LFS-SVN-20060210
Posts: 49

Original Poster
Rep: Reputation: Disabled
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..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No Partitionable media were found rajeevpn Linux - Laptop and Netbook 0 09-20-2005 09:58 AM
Perc3Di SCSI RAID + Adaptec 2810SA RAID = Fatal Grub Error? LinuxOnTheEdge Linux - General 2 03-19-2005 02:35 PM
does linux support the sata raid and ide raid in k7n2 delta ilsr? spyghost Linux - Hardware 10 04-16-2004 05:27 AM
RAID resync thedeud Linux - General 6 03-14-2003 05:22 PM
Resync every reboot u4113072 Linux - Software 0 10-15-2002 02:06 AM


All times are GMT -5. The time now is 02:15 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration