Skip to contentSkip to conversation

quick Q re raid reconstruction

DISCUSSION Eyal Lebedinsky 2 participants 6 messages Dec 1, 2005 MD RAID

lore
Share & tools
lore
#0 lore raw

I have (had) a 4 disk RAID5 /dev/sd[abcd]1.

sda went bad (really, bad sectors) and is being replaced, hope to get a replacement tomorrow.

While the array was degraded (but running) sdd failed (controller trouble) and was marked as failed. The array went down (naturally). I am rather sure that sdd is healthy - see examine below.

Right now /dev/sd[bcd] are seen as sd[abc] until I install the missing disk.

I wish to bring the array up (degraded). Whatever I do mdadm refuses to do so

	mdadm --assemble --force /dev/sd{a,b,c}1

should it recognise the array as degraded but good and start it?

Q1) What is the correct command to bring these three up as
degraded?

Q2) When I get the fourth disk, how do I bring the array up
ensuring that the good disks (sd[bcd]) are marked as such and the fresh one (sda) is reconstructed (rather than one of the good ones).

In the past in cases where I trusted all four to be good (again, controller trouble would fail multiple disks) I would just --build on top of the array and a would not care which one is being reconstructed.

I assume that the below data does not reflect modified superblocks due to the attempted --force because the date reflects the failure event.

# mdadm --examine /dev/sd*1
/dev/sda1:
          Magic : a92b4efc
        Version : 00.90.02
           UUID : 54069710:f9f9ab5b:ae89479a:d7c1852e
  Creation Time : Tue Sep 13 00:42:04 2005
     Raid Level : raid5
   Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0

Update Time : Sun Nov 27 15:29:01 2005
State : clean
Active Devices : 2
Working Devices : 3
Failed Devices : 2
Spare Devices : 1
Checksum : 16d99bd5 - correct
Events : 0.492477

Layout : left-symmetric
Chunk Size : 256K

Number Major Minor RaidDevice State
this 1 8 17 1 active sync /dev/.static/dev/sdb1

   0     0       0        0        0      removed
   1     1       8       17        1      active sync   /dev/.static/dev/sdb1
   2     2      22        1        2      active sync   /dev/.static/dev/hdc1
   3     3       0        0        3      faulty removed
   4     4       8        1        4      faulty   /dev/.static/dev/sda1
/dev/sdb1:
          Magic : a92b4efc
        Version : 00.90.02
           UUID : 54069710:f9f9ab5b:ae89479a:d7c1852e

Creation Time : Tue Sep 13 00:42:04 2005
Raid Level : raid5
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0

Update Time : Sun Nov 27 15:29:01 2005
State : clean
Active Devices : 2
Working Devices : 3
Failed Devices : 2
Spare Devices : 1
Checksum : 16d99bd5 - correct
Events : 0.492477

Layout : left-symmetric
Chunk Size : 256K

Number Major Minor RaidDevice State
this 2 22 1 2 active sync /dev/.static/dev/hdc1

   0     0       0        0        0      removed
   1     1       8       17        1      active sync   /dev/.static/dev/sdb1
   2     2      22        1        2      active sync   /dev/.static/dev/hdc1
   3     3       0        0        3      faulty removed
   4     4       8        1        4      faulty   /dev/.static/dev/sda1
/dev/sdc1:
          Magic : a92b4efc
        Version : 00.90.02
           UUID : 54069710:f9f9ab5b:ae89479a:d7c1852e

Creation Time : Tue Sep 13 00:42:04 2005
Raid Level : raid5
Raid Devices : 4
Total Devices : 4
Preferred Minor : 0

Update Time : Sun Nov 27 15:29:01 2005
State : clean
Active Devices : 2
Working Devices : 3
Failed Devices : 2
Spare Devices : 1
Checksum : 16d99c17 - correct
Events : 0.492477

Layout : left-symmetric
Chunk Size : 256K

Number Major Minor RaidDevice State
this 5 22 65 5 spare /dev/.static/dev/hdd1

   0     0       0        0        0      removed
   1     1       8       17        1      active sync   /dev/.static/dev/sdb1
   2     2      22        1        2      active sync   /dev/.static/dev/hdc1
   3     3       0        0        3      faulty removed
   4     4       8        1        4      faulty   /dev/.static/dev/sda1
Signature · 2 lines
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>
	attach .zip as .dat
#1 lore raw
Quoted 1 line · Eyal Lebedinsky

I have (had) a 4 disk RAID5 /dev/sd[abcd]1.

[trim]

By this evening this will become urgent, so if anyone can reply then please do.

To bring it up in degraded mode, can I do a --create and tell it to use sd[abc] and mark sdd as failed? I can then force --run. An --assemble with '--failed /dev/sdd1' was not happy because it could not see sdd (naturally).

With the new disk (sda) added, can I safely do

	mdadm --assemble /dev/md0 /dev/sd[bcd]1 --fail /dev/sda1

and maybe --force or --run to bring it up?

TIA

Signature · 2 lines
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>
	attach .zip as .dat
#2 lore raw
In reply to Eyal Lebedinsky
Quoted 12 lines · On Thursday December 1, [email protected] wrote:

I have (had) a 4 disk RAID5 /dev/sd[abcd]1.

sda went bad (really, bad sectors) and is being replaced, hope to get a replacement tomorrow.

While the array was degraded (but running) sdd failed (controller trouble) and was marked as failed. The array went down (naturally). I am rather sure that sdd is healthy - see examine below.

Right now /dev/sd[bcd] are seen as sd[abc] until I install the missing disk.

Quoted 7 lines

I wish to bring the array up (degraded). Whatever I do mdadm refuses to do so

	mdadm --assemble --force /dev/sd{a,b,c}1

should it recognise the array as degraded but good and start it?

Q1) What is the correct command to bring these three up as
degraded?

  mdadm --assemble --force /dev/mdX /dev/sd[abc]1

However this won't work with the superblocks you have. So

  mdadm --create /dev/mdX -l5 -c256 -n4 missing /dev/sda /dev/sdb /dev/sdc
Quoted 5 lines

Q2) When I get the fourth disk, how do I bring the array up
ensuring that the good disks (sd[bcd]) are marked as such and the fresh one (sda) is reconstructed (rather than one of the good ones).

As above, then
mdadm /dev/mdX --add /dev/newdisk

NeilBrown

#3 lore raw
Quoted 9 lines · Neil Brown
Quoted 2 lines

Q1) What is the correct command to bring these three up as
degraded?

  mdadm --assemble --force /dev/mdX /dev/sd[abc]1

However this won't work with the superblocks you have. So

  mdadm --create /dev/mdX -l5 -c256 -n4 missing /dev/sda /dev/sdb /dev/sdc

I do not see 'missing' the the mdadm manpage, but maybe Debian is too far behind?

# mdadm --version
mdadm - v1.9.0 - 04 February 2005

Should I use 2.1 (is it safe to upgrade to it)?

I built it anyway and I do not see 'missing' listed in

	mdadm --create --help

Reading the new mdadm.man I can see what .missing' does, good.

I got it up (fsck now running), thanks a lot.

Signature · 2 lines
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>
	attach .zip as .dat
#4 lore raw
Quoted 5 lines · On Friday December 2, [email protected] wrote:
Quoted 4 lines · Neil Brown
Quoted 2 lines

Q1) What is the correct command to bring these three up as
degraded?

Quoted 8 lines
Quoted 5 lines
  mdadm --assemble --force /dev/mdX /dev/sd[abc]1

However this won't work with the superblocks you have. So

  mdadm --create /dev/mdX -l5 -c256 -n4 missing /dev/sda /dev/sdb /dev/sdc

I do not see 'missing' the the mdadm manpage, but maybe Debian is too far behind?

It is in the section on "CREATE MODE"

To create a "degraded" array in which some devices are missing, simply give the word "missing" in place of a device name. This will cause mdadm to leave the corresponding slot in the array empty. For a RAID4 or RAID5 array at most one slot can be "missing"; for a RAID6 array at most two slots. For a RAID1 array, only one real device needs to be given. All of the others can be "missing".

Quoted 3 lines
# mdadm --version
mdadm - v1.9.0 - 04 February 2005

The section I quoted is from the man page for 1.12.0, but that text certainly predates 1.9.0.

Quoted 2 lines

Should I use 2.1 (is it safe to upgrade to it)?

You don't need to, but you can. It is safe to upgrade.

Quoted 3 lines

I built it anyway and I do not see 'missing' listed in

	mdadm --create --help

I do.

$ /sbin/mdadm --create --help
Usage:  mdadm --create device -chunk=X --level=Y --raid-devices=Z devices

This usage will initialise a new md array, associate some
devices with it, and activate the array. In order to create an
array with some devices missing, use the special word 'missing' in

                                                        ^^^^^^^

place of the relevant device name.

Quoted 4 lines

Reading the new mdadm.man I can see what .missing' does, good.

I got it up (fsck now running), thanks a lot.

Good to hear.

NeilBrown

Quoted 4 lines
Signature · 3 lines
-- 
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>
	attach .zip as .dat
#5 lore raw
Quoted 29 lines · Neil Brown
Quoted 6 lines · On Friday December 2, [email protected] wrote:
Quoted 4 lines · Neil Brown
Quoted 2 lines

Q1) What is the correct command to bring these three up as
degraded?

Quoted 8 lines
Quoted 5 lines

mdadm --assemble --force /dev/mdX /dev/sd[abc]1

However this won't work with the superblocks you have. So

mdadm --create /dev/mdX -l5 -c256 -n4 missing /dev/sda /dev/sdb /dev/sdc

I do not see 'missing' the the mdadm manpage, but maybe Debian is too far behind?

It is in the section on "CREATE MODE"

To create a "degraded" array in which some devices are missing, simply give the word "missing" in place of a device name. This will cause mdadm to leave the corresponding slot in the array empty. For a RAID4 or RAID5 array at most one slot can be "missing"; for a RAID6 array at most two slots. For a RAID1 array, only one real device needs to be given. All of the others can be "missing".

Quoted 6 lines
Quoted 2 lines
# mdadm --version
mdadm - v1.9.0 - 04 February 2005

The section I quoted is from the man page for 1.12.0, but that text certainly predates 1.9.0.

Here is the Debian (stable) relevant 'man mdadm' section:

CREATE MODE
Usage: mdadm --create device --chunk=X --level=Y
--raid-disks=Z devices

This usage will initialise a new md array, associate some devices with it, and activate the array.

As devices are added, they are checked to see if they contain raid superblocks or filesystems. They are also check to see if the variance in device size exceeds 1%.

If any discrepancy is found, the array will not automatically be run, though the presence of a --run can override this caution.

The General Management options that are valid with --create are:

--run insist of running the array even if some devices look like they
might be in use.

--readonly
start the array readonly - not supported yet.

Maybe they have their own "special" man page?

Quoted 5 lines
Quoted 2 lines

I built it anyway and I do not see 'missing' listed in

	mdadm --create --help

I do.

Quoted 8 lines
$ /sbin/mdadm --create --help
Usage:  mdadm --create device -chunk=X --level=Y --raid-devices=Z devices

This usage will initialise a new md array, associate some
devices with it, and activate the array. In order to create an
array with some devices missing, use the special word 'missing' in

                                                        ^^^^^^^

place of the relevant device name.

True, I missed it :-(

fsck finished clean too, thanks again.

Signature · 2 lines
Eyal Lebedinsky ([email protected]) <http://samba.org/eyal/>
	attach .zip as .dat