Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Feb 2001 20:22:41 -0800
From:      Dima Dorfman <dima@unixfreak.org>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        mi@aldan.algebra.com, deischen@FreeBSD.ORG, hackers@freebsd.org
Subject:   Re: mount_md (was: mdconfig config file (was: cvs commit: src/sys/i386/conf GENERIC))
Message-ID:  <20010203042241.0A02C3E02@bazooka.unixfreak.org>
In-Reply-To: Message from Matt Dillon <dillon@earth.backplane.com>  of "Fri, 02 Feb 2001 12:55:11 PST." <200102022055.f12KtBL98916@earth.backplane.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
[ cvs-(all|commiters) --> -hackers ]

> :<snip>
> :> 
> :>     (this whole thing is predicated on someone writing a mount_md wrapper
> :>     for MD that mimics the options mount_mfs accepts, for compatibility).
> :
> :I'll do it.  Would it be safe to assume that it's acceptable to write
> :a C program to parse the arguments, build command lines to
> :appropriately invoke disklabel, newfs, maybe tunefs, and mount, then
> :call system(3) to execute them?
> :
> :					Dima Dorfman
> :					dima@unixfreak.org
> 
>     Yes, though preferably I'd fork/exec the sub-programs (and use 
>     absolute paths) rather then use system(), because the mount program
>     will be running during booting and its important to have it use as
>     few system resources as possible in case the system is screwed up.
>     We don't want it exec'ing /bin/sh.

Point taken.  I kind of figured system() was a little evil; that's why
I asked.

I've written the majority of the code.  You can find it at:
http://www.unixfreak.org/~dima/home/mount_md.c.  It is mostly
functional.  It accepts just about all of the arguments that mount_mfs
does, plus a few others.  It has the ability to create vnode, swap,
and malloc -backed disks.  It's not terribly well-documented (I'll
write up a man page if it's decided that this is acceptable), but most
of the options are easily explained by looking at a few lines of code.

Some thoughts:

  - If you want softupdates, you need to specify the -S flag.  Should
    softupdates be the default?

  - To suppress the output of disklabel/newfs/etc., it closes fds 0-2.  Is
    this evil?  Should I devise another method of doing this (something
    like opening /dev/null and dup2'ing that fd to 0-2)?

  - Should there be an option to make use of md's autounit feature?  I
    don't think it will be very hard to implement, but I don't know how
    useful it would be.

I think that's it.  Comments?  Suggestions?

Thanks in advance

					Dima Dorfman
					dima@unixfreak.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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