Skip to contentSkip to conversation

raid1 with 1.2 superblock never marked healthy?

DISCUSSION Janos Farkas 3 participants 6 messages Feb 19, 2006 – Feb 24, 2006 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi!

Recently, I've updated one raid1 array to version 1.2 superblocks, in the (apparently) misguided hope, that it's needed to use bitmaps for faster resync after failure.

In the process, I've stumbled across a few roadblocks.

First, I've been unable to find out, how to specify the bitmap file without hardcoding its name in a startup file. Up until now, there was only a generic "mdadm -As" doing all the work. The other problem, even if I run this by hand, specifying the bitmap file, the array always comes up degraded, regardless of any bitmap specified.

Granted, on reboot, some of the times may be because of unclean shutdowns, other times one of the component is marked as failed (F) in /proc/mdstat. After a remove/add, and waiting after the resync, all seems correct, but what irks me, is that mdadm -E always shows some components as failed even after a completely successful resync.

I *think* that seeing "Array State : uu 1 failed" after the resync implies that I have to endure the resync after the next reboot.

I remember stopping/starting the array correctly does a resync again, even without a reboot.

It also seems to me, mdadm does not really store the bitmap file in the superblock for some reason, and/or there is no way to update this field.

But what I find the most irksome, is that the array

Details follow, sorry for the lengthy dump, I'm not sure if anything is useless from this.

Kernel is 2.6.16-rc3, mdadm is 2.3.1.

One time when it's started degraded for no apparent reason:

10:21:20 lame kernel: md: md0 stopped.
10:21:20 lame kernel: md: bind<hda3>
10:21:20 lame kernel: md: bind<hdc3>
10:21:20 lame kernel: raid1: raid set md0 active with 1 out of 2 mirrors

Another time, which may result from a somehow unclean shutdown:

10:11:44 lame kernel: md: raid1 personality registered for level 1
10:11:44 lame kernel: md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
10:11:44 lame kernel: md: bitmap version 4.39
10:11:44 lame kernel: md: Skipping autodetection of RAID arrays. (raid=noautodetect)
10:11:44 lame kernel: md: md0 stopped.
10:11:44 lame kernel: md: bind<hda3>
10:11:44 lame kernel: md: bind<hdc3>
10:11:44 lame kernel: md: kicking non-fresh hda3 from array!
10:11:44 lame kernel: md: unbind<hda3>
10:11:44 lame kernel: md: export_rdev(hda3)
16:20:24 lame kernel: md: bind<hda3>
16:20:24 lame kernel: md: syncing RAID array md0
16:20:24 lame kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
16:20:24 lame kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction. 16:20:24 lame kernel: md: using 128k window, over a total of 17552232 blocks.
16:58:07 lame kernel: md: md0: sync done.

After the resync, however, the components do not get updated to show correctness?

------------------------

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 hda3[2] hdc3[1]
      17552232 blocks super 1.2 [2/2] [UU]

unused devices: <none>
------------------------

# mdadm -D /dev/md0; mdadm -E /dev/hd[ac]3
/dev/md0:
        Version : 01.02.03
  Creation Time : Wed Feb  8 21:24:33 2006
     Raid Level : raid1
     Array Size : 17552232 (16.74 GiB 17.97 GB)
    Device Size : unknown
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

Update Time : Sun Feb 19 17:12:09 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Name :
UUID : 4dd4...
Events : 467156

Number Major Minor RaidDevice State
2 3 3 0 active sync /dev/hda3
1 22 3 1 active sync /dev/hdc3
/dev/hda3:
Magic : a92b4efc
Version : 01
Feature Map : 0x0
Array UUID : 4dd4...
Name :
Creation Time : Wed Feb 8 21:24:33 2006
Raid Level : raid1
Raid Devices : 2

    Device Size : 35104472 (16.74 GiB 17.97 GB)
     Array Size : 35104464 (16.74 GiB 17.97 GB)
      Used Size : 35104464 (16.74 GiB 17.97 GB)
    Data Offset : 136 sectors

Super Offset : 8 sectors
State : active
Device UUID : aca9...

Update Time : Sun Feb 19 17:12:09 2006
Checksum : dd1ac0a1 - correct
Events : 467156

Array State : uu 1 failed
/dev/hdc3:
Magic : a92b4efc
Version : 01
Feature Map : 0x0
Array UUID : 4dd4...
Name :
Creation Time : Wed Feb 8 21:24:33 2006
Raid Level : raid1
Raid Devices : 2

    Device Size : 35104472 (16.74 GiB 17.97 GB)
     Array Size : 35104464 (16.74 GiB 17.97 GB)
      Used Size : 35104464 (16.74 GiB 17.97 GB)
    Data Offset : 136 sectors
   Super Offset : 8 sectors
          State : active
    Device UUID : 66d7...

    Update Time : Sun Feb 19 17:12:09 2006
       Checksum : d990f459 - correct
         Events : 467156

Array State : uU 1 failed
------------------------

#1 lore raw
Quoted 5 lines · On Sunday February 19, [email protected] wrote:

Hi!

Recently, I've updated one raid1 array to version 1.2 superblocks, in the (apparently) misguided hope, that it's needed to use bitmaps for faster resync after failure.

Bitmaps work with any superblock version. You only need 1.x for v.large arrays, or if you want to use the 'name' field. 1.0, 1.1, 1.2 only differ in where they put the superblock.

Quoted 2 lines

In the process, I've stumbled across a few roadblocks.

It happens.... thanks for reporting them.

Quoted 6 lines

First, I've been unable to find out, how to specify the bitmap file without hardcoding its name in a startup file. Up until now, there was only a generic "mdadm -As" doing all the work. The other problem, even if I run this by hand, specifying the bitmap file, the array always comes up degraded, regardless of any bitmap specified.

If you use an 'internal' bitmap (which is mirrored across all drives much like the superblock) then you don't need to specify a file name. However if you want the bitmap on a separate file, you have to have that name 'hard coded' in mdadm.conf (or similar).

Quoted 6 lines

Granted, on reboot, some of the times may be because of unclean shutdowns, other times one of the component is marked as failed (F) in /proc/mdstat. After a remove/add, and waiting after the resync, all seems correct, but what irks me, is that mdadm -E always shows some components as failed even after a completely successful resync.

Don't worry too much about "mdadm -E" reporting that there are some failed devices. It is a bit confusing and something I should tidy up at some stage...

Quoted 3 lines

I *think* that seeing "Array State : uu 1 failed" after the resync implies that I have to endure the resync after the next reboot.

This is actually a fairly odd thing to see.
A 'u' means that device is active (up?), but that it is some other device.
A 'U' means that device is active, and it is this devices. So you should only see 'uu' on a spare. But I assume this isn't a spare... weird.

Quoted 3 lines

I remember stopping/starting the array correctly does a resync again, even without a reboot.

Hmm... it seems to work for me... How exactly to you start it again.

Quoted 4 lines

It also seems to me, mdadm does not really store the bitmap file in the superblock for some reason, and/or there is no way to update this field.

No. mdadm does not record the name of the bitmap file in the superblock. Just like it does not record the names of component devices in the superblock.

Quoted 4 lines

Details follow, sorry for the lengthy dump, I'm not sure if anything is useless from this.

Quoted 8 lines

Kernel is 2.6.16-rc3, mdadm is 2.3.1.

One time when it's started degraded for no apparent reason:

10:21:20 lame kernel: md: md0 stopped.
10:21:20 lame kernel: md: bind<hda3>
10:21:20 lame kernel: md: bind<hdc3>
10:21:20 lame kernel: raid1: raid set md0 active with 1 out of 2 mirrors

It seems to think that one of these is a spare. Any idea why?

Quoted 23 lines

Another time, which may result from a somehow unclean shutdown:

10:11:44 lame kernel: md: raid1 personality registered for level 1
10:11:44 lame kernel: md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
10:11:44 lame kernel: md: bitmap version 4.39
10:11:44 lame kernel: md: Skipping autodetection of RAID arrays. (raid=noautodetect)
10:11:44 lame kernel: md: md0 stopped.
10:11:44 lame kernel: md: bind<hda3>
10:11:44 lame kernel: md: bind<hdc3>
10:11:44 lame kernel: md: kicking non-fresh hda3 from array!
10:11:44 lame kernel: md: unbind<hda3>
10:11:44 lame kernel: md: export_rdev(hda3)
16:20:24 lame kernel: md: bind<hda3>
16:20:24 lame kernel: md: syncing RAID array md0
16:20:24 lame kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
16:20:24 lame kernel: md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reconstruction. 16:20:24 lame kernel: md: using 128k window, over a total of 17552232 blocks.
16:58:07 lame kernel: md: md0: sync done.

After the resync, however, the components do not get updated to show correctness?

Quoted 7 lines

------------------------

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 hda3[2] hdc3[1]
      17552232 blocks super 1.2 [2/2] [UU]

unused devices: <none>

Look correct to me.

Quoted 45 lines

------------------------

# mdadm -D /dev/md0; mdadm -E /dev/hd[ac]3
/dev/md0:
        Version : 01.02.03
  Creation Time : Wed Feb  8 21:24:33 2006
     Raid Level : raid1
     Array Size : 17552232 (16.74 GiB 17.97 GB)
    Device Size : unknown
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

Update Time : Sun Feb 19 17:12:09 2006
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Name :
UUID : 4dd4...
Events : 467156

Number Major Minor RaidDevice State
2 3 3 0 active sync /dev/hda3
1 22 3 1 active sync /dev/hdc3
/dev/hda3:
Magic : a92b4efc
Version : 01
Feature Map : 0x0
Array UUID : 4dd4...
Name :
Creation Time : Wed Feb 8 21:24:33 2006
Raid Level : raid1
Raid Devices : 2

    Device Size : 35104472 (16.74 GiB 17.97 GB)
     Array Size : 35104464 (16.74 GiB 17.97 GB)
      Used Size : 35104464 (16.74 GiB 17.97 GB)
    Data Offset : 136 sectors

Super Offset : 8 sectors
State : active
Device UUID : aca9...

Quoted 6 lines

Update Time : Sun Feb 19 17:12:09 2006
Checksum : dd1ac0a1 - correct
Events : 467156

Array State : uu 1 failed

Something is definitely wrong here... hda3 looks like a spare, but isn't.... I'll have a look and see what I can find out.

NeilBrown

#2 lore raw
Quoted 4 lines · Neil Brown

If you use an 'internal' bitmap (which is mirrored across all drives much like the superblock) then you don't need to specify a file name. However if you want the bitmap on a separate file, you have to have that name 'hard coded' in mdadm.conf (or similar).

I was under the impression that mdadm.conf is not extended for this :) That would be a nice place compared to /etc/rc.d/whatever..

I was considering using external bitmap only because I've been bitten a few times with journaling filesystems vs. cheap hard disks. I'm not sure if a few hard disks are a significant sample, but some of them started developing bad sectors where the journal is stored. I hoped that having an external bitmap would reduce the wear on the mirrored parts. This way, if the bitmap (even on the same hard disk) is getting flawed, probably both of the whole mirrors are intact enough for a last (additional) backup.

Quoted 3 lines
Quoted 2 lines

I remember stopping/starting the array correctly does a resync again, even without a reboot.

Hmm... it seems to work for me... How exactly to you start it again.

Oops, I did not mean resync, but that spare confusion stuff. When I do mdadm -S /dev/md0, and then mdadm -A /dev/md0, I get:
"raid1: raid set md0 active with 1 out of 2 mirrors"
And I have to -r /dev/hda3, -a /dev/hda3, and that results in another resync.

Quoted 3 lines

No. mdadm does not record the name of the bitmap file in the superblock. Just like it does not record the names of component devices in the superblock.

Would it be a bad idea (apart from someone having to do the work :)? (But probably a bit better would be doing it as the jfs/ext3 external journals store uuid connecting the journal with the device itself).

Quoted 3 lines
Quoted 1 line

Array State : uu 1 failed

Something is definitely wrong here... hda3 looks like a spare, but isn't.... I'll have a look and see what I can find out.

The only "unusual" thing is how it got set up, because on a semi-live system, I started with the magic "missing" component to create another half mirror while the previous one is running. "Unusual" because I never thought of it as a bad idea, but maybe somehow it did cause what I'm seeing.

The original command (then, trying to use bitmaps :) was:

# mdadm --create /dev/md1 --level 1 -n 2 -d 4 -e 1.2 \
  -b /etc/md/test1.bin --bitmap-chunk 64 missing /dev/hdc3

At some later time, I added /dev/hda3, which is the troubling "spare" now.

Janos

#3 lore raw

Hello Neil & All ,

Quoted 9 lines · Janos Farkas
Quoted 4 lines · Neil Brown

If you use an 'internal' bitmap (which is mirrored across all drives much like the superblock) then you don't need to specify a file name. However if you want the bitmap on a separate file, you have to have that name 'hard coded' in mdadm.conf (or similar).

I was under the impression that mdadm.conf is not extended for this :) That would be a nice place compared to /etc/rc.d/whatever..

Quoted 8 lines

I was considering using external bitmap only because I've been bitten a few times with journaling filesystems vs. cheap hard disks. I'm not sure if a few hard disks are a significant sample, but some of them started developing bad sectors where the journal is stored. I hoped that having an external bitmap would reduce the wear on the mirrored parts. This way, if the bitmap (even on the same hard disk) is getting flawed, probably both of the whole mirrors are intact enough for a last (additional) backup.

...snip...
How hard would it be for mdadm & md to allow use of both internal and external bitmaps ? And then mdadm be extended to do a compare of an external against a internal when the opertaor askes to do so . Soes this sound reasonable ? Thoughts ?
This is probably an edge case I guess . But it might save someones bacon if this functionality was available .
Tia , JimL

Signature · 6 lines
+------------------------------------------------------------------+
| James   W.   Laferriere | System    Techniques | Give me VMS     |
| Network        Engineer | 3542 Broken Yoke Dr. |  Give me Linux  |
| [email protected] | Billings , MT. 59105 |   only  on  AXP |
|  http://www.asteriskhelpdesk.com/cgi-bin/astlance/r.cgi?babydr   |
+------------------------------------------------------------------+
#4 lore raw
Quoted 4 lines · James W. Laferriere

How hard would it be for mdadm & md to allow use of both internal and external bitmaps ? And then mdadm be extended to do a compare of an external against a internal when the opertaor askes to do so . Soes this sound reasonable ? Thoughts ?

Can you explain a bit more what would it be useful? As I understand the concept (which may be quite different from the reality and/or implementation), the bitmap of the "most up-to-date" component is used to determine what updates the other component is missing.

(What to do in the case of multi-way, arbitrarily removed mirrors is above my head :)

In that scheme, I don't see any use of a bitmap which is not "connected" to any available sub-component.

Janos

#5 lore raw
In reply to Janos Farkas
Quoted 10 lines · Janos Farkas
Quoted 3 lines
Quoted 1 line

Array State : uu 1 failed

Something is definitely wrong here... hda3 looks like a spare, but isn't.... I'll have a look and see what I can find out.

The only "unusual" thing is how it got set up, because on a semi-live system, I started with the magic "missing" component to create another half mirror while the previous one is running. "Unusual" because I never thought of it as a bad idea, but maybe somehow it did cause what I'm seeing.

Quoted 4 lines

The original command (then, trying to use bitmaps :) was:

# mdadm --create /dev/md1 --level 1 -n 2 -d 4 -e 1.2 \
  -b /etc/md/test1.bin --bitmap-chunk 64 missing /dev/hdc3

As another attempt to fix it, I tried to fault/hotadd the hdc3 partition again:

# mdadm /dev/md0 -f /dev/hda3
{not saved this message}
# mdadm /dev/md0 -r /dev/hda3
mdadm: hot removed /dev/hda3
# mdadm --zero-superblock /dev/hda3
# mdadm /dev/md0 -a /dev/hda3
mdadm: added /dev/hda3

Resync started again, and after that finished, I saw this with -E:

| /dev/hda3:
| ...
|     Update Time : Fri Feb 24 08:57:41 2006
|        Checksum : 5c9262b - correct
|          Events : 671245
| 
|    Array State : uu 2 failed

| /dev/hdc3:
...

|     Update Time : Fri Feb 24 08:57:45 2006
|        Checksum : 31dda911 - correct
|          Events : 671247
| 
|    Array State : uu 2 failed

While md0 at this time was working without any problems, fearing that I would be greeted the next day that I have two failed spare devices, I took a big breath, and created another array with original superblocks:

# mdadm --create /dev/md1 \
   -n 2 --level 1 -b internal --bitmap-chunk 64 \
   /dev/hdc3 missing

Later, while resyncing, there was three line in mdadm -D for components, one active, one spare (this is probably the dummy "missing" drive), and one rebuilding. Maybe this is the case which in v1 superblocks somehow do not get updated correctly? With some (marked) failed devices, I still see weird numbers (and formatting) in mdadm -D, like:

Number Major Minor RaidDevice State
-1208301100 0 0 0 removed
1 3 3 1 active sync /dev/hda3

2 22 3 - faulty spare /dev/hdc3

Anyway, with some lvm/pvmove magic, I moved everything online from the "old" md0 to the "new" md1, stopped the old one, activated the mirror on the new one and it seems to work great ever since. And apparently I do have bitmaps at last. I'll try rebooting when I get home though :)

Janos