On 04-Feb-01 Makoto MATSUSHITA wrote:
> jhb> The current method always finds an unused device to use, so the
> jhb> old VNDEVICE-style hack is no longer needed.  There's no point to
> jhb> setting an explicit device to use.
> But I want to ensure that all used md(4) devices is unconfigured after
> it is used.
> Imagine you run 'make release' for your own release. If something is
> trouble in doFS.sh ('kernel size exceeds 1.44MB floppy size' is a
> typical example), make will exit without umounting /mnt and
> unconfigureing /dev/mdX, where X is dynamically allocated (and no way
> to know what X is outside of doFS.sh). If I can say 'doFS.sh, your md
> device number is X', it's obviously easy to umount /mnt and
> unconfigure md devices after the script runs.

If it is still mounted, you can see the device by just typing 'mount' to get a
list of mounted filesystems.  You will have something like:

/dev/md0 on /mnt (ufs, local)

Also, I think that this isn't the right fix to a bigger problem.  Instead, it
shouldn't be hard to get a list of configured devices out of mdconfig via an
ioctl on /dev/mdctl.  This would be the right fix, as it would fix the general
case problem you describe, not just one instance of it.  mdconfig wont' be able
to tell you what file it is attached to by filename, but it should be able to
ask /dev/mdctl for a list of devices and report at least the type of each
device (swap, file, etc.).


John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to