Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Feb 2001 17:04:29 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Makoto MATSUSHITA <matusita@ics.es.osaka-u.ac.jp>
Cc:        current@FreeBSD.org, phk@FreeBSD.org
Subject:   RE: doFS.sh should obey MDDEVICE if available
Message-ID:  <XFMail.010203170429.jhb@FreeBSD.org>
In-Reply-To: <20010204095241U.matusita@ics.es.osaka-u.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org> -- 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 majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010203170429.jhb>