Skip to contentSkip to conversation

Bug#409875: cannot setup device-mapper mapping ontop of /dev/md* device

DISCUSSION David Härdeman 3 participants 5 messages Feb 8, 2007 – Feb 9, 2007 18 messages not in the archive Device mapper

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw
Quoted 4 lines · Johannes Schlumberger

I built the packages and installed them.
The attached file contains the generated stderr stream (which looks a bit strange to me). Just to make shure, here is also the output generated from the command without the redirection.

The stderr stream is fine. When you run it without redirection, bash will helpfully mask the null characters that are printed (which is not done when they are redirected to a file).

However, everything looks ok after studying that file, the first two ioctl's are executed (i.e. the device-mapper version is checked and the "root" mapping name is reserved).

Then when it is time to pass the actual parameters for the mapping using the "reload" ioctl, everything goes south. I'm quickly running out of ideas what might cause this or what the best way to debug it would be.

So I'm CC:ing this mail to some different people with the hope that someone other than me can spot the error.

Quoting from previous mails:

Quoted 9 lines
[04:11:35][root@asso:/home/spjsschl]# cryptsetup -c aes -s 256 -d /dev/stdin
create root /dev/md0 < /key
Command failed: device-mapper: reload ioctl failed: Invalid argument
[04:12:57][root@asso:/home/spjsschl]# dmesg | tail -n 3
device-mapper: table: 253:2: crypt: Device lookup failed
device-mapper: ioctl: error adding target to table
device-mapper: ioctl: device doesn't appear to be in the dev hash table.
Quoted 4 lines
[22:28:31][root@asso:/tmp]# echo '0 10000 crypt aes-cbc-essiv:sha256 \
0123456789abcdef0123456789abcdef 0 /dev/md0 0' > map
[22:28:46][root@asso:/tmp]# dmsetup create root map
device-mapper: reload ioctl failed: Invalid argument Command failed

Executive summary:
dmsetup / cryptsetup both fail to create a mapping on top of a raid device (/dev/md0 in this case).

For much more details, see the bug report, any help appreciated:
http://bugs.debian.org/409875

Signature · 1 line
David Härdeman
#11 lore raw
Quoted 2 lines · David Härdeman

dmsetup / cryptsetup both fail to create a mapping on top of a raid device (/dev/md0 in this case).

I don't know where the error lies, but I created two loop devices loop0 and loop1, added them to a new RAID 1 md0 device, and ran cryptsetup on the resulting md0 successfully.

 bee:~# dmsetup  ls
 ...
 crypt0  (253, 6)
 bee:~# dmsetup table crypt0
 0 65408 crypt aes-cbc-plain
 42cfa211018ea492fdee45ac637b7972a0ad687380f9a6d0484900ad8cca2d8f 0 9:0
 0
 bee:~# mdadm --detail /dev/md0
 ...
    Number   Major   Minor   RaidDevice State
       0       7        0        0      active sync   /dev/loop0
       1       7        1        1      active sync   /dev/loop1
Signature · 1 line
Loïc Minier <[email protected]>
#12 lore raw

Bug#409875: [Pkg-cryptsetup-devel] Bug#409875: cannot setup device-mapper mapping ontop of /dev/md* device

Quoted 7 lines · Loic Minier
Quoted 2 lines · David Härdeman

dmsetup / cryptsetup both fail to create a mapping on top of a raid device (/dev/md0 in this case).

I don't know where the error lies, but I created two loop devices loop0 and loop1, added them to a new RAID 1 md0 device, and ran cryptsetup on the resulting md0 successfully.

Ditto. I've succesfully setup a crypto mapping on a raid1 device under qemu, which leads me to believe that it is something specific to Johannes setup.

So I'm hoping that someone will come up with some suggestions on how to troubleshoot it further on his machine.

(This is my last cross-post on this subject, I promise, please keep further discussions to the bug report address only - [email protected])

Signature · 7 lines
David Härdeman



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
#13 lore raw

Bug#409875: [Pkg-cryptsetup-devel] Bug#409875: cannot setup device-mapper mapping ontop of /dev/md* device

Quoted 11 lines · David Härdeman
Quoted 7 lines · David Härdeman
Quoted 2 lines

dmsetup / cryptsetup both fail to create a mapping on top of a raid device (/dev/md0 in this case).

I don't know where the error lies, but I created two loop devices loop0 and loop1, added them to a new RAID 1 md0 device, and ran cryptsetup on the resulting md0 successfully.

Ditto. I've succesfully setup a crypto mapping on a raid1 device under qemu, which leads me to believe that it is something specific to Johannes setup.

Warning: It is not safe on all kernels out there, due to kernel bugs. See recent flow of patches from the md maintainer in LKML. I don't know if they all landed on 2.6.16.y and 2.6.19.y and 2.6.20 yet.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#22 lore raw

Bug#409875: [Pkg-cryptsetup-devel] Bug#409875: bug #409875

reassign 409875 libdevmapper1.02
retitle 409875 libdevmapper should provide more helpful error messages severity 409875 minor
thanks

Quoted 5 lines · Johannes Schlumberger
Quoted 1 line

Thanks, this looks mighty suspicious...it looks like /dev/md0 is mounted as your root partition by the initramfs? Please provide me with "ls -al /dev/root" and "cat /proc/cmdline" as well as the contents of your grub or lilo config file.

I am so sorry for stealing yours and other persons time like this. I had root=/dev/md0 in my menu.lst and / as /dev/hdd6 in my fstab. I have to say I am strongly embarassed.

No problem, it happends to all of us. There still is a bug here though...the error messages from libdevmapper are obtuse to say the least.

libdevmapper explained that /dev/md0 is in use with the message:
"Command failed: device-mapper: reload ioctl failed: Invalid argument"

That is a bug in my book.

I'll reassign this bug to libdevmapper (and retitle it accordingly).

I'll also CC all people that I've bugged earlier so that they know that this issue is no more.

Quoted 1 line

Thank you a lot for figuring this out and all your patience.

That's ok, you just owe me a beer.

Signature · 1 line
David Härdeman