Skip to contentSkip to conversation

mdadm failed to remove internal bitmap

DISCUSSION gary 2 participants 4 messages Feb 13, 2015 – Feb 16, 2015 MD RAID

lore
Share & tools
lore

gary

author
#0 lore raw

Hi,

I used v3.3.1 mdadm to do some test for bitmap, but when switch bitmap from internal to none, the output shows fail info about remove internal bitmap, is it just a warning? Since the bitmap seems to be cleared, and it doesn't show with v3.2.6 mdadm with the same steps.

linux:~ # mdadm --create md0 --raid-devices=2 --level=mirror --assume-clean /dev/vdb /dev/vdc
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md0 started.
linux:~ # cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 vdc[1] vdb[0]

      523712 blocks super 1.2 [2/2] [UU]

unused devices: <none>
linux:~ # mdadm --grow --bitmap=internal /dev/md127 linux:~ # cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 vdc[1] vdb[0]

      523712 blocks super 1.2 [2/2] [UU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>
linux:~ # mdadm --grow --bitmap=none /dev/md127
mdadm: failed to remove internal bitmap.
linux:~ # cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 vdc[1] vdb[0]

      523712 blocks super 1.2 [2/2] [UU]

unused devices: <none>

Thanks,
Gary

#1 lore raw
Quoted 38 lines · On Fri, 13 Feb 2015 17:46:46 +0800 gary <[email protected]> wrote:

Hi,

I used v3.3.1 mdadm to do some test for bitmap, but when switch bitmap from internal to none, the output shows fail info about remove internal bitmap, is it
just a warning? Since the bitmap seems to be cleared, and it doesn't show with
v3.2.6 mdadm with the same steps.

linux:~ # mdadm --create md0 --raid-devices=2 --level=mirror --assume-clean /dev/vdb /dev/vdc
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md0 started.
linux:~ # cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 vdc[1] vdb[0]

       523712 blocks super 1.2 [2/2] [UU]

unused devices: <none>
linux:~ # mdadm --grow --bitmap=internal /dev/md127 linux:~ # cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 vdc[1] vdb[0]

       523712 blocks super 1.2 [2/2] [UU]
       bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>
linux:~ # mdadm --grow --bitmap=none /dev/md127
mdadm: failed to remove internal bitmap.
linux:~ # cat /proc/mdstat
Personalities : [raid1]
md127 : active raid1 vdc[1] vdb[0]

Quoted 4 lines
       523712 blocks super 1.2 [2/2] [UU]

unused devices: <none>

I cannot reproduce this.
What kernel are you running?

Please use "strace" on mdadm in a case where it fails, and post the result.

NeilBrown

author
#2 lore raw

Hi Neil,

Please check the followings.

Quoted 1 line

What kernel are you running?

linux48:~ # uname -r
3.12.32-33-default

And 3.12.28-4-default kernel is ok.

Quoted 1 line

Please use "strace" on mdadm in a case where it fails, and post the result.

linux48:~ # strace mdadm --grow --bitmap=none /dev/md127
execve("/sbin/mdadm", ["mdadm", "--grow", "--bitmap=none", "/dev/md127"], [/* 58 vars */]) = 0
brk(0) = 0xfe8000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcab07ad000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=93919, ...}) = 0
mmap(NULL, 93919, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fcab0796000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\34\2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1978611, ...}) = 0
mmap(NULL, 3832352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fcab01e6000 mprotect(0x7fcab0384000, 2097152, PROT_NONE) = 0

mmap(0x7fcab0584000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19e000) = 0x7fcab0584000
mmap(0x7fcab058a000, 14880, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fcab058a000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcab0795000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcab0794000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fcab0793000

arch_prctl(ARCH_SET_FS, 0x7fcab0794700) = 0
mprotect(0x7fcab0584000, 16384, PROT_READ) = 0
mprotect(0x677000, 4096, PROT_READ) = 0
mprotect(0x7fcab07ae000, 4096, PROT_READ) = 0

munmap(0x7fcab0796000, 93919)           = 0
getpid()                                = 6000
brk(0)                                  = 0xfe8000
brk(0x1009000)                          = 0x1009000
open("/dev/md127", O_RDWR)              = 3

fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 127), ...}) = 0
ioctl(3, RAID_VERSION, 0x7fff2e10d160) = 0
open("/etc/mdadm.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/mdadm/mdadm.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/mdadm.conf.d", O_RDONLY) = -1 ENOENT (No such file or directory)
uname({sys="Linux", node="linux48", ...}) = 0
geteuid() = 0
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 127), ...}) = 0
ioctl(3, RAID_VERSION, 0x7fff2e10c060) = 0
ioctl(3, GET_BITMAP_FILE, 0x7fff2e10c1f0) = 0
ioctl(3, GET_ARRAY_INFO, 0x7fff2e10c1a0) = 0
ioctl(3, SET_ARRAY_INFO, 0x7fff2e10c1a0) = -1 EINVAL (Invalid argument) write(2, "mdadm: failed to remove internal"..., 41mdadm: failed to remove internal bitmap. ) = 41
exit_group(1) = ?
+++ exited with 1 +++

Thanks,
gary

#3 lore raw
Quoted 6 lines · On Mon, 16 Feb 2015 14:42:20 +0800 gary <[email protected]> wrote:

Hi Neil,

Please check the followings.

Quoted 1 line

What kernel are you running?

linux48:~ # uname -r
3.12.32-33-default

Does this have any patches on top of 3.12.32 that touch md.c ?

Quoted 2 lines

And 3.12.28-4-default kernel is ok.

There are no differences between 3.12.28 and 3.12.32 that could affect this.

Quoted 6 lines

ioctl(3, RAID_VERSION, 0x7fff2e10c060) = 0
ioctl(3, GET_BITMAP_FILE, 0x7fff2e10c1f0) = 0
ioctl(3, GET_ARRAY_INFO, 0x7fff2e10c1a0) = 0
ioctl(3, SET_ARRAY_INFO, 0x7fff2e10c1a0) = -1 EINVAL (Invalid argument) write(2, "mdadm: failed to remove internal"..., 41mdadm: failed to remove internal bitmap.

EINVAL from SET_ARRAY_INFO almost certainly comes from update_array_info(). It can happen if:
- more than 1 thing needs to be updated - seems unlikely
- pers->quiesce is NULL - not possible for raid1.
- mddev->bitmap->storage.file is not NULL. Seems unlikely.

I suggest you look at the code you are actually running, and possible add some printks to tell you where it is failing.

NeilBrown