[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#273182: a possible fix/workaround



Thanks to Marco d'Itri's followup to #294404, I have implemented
a fix to the problem that mdadm and udev don't like each other. It
is a slighly modified version from Marco's suggestion. Patch
attached.

The idea is that mdadm checks whether /dev/md0 or /dev/md/0 is
present and if not, that it creates it with MAKEDEV. If /dev/.udevdb
is a directory, it first exports WRITE_ON_UDEV to make MAKEDEV
actually write to /dev and not to /dev/.static/dev.

I have also undone vorlon's changes and added some code to ensure
that mdadm-raid gets called at S25 instead of S04. Separate patch
attached. Vorlon's patch included a change to config.c (see [0])
which I cannot figure out. Do you know what problem it tries to
solve? He describes it as:

  "tweaks mdadm --scan's behavior to prefer the in-kernel device
  names as listed in /proc/partitions if these are present as device
  nodes on the filesystem."

0. http://bugs.debian.org/cgi-bin/bugreport.cgi/mdadm-294404.diff?bug=294404&msg=60&att=1

This works so far. Now a new problem has arisen, which I am
investigating (gdb downloading right now). The device nodes are
properly created during the boot phase *before* mdadm is run.
However, mdadm fails to run with the -s flag:

  debian:/dev# mdadm -A -s
  md: md0 stopped.
  mdadm: no devices found for /dev/md0
  debian:/dev# ls -l /dev/md0
  brw-rw----  1 root disk 9, 0 2005-05-21 11:02 /dev/md0
  debian:/dev/# cat /etc/mdadm/mdadm.conf
  DEVICE partitions
  ARRAY /dev/md0 level=raid1 num-devices=2 UUID=68a1895a:3cae93a0:35e3b385:eb38616f
    devices=/dev/sda2,/dev/sda3

device nodes for /dev/sda{2,3} exist and /proc/partitions knows
about these partitions too.

Assembling the device manually works:

  debian:/dev# mdadm -A /dev/md0 /dev/sda[23]
  [...]

Note that /dev/md0 does not change (m/c time remain unchanged).
Since vorlon said that this is not surprising as the kernel would
actually register the device when called without -s, I tried to
remove the /dev/md0 device node: this causes the above command to
fail.

So, to recap:

  - device nodes are being created at the right point in time
  - manual assembly of raid devices works
  - automated assembly using /etc/mdadm/mdadm.conf does not work

Let's go, gdb.

Relevant straces:
  http://madduck.net/~madduck/scratch/mdadm.strace.bz2
  http://madduck.net/~madduck/scratch/mdadm-manual.strace.bz2

-- 
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, user, and author
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!
 
man muss noch chaos in sich haben
um einen tanzenden stern zu gebähren.
                                                -- friedrich nietzsche

Attachment: signature.asc
Description: Digital signature


Reply to: