On Monday December 15, jnelson-linux-raid@xxxxxxxxxxx wrote: > On Mon, Dec 15, 2008 at 3:11 PM, Neil Brown <neilb@xxxxxxx> wrote: > > On Monday December 15, jnelson-linux-raid@xxxxxxxxxxx wrote: > >> mdadm --incremental seems to behave differently for me between mdadm > >> 2.6.4 and 3.0 > >> > >> With 2.6.4, mdadm --incremental /dev/nbd0 does this: > >> > >> mdadm: /dev/nbd0 attached to /dev/md10 which is already active. > >> > >> With 3.0, it does this: > >> > >> mdadm: /dev/md10 is already in use. > >> > >> and does *not* add it to the array. > > > > Sounds like /var/run/mdadm/map is not correctly up-to-date. > > Does running > > mdadm -Ir > > > > make "mdadm -I /dev/nbd0" work properly again? > > > > Can you provide a sequence of steps which leads to the error message > > that you report? > > I have to reboot to make this happen. There is probably a less > invasive way.... but it's what I know works. > > First, an strace of mdadm --incremental (3.0): > > turnip:~ # strace -f -e trace=open mdadm --incremental /dev/nbd0 > open("/etc/ld.so.cache", O_RDONLY) = 3 > open("/lib64/libc.so.6", O_RDONLY) = 3 > open("/dev/urandom", O_RDONLY) = 3 > open("/etc/mdadm.conf", O_RDONLY) = 3 > open("/dev/nbd0", O_RDONLY|O_EXCL|O_DIRECT) = 3 > open("/var/run/mdadm/map.lock", O_RDWR|O_CREAT, 0600) = 3 > open("/var/run/mdadm/map", O_RDONLY) = -1 ENOENT (No such file or directory) > open("/var/run/mdadm.map", O_RDONLY) = -1 ENOENT (No such file or directory) That's the problem then. The array was started from initrd and any mdadm/map that was created would have got lost. Now it needs one to continue with assembly and cannot find one. I'll have to get it to do the "-Ir" thing automagically if mdadm/map does not exist. > open("/var/run/mdadm/map", O_RDONLY) = -1 ENOENT (No such file or directory) > open("/var/run/mdadm.map", O_RDONLY) = -1 ENOENT (No such file or directory) > open("/proc/mdstat", O_RDONLY) = 4 > mdadm: /dev/md11 is already in use. > turnip:~ # > > > Running (again, v3.0) mdadm --incremental --rebuild-map works rebuilds the map. > > Then using --incremental /dev/nbd0 works (but it's resyncing **again**). > > Does that help? So: yes it does - thanks. I've got some coding to do ;-) NeilBrown -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html