problem hot-adding spare / internal bitmap problem?

Started by Mikael Abrahamsson on Jul 29, 2012 · 4 messages from 2 authors · Last reply Jul 30, 2012

open the first message on its own page

Message details and related content
Hi,

I'm having trouble hot-adding a spare to my raid6, this is on an ubuntu 12.04 amd64 box:

swmike@ub:~$ uname -a
Linux ub 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:25:57 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
swmike@ub:~$ mdadm -V
mdadm - v3.2.3 - 23rd December 2011

swmike@ub:~$ sudo mdadm --zero-superblock /dev/sdj
swmike@ub:~$ sudo mdadm --verbose --manage /dev/md0 --add /dev/sdj
swmike@ub:~$ sudo mdadm --verbose --manage /dev/md0 --fail /dev/sdj
mdadm: set device faulty failed for /dev/sdj:  No such device
swmike@ub:~$ sudo mdadm --examine /dev/sdj
/dev/sdj:
         Magic : a92b4efc
       Version : 1.2
   Feature Map : 0x1
    Array UUID : 7eda4927:254c1b6e:f3c3144a:9f4159d2
          Name : swmike-htpc2:0
 Creation Time : Thu Mar 19 16:32:38 2009
    Raid Level : raid6
  Raid Devices : 9

Avail Dev Size : 3907028864 (1863.02 GiB 2000.40 GB)
    Array Size : 27349202048 (13041.12 GiB 14002.79 GB)
   Data Offset : 304 sectors
  Super Offset : 8 sectors
         State : clean
   Device UUID : 755bac53:47bd845d:88c649aa:28a6596b

Internal Bitmap : 2 sectors from superblock
   Update Time : Sat Jul 28 15:22:04 2012
      Checksum : eec07f07 - correct
        Events : 0

        Layout : left-symmetric
    Chunk Size : 64K

130 more lines

Message details and related content
Hi,
write(4,
"bitm\4\0\0\0~\332I'%L\33n\363\303\24J\237AY\322\267\252J\0\0\0\0\0"...,
2560) = -1 EINVAL (Invalid argument)
This mdadm version has a problem of opening the device with O_DIRECT,
but then using an unaligned buffer for write().
Your strace doesn't contain the open() command for fd=4, so please
look earlier in your strace to confirm the O_DIRECT part. Also,
confirm that this write that returns EINVAL uses an unaligned buffer.

Once you confirmed these, grab mdadm 3.2.4 or the following commit:
6ef8905 super1: make aread/awrite always use an aligned buffer.

Thanks,
Alex.
Message details and related content
On Sun, 29 Jul 2012, Alexander Lyakas wrote:
Once you confirmed these, grab mdadm 3.2.4 or the following commit: 6ef8905 super1: make aread/awrite always use an aligned buffer.
I found their proposed update to 3.2.5 at:

https://launchpad.net/ubuntu/+source/mdadm/3.2.5-1ubuntu0.1/+build/3682539

I have downloaded it, but it seems it cannot remove the bitmap file now:

swmike@ub:~/mdadm$ sudo mdadm -V
mdadm - v3.2.5 - 18th May 2012
swmike@ub:~/mdadm$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
md0 : active raid6 sdj[15](S) sdk[13] sdg[11] sdh[14] sdi[10] sde[12] sdd[9] sdc[2] sdb[6] sdf[7]
      13674601024 blocks super 1.2 level 6, 64k chunk, algorithm 2 [9/9] [UUUUUUUUU]
      [============>........]  check = 60.4% (1180025928/1953514432) finish=1760.2min speed=7323K/sec
      bitmap: 0/466 pages [0KB], 2048KB chunk, file: /boot/md0-bitmap

unused devices: <none>
swmike@ub:~/mdadm$ sudo mdadm --grow /dev/md0 --bitmap=none
mdadm: failed to remove bitmap /boot/md0-bitmap

Is that because there is a check in progress?

-- 
Mikael Abrahamsson    email: swmike@swm.pp.se
Message details and related content
On Sun, 29 Jul 2012, Mikael Abrahamsson wrote:
Is that because there is a check in progress?
It seems it was:

[145714.150155] md: md0: data-check done.
[145738.648201] md0: bitmap file is out of date (0 < 4893404) -- forcing full recovery
[145738.648209] created bitmap (15 pages) for device md0
[145738.648223] md0: bitmap file is out of date, doing full recovery
[145738.665780] md0: bitmap initialized from disk: read 1/1 pages, set 29809 of 29809 bits
swmike@ub:~/mdadm$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid1] [raid10]
md0 : active raid6 sdj[15](S) sdk[13] sdg[11] sdh[14] sdi[10] sde[12] sdd[9] sdc[2] sdb[6] sdf[7]
      13674601024 blocks super 1.2 level 6, 64k chunk, algorithm 2 [9/9] [UUUUUUUUU]
      bitmap: 0/15 pages [0KB], 65536KB chunk

unused devices: <none>

I now successfully added sdj as spare and removed the bitmap file and enabled internal bitmap.

Thanks for the answer. Now I'm going to find out how to communicate with the mdadm package maintainer(s) in ubuntu and inform them that the proposed fixed package indeed does help with this issue.

Thanks!

-- 
Mikael Abrahamsson    email: swmike@swm.pp.se
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help