Shell How do I silence or remove a stale md-device?

Pretty complex scenario but let's give it a try:
I'm trying to improve my custom FreeBSD live system that boots from USB. The system is based on the mfsroot filesystem and able to keep on running without any physical storage device present. This works because mfsroot is a memory disk as root-storage device.
This system contains various C-programs that use an image on the USB-stick that is partitioned as FAT for permanent storage of a small amount of program data. This introduces my problem: when the USB-stick is detached, the md device loaded from it gets (obviously) in unresponsive state and syslogd is going up to 80% cpu because of the repetitive message g_vfs_done():md6[WRITE(offset=159142400. I'm looking for a way to stop this md-device. I already can mount something else over it but then the errors continue anyway.
How do I end a md-device with state "busy" because the physical device is lost?
(With this, assuming the unpredicable situation. The device just disappears with unknown cause)
 
Back
Top