Skip to contentSkip to conversation

Setting a buffer_heads 'real_device'

DISCUSSION Mario Vodisek 4 participants 9 messages Jul 10, 2002 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi,

I'm writing a virtual disk driver consisting of serveral real disks. Hence I've to map read/write requests for my virtual device to underlying
real devices, like md does so for RAID-Arrays.

So my question is how a virtual device driver (like 'md') manages the read/write
request associated with a virtual (md-) device to get data from a specific real
device within a 'block_read/block/write()' invokation !
I know that the buffer head-structure contains an entry for a virtual and a real
device, but i don't know when and in which proper way to set these components.

Somebody to help me ??

Mario Vodisek

begin:vcard
n:Vodisek;Mario
tel;fax:---
tel;home:0160/632 96 92
tel;work:---
x-mozilla-html:FALSE
org:University of Paderborn;AG Meyer auf der Heide - Theoretical computing - version:2.1
email;internet:[email protected]
title:research assistant
adr;quoted-printable:;;Liebfrauenweg 9=0D=0A ;33334 Gütersloh;;;Germany
x-mozilla-cpt:;-9984
fn:Mario Vodisek
end:vcard

#1 lore raw

Multiple disk failure - recover?

Hi!

I have (had) a three disk RAID5 array. One of the disks (sdb2) has failed, however, under circumstances, two of the diskes were kicked out of the array.

I tried re-assembling the array using 'mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2 /dev/sdb2', but it always takes the sdc2 & sdb2 as OK disks and sda2 as failed.

Of course, when the reconstruction hits the bad area on sdb2, it all fails again.

How can I tell mdadm that /dev/sda2 and /dev/sdc2 are the disks I want as 'good'!?

Thanks, D.

#2 lore raw

Re: Multiple disk failure - recover?

You don't say why two disks were kicked or when it happend so sdc may be out-of-whack a bit. Sounds like sdc got kicked first. So...I would do a bad-block scan on sdb2 so it can remap the bad section and re-build as you've been trying to do.

If you REALLY want to use sda and sdc just rebuild the array with --create and leave sdb out of it. You shouldn't lose much data if sdc is current.
----- Original Message -----
From: "Danilo Godec" <[email protected]>
To: <[email protected]>
Sent: Wednesday, July 10, 2002 9:10 AM
Subject: Multiple disk failure - recover?

Quoted 24 lines

Hi!

I have (had) a three disk RAID5 array. One of the disks (sdb2) has failed, however, under circumstances, two of the diskes were kicked out of the array.

I tried re-assembling the array using 'mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2 /dev/sdb2', but it always takes the sdc2 & sdb2 as OK disks and sda2 as failed.

Of course, when the reconstruction hits the bad area on sdb2, it all fails again.

How can I tell mdadm that /dev/sda2 and /dev/sdc2 are the disks I want as 'good'!?

Thanks, D.

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: Multiple disk failure - recover?

Quoted 5 lines · On Wednesday July 10, [email protected] wrote:

You don't say why two disks were kicked or when it happend so sdc may be out-of-whack a bit. Sounds like sdc got kicked first. So...I would do a bad-block scan on sdb2 so it can remap the bad section and re-build as you've been trying to do.

If you REALLY want to use sda and sdc just rebuild the array with --create and leave sdb out of it. You shouldn't lose much data if sdc is current.

Better still, do that --assemble and leave sdb out of it. i.e.

mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2

Then it will have to use a2 and c2.

NeilBrown

#8 lore raw

Re: Multiple disk failure - recover?

In reply to Mike Black
Quoted 2 lines · Mike Black

You don't say why two disks were kicked or when it happend so sdc may be out-of-whack a bit. Sounds like sdc got kicked first.

I'm not 100% sure, but I think either of sda or sdb was the first kicked... Dunno.

Quoted 2 lines

So...I would do a bad-block scan on sdb2 so it can remap the bad section and re-build as you've been trying to do.

What tool would you use? I think that linux' badblocks operates on the FS level... So it's useless on Software RAID5...

Quoted 3 lines

If you REALLY want to use sda and sdc just rebuild the array with --create and leave sdb out of it. You shouldn't lose much data if sdc is current.

I tried that and it simply ignores /dev/sda2...

I only need to recover as much data as possible. It's not that bad if I loose yesterdays stuff.

D.

#4 lore raw

Re: Multiple disk failure - recover?

In reply to Neil Brown
Quoted 3 lines · Neil Brown

mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2

Then it will have to use a2 and c2.

I tried that, but it refused to do it (something about 2/3 drives failed)!? Maybe my mdadm version is old (v1.0.0)?

D.

#5 lore raw

Re: Multiple disk failure - recover?

Quoted 8 lines · On Wednesday July 10, [email protected] wrote:
Quoted 3 lines · Neil Brown

mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2

Then it will have to use a2 and c2.

I tried that, but it refused to do it (something about 2/3 drives failed)!? Maybe my mdadm version is old (v1.0.0)?

Hmmm. Should work, but might need a "--run" as well...

Can you get me an exact error message, and maybe the output of
mdadm --examine /dev/sd[abc]2

NeilBrown

#6 lore raw

Re: Multiple disk failure - recover?

Quoted 10 lines · Neil Brown
Quoted 8 lines · On Wednesday July 10, [email protected] wrote:
Quoted 3 lines · Neil Brown

mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2

Then it will have to use a2 and c2.

I tried that, but it refused to do it (something about 2/3 drives failed)!? Maybe my mdadm version is old (v1.0.0)?

Quoted 7 lines

Hmmm. Should work, but might need a "--run" as well...

Can you get me an exact error message, and maybe the output of
mdadm --examine /dev/sd[abc]2

NeilBrown

OK, it's all attached. One file contains results of mdadm --examine, the other is what I get on the screen with mdadm --assemble (w/wo --run)...

D.

[root@lmq MDADM]# mdadm --assemble --force /dev/md1 /dev/sda2 /dev/sdc2
md: md1 stopped.
md: unbind<sdc2,0>
md: export_rdev(sdc2)
[events: 00000058]
md: bind<sdc2,1>
mdadm: /dev/md1 assembled from 1 drive - not enough to start it (use --run to insist).

[root@lmq MDADM]# mdadm --assemble --force /dev/md1 --run /dev/sda2 /dev/sdc2
md: md1 stopped.
md: unbind<sdc2,0>
md: export_rdev(sdc2)
[events: 00000058]
md: bind<sdc2,1>
md: sdc2's event counter: 00000058
md1: removing former faulty sdb2!
md1: max total readahead window set to 496k
md1: 2 data-disks, max readahead per data-disk: 248k
raid5: device sdc2 operational as raid disk 1
raid5: not enough operational devices for md1 (2/3 failed) RAID5 conf printout:
--- rd:3 wd:1 fd:2
disk 0, s:0, o:0, n:0 rd:0 us:1 dev:[dev 00:00]
disk 1, s:0, o:1, n:1 rd:1 us:1 dev:sdc2
disk 2, s:0, o:0, n:2 rd:2 us:1 dev:[dev 00:00]
raid5: failed to run raid set md1
md: pers->run() failed ...
md: md1 stopped.
md: unbind<sdc2,0>
md: export_rdev(sdc2)
mdadm: failed to RUN_ARRAY /dev/md1: Invalid argument

/dev/sda2:

          Magic : a92b4efc
        Version : 00.90.00
           UUID : d1b50184:535ff73c:48dba5c1:e94fc70e

Creation Time : Mon Jul 16 13:53:51 2001
Raid Level : raid5
Device Size : 17623232 (16.80 GiB 18.04 GB)
Raid Devices : 3
Total Devices : 4
Preferred Minor : 1

Update Time : Wed Jul 10 15:18:37 2002
State : dirty, no-errors
Active Devices : 2
Working Devices : 3
Failed Devices : 1
Spare Devices : 1
Checksum : 79f828e5 - correct
Events : 0.82

Layout : left-asymmetric
Chunk Size : 32K

Number Major Minor RaidDevice State

this     3       8        2        3        /dev/sda2
   0     0       8       18        0      active sync   /dev/sdb2
   1     1       8       34        1      active sync   /dev/sdc2
   2     2       0        0        2      faulty removed
   3     3       8        2        3        /dev/sda2

/dev/sdb2:

          Magic : a92b4efc
        Version : 00.90.00
           UUID : d1b50184:535ff73c:48dba5c1:e94fc70e

Creation Time : Mon Jul 16 13:53:51 2001
Raid Level : raid5
Device Size : 17623232 (16.80 GiB 18.04 GB)
Raid Devices : 3
Total Devices : 3
Preferred Minor : 1

Update Time : Wed Jul 10 15:36:39 2002
State : dirty, no-errors
Active Devices : 2
Working Devices : 2
Failed Devices : 1
Spare Devices : 0
Checksum : 79f82d2f - correct
Events : 0.86

Layout : left-asymmetric
Chunk Size : 32K

Number Major Minor RaidDevice State

this     0       8       18        0      active sync   /dev/sdb2
   0     0       8       18        0      active sync   /dev/sdb2
   1     1       8       34        1      active sync   /dev/sdc2
   2     2       0        0        2      faulty removed

/dev/sdc2:

          Magic : a92b4efc
        Version : 00.90.00
           UUID : d1b50184:535ff73c:48dba5c1:e94fc70e

Creation Time : Mon Jul 16 13:53:51 2001
Raid Level : raid5
Device Size : 17623232 (16.80 GiB 18.04 GB)
Raid Devices : 3
Total Devices : 3
Preferred Minor : 1

Update Time : Wed Jul 10 16:08:35 2002
State : clean, no-errors
Active Devices : 1
Working Devices : 1
Failed Devices : 2
Spare Devices : 0
Checksum : 79f834ba - correct
Events : 0.88

Layout : left-asymmetric
Chunk Size : 32K

Number Major Minor RaidDevice State

this     1       8       34        1      active sync   /dev/sdc2
   0     0       8       18        0      faulty   /dev/sdb2
   1     1       8       34        1      active sync   /dev/sdc2
   2     2       0        0        2      faulty removed
#7 lore raw

Re: Multiple disk failure - recover?

Quoted 2 lines · On Wednesday July 10, [email protected] wrote:

OK, it's all attached. One file contains results of mdadm --examine, the other is what I get on the screen with mdadm --assemble (w/wo

--run)...

Hmmm. Yes --force isn't doing all that it should do. I'll have to look into that.

You should be able to use create successfully.

If the original order was b2,c2,a2, which is what the --examine suggests, and you want to not use b2, then

mdadm --create /dev/md1 -l5 -c32 -n3 missing /dev/sdc2 /dev/sda2

should work. It will not start a rebuild so you can mount it read-only and if something was wrong, you can "mdadm --stop" and try again with a different arrangement of drives.

If b2 and c2 are really the most recent, as it appears, then you might want to use those:

  mdadm --create /dev/md1 -l5 -c32 -n3 /dev/sdb2 /dev/sdc2 missing

Again, this wont do a resync and as long as you don't touch the bad block on b2, you should be able to access data.

NeilBrown