telling mdadm to use spare drive.
Hi,
I finished copying all data from old disc hdc to my shiny new RAID5 array (/dev/hda3 /dev/sda3 missing). Next step is to create a partition on hdc and add it to the array. And so I did this:
# mdadm --add /dev/md1 /dev/hdc3
But then I had a problem - the /dev/hdc3 was a spare, it didn't resync automatically:
# mdadm -D /dev/md1
[....]
Number Major Minor RaidDevice State
0 3 3 0 active sync /dev/hda3
1 8 3 1 active sync /dev/sda3
2 0 0 2 removed 3 22 3 - spare /dev/hdc3
I wanted to tell mdadm to use the spare device, and I wasn't sure how to do this, so I tried following:
# mdadm --stop /dev/md1 # mdadm --assemble --update=resync /dev/md1 /dev/hda3 /dev/sda3 /dev/hdc3
Now, 'mdadm -D /dev/md1' says:
[...]
Number Major Minor RaidDevice State
0 3 3 0 active sync /dev/hda3
1 8 3 1 active sync /dev/sda3
3 22 3 2 spare rebuilding /dev/hdc3
I'm writing here just because I want to be sure that I added this new device correctly, I don't want to make any stupid mistake here...
# cat /proc/mdstat
md1 : active raid5 hda3[0] hdc3[3] sda3[1]
966807296 blocks super 1.1 level 5, 128k chunk, algorithm 2 [3/2] [UU_]
[=>...................] recovery = 6.2% (30068096/483403648) finish=254.9min speed=29639K/sec
bitmap: 8/8 pages [32KB], 32768KB chunkWas there a better way to do this, is it OK?
Signature · 1 line
Janek Kozicki |
man mdadm - suggested correction.
Hello,
I did read 'man mdadm' from top to bottom, but I totally forgot to look into /usr/share/doc/mdadm !
And there is much more - FAQs, recipes, etc!
Can you please add do the manual under 'SEE ALSO' a reference to /usr/share/doc/mdadm ?
thanks :-)
Signature · 1 line
Janek Kozicki |
Re: man mdadm - suggested correction.
Janek Kozicki wrote:
[]
Quoted 2 lines
Can you please add do the manual under 'SEE ALSO' a reference to
/usr/share/doc/mdadm?
/usr/share/doc/mdadm is Debian-specific (well.. not sure it's really Debian (or something derived from it) -- some other distros may use the same naming scheme, too). Other distributions may place the files into a different directory, or not ship them at all, or ship them in alternative package.
In any case, say, on Debian a user always knows that other misc. docs are in /usr/share/doc/$package - even if no other links are provided in the manpage. Users familiar with other distributions knows where/how to find other docs there.
/mjt
man mdadm - suggested correction.
In reply to Janek KozickiHello,
I did read 'man mdadm' from top to bottom, but I totally forgot to look into /usr/share/doc/mdadm !
And there is much more - FAQs, recipes, etc!
Can you please add to the manual under 'SEE ALSO' a reference to /usr/share/doc/mdadm ?
thanks :-)
Signature · 1 line
Janek Kozicki |
Re: man mdadm - suggested correction.
Janek Kozicki said: (by the date of Mon, 5 Nov 2007 11:58:15 +0100)
Quoted 2 lines
I did read 'man mdadm' from top to bottom, but I totally forgot to look into
/usr/share/doc/mdadm!
PS: this why I asked so much questions on this list ;-)
Signature · 1 line
Janek Kozicki |
Quoted 10 lines · Janek Kozicki
Hi,
I finished copying all data from old disc hdc to my shiny new RAID5 array (
/dev/hda3/dev/sda3missing). Next step is to create a partition on hdc and add it to the array. And so I did this:# mdadm --add /dev/md1 /dev/hdc3But then I had a problem - the
/dev/hdc3was a spare, it didn't resync automatically:
Strange. That is exactly how I always do it and it always just worked. mdadm should start syncing on any spare as soon as a disk fails or you add the spare to a degraded array afaik. No special "start now" interaction needed.
MfG
Goswin
Goswin von Brederlow said: (by the date of Wed, 07 Nov 2007 10:17:51 +0100)
Quoted 4 lines
Strange. That is exactly how I always do it and it always just worked. mdadm should start syncing on any spare as soon as a disk fails or you add the spare to a degraded array afaik. No special "start now" interaction needed.
Thanks for your confirmation. I cannot explain this behaviour - I just started using mdadm. If anybody here wants, I can remove the drive and add this again, to see if I can duplicate this "bug" (?). If so - then tell me what debug information you do need and I will give it to you.
Anyway, it seems that this command
mdadm --assemble --update=resync /dev/md1 /dev/hda3 /dev/sda3 /dev/hdc3
worked, becasue mdadm -D /dev/md1 says that array is in "State : active" (not degraded).
best regards
Signature · 1 line
Janek Kozicki |
Quoted 9 lines · Janek Kozicki
Goswin von Brederlow said: (by the date of Wed, 07 Nov 2007 10:17:51 +0100)
Quoted 4 lines
Strange. That is exactly how I always do it and it always just worked. mdadm should start syncing on any spare as soon as a disk fails or you add the spare to a degraded array afaik. No special "start now" interaction needed.
Quoted 5 lines
Thanks for your confirmation. I cannot explain this behaviour - I just started using mdadm. If anybody here wants, I can remove the drive and add this again, to see if I can duplicate this "bug" (?). If so - then tell me what debug information you do need and I will give it to you.
What kernel and RAID level is this?
If it's RAID 1, I seem to recall there was a relatively recently fixed bug for this.
Regards,
Richard
Richard Scobie said: (by the date of Thu, 08 Nov 2007 08:13:19 +1300)
Quoted 4 lines
What kernel and RAID level is this?
If it's RAID 1, I seem to recall there was a relatively recently fixed bug for this.
debian etch, stock install
Linux 2.6.18-5-k7 #1 SMP i686 GNU/Linux
The problem was with was RAID 5.
But also I have RAID 1 there, and after --add the drives automatically resynced.
Signature · 1 line
Janek Kozicki |
Quoted 8 lines · Janek Kozicki
Richard Scobie said: (by the date of Thu, 08 Nov 2007 08:13:19 +1300)
Quoted 3 lines
What kernel and RAID level is this?
If it's RAID 1, I seem to recall there was a relatively recently fixed bug for this.
Quoted 8 lines
debian etch, stock install
Linux 2.6.18-5-k7 #1 SMP i686 GNU/LinuxThe problem was with was RAID 5.
But also I have RAID 1 there, and after --add the drives automatically resynced.
OK.
This was the bug I was thinking of:
http://marc.info/?l=linux-raid&m=116003247912732&w=2
Regards,
Richard
Richard Scobie said: (by the date of Fri, 09 Nov 2007 10:32:08 +1300)
Quoted 3 lines
This was the bug I was thinking of:
This bug says that it only with mdadm 1.x:
"If a drive is added to a raid1 using older tools
(mdadm-1.x or raidtools) then it will be included in the array without any resync happening."
But I have here:
# mdadm --version mdadm - v2.5.6 - 9 November 2006
maybe I stumbled on another bug?
Signature · 1 line
Janek Kozicki |