I should also mention (confess?) that the array I'm trying to stop is my /boot partition (on a running system booted from it!). Don't ask...
Yet I see nothing that would constitute an "open" file in it, unless the low level kernel boot stuff keeps something there "open"? If so, though, why can I umount it?
The source for mdadm --stop says:
216 /* Get EXCL access first. If this fails, then attempting 217 * to stop is probably a bad idea. 218 */ 219 close(fd); 220 fd = open(devname, O_RDONLY|O_EXCL); 221 if (fd < 0 || fd2devnum(fd) != devnum) { 222 if (fd >= 0) 223 close(fd); 224 fprintf(stderr, 225 Name ": Cannot get exclusive access to %s:" 226 " possibly it is still in use.\n", 227 devname); 228 return 1; 229 }
So it's failing to get O_RDONLY|O_EXCL open on /dev/md1.
Still would like to know why though.