Re: Are quotas possbile on md filesystems?

2005-03-05 Thread Bob Johnson
On Saturday 05 March 2005 08:33 pm, stheg olloydson wrote:
> --- Bob Johnson <[EMAIL PROTECTED]> wrote:
> > On Friday 04 March 2005 11:39 pm, you wrote:
> > > it was said:
>
> 
>
> > Argh!  I ought to quit posting things until I've had at least two
> > good
> > nights of sleep.  bin/57641 does appear to me to address the same
> > issue as my
> >
> > patch:
> > >http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/57641
> >
> > Sorry for the confusion.
> >
> > - Bob
>
> Apparently the bin/57641 patch was committed after 5.3-Release. I just
> cvsup'd my source, and I still do not see it. Maybe it will be in 5.4.
> Better late than never :P


The PR status is "open" which suggests that it has not been committed yet.  It 
certainly wasn't in the code I worked from, which was CVSUPed on Feb 25th or 
so.  It probably needs someone to post an update to the PR or to email the 
responsible person to remind him that it hasn't been committed yet.  So I 
just did.  It might still be possible to get it into 5.4.


- Bob

>
> Regards,
>
> stheg
>
>
>
>
>
> __
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
>
> !DSPAM:422a5e0c954621604418475!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Are quotas possbile on md filesystems?

2005-03-05 Thread stheg olloydson

--- Bob Johnson <[EMAIL PROTECTED]> wrote:

> On Friday 04 March 2005 11:39 pm, you wrote:
> > it was said:



> Argh!  I ought to quit posting things until I've had at least two
> good 
> nights of sleep.  bin/57641 does appear to me to address the same
> issue as my 
> patch:
> 
> >http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/57641 
> 
> Sorry for the confusion.
> 
> - Bob
> 

Apparently the bin/57641 patch was committed after 5.3-Release. I just
cvsup'd my source, and I still do not see it. Maybe it will be in 5.4.
Better late than never :P

Regards,

stheg





__ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Are quotas possbile on md filesystems?

2005-03-04 Thread Bob Johnson
On Friday 04 March 2005 11:39 pm, stheg olloydson wrote:
> it was said:
>
> 
>
> >So after all that, NOW I notice that there is already a published
> >patch for this:
> >
> >http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/74105
> >
> >Oh, well.  It was an amusing exercise.
> >
> >- Bob
>
> Eh? Maybe _I_ am the one missing something. The link you provided goes
> to a patch for IPX. The only PRs for mdmfs I find are bin/57641, 64153,
> and 66763, and those do not seem to deal with this issue. I think you
> ought to submit your patch because mdmfs' default behavior is a
> problem.
>

Argh!  I'm going to stop posting until I've had some sleep.  But it does 
appear to me that bin/57641 addresses the same issue as my patch:

http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/57641

- Bob

> Regards,
>
> stheg
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Are quotas possbile on md filesystems?

2005-03-04 Thread stheg olloydson
it was said:


>So after all that, NOW I notice that there is already a published 
>patch for this:
>
>http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/74105
>
>Oh, well.  It was an amusing exercise.
>
>- Bob

Eh? Maybe _I_ am the one missing something. The link you provided goes
to a patch for IPX. The only PRs for mdmfs I find are bin/57641, 64153,
and 66763, and those do not seem to deal with this issue. I think you
ought to submit your patch because mdmfs' default behavior is a
problem.

Regards,

stheg  




__ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Are quotas possbile on md filesystems?

2005-03-04 Thread Bob Johnson
On Friday 04 March 2005 10:33 pm, Bob Johnson wrote:
> On Friday 04 March 2005 05:56 pm, Bob Johnson wrote:
> > Michael R. Wayne wrote:
> > >On Thu, 03 Mar 2005 16:53:19 -0500, Michael R. Wayne
> > > <[EMAIL PROTECTED]>
>
> wrote:
> > >>Is it possible to use quotas on file-backed md filesystems
> > >>on 5.3?  I was guessing that a line in fstab like:
> > >
> > >OK, I see the error in my ways.  My goal is to use file-based
> > >filesystems that are preserved acoss boots.  vnconfig says to
> > >use mdconfig, the handbook suggests that the method I used is
> > >correct.  But everything is cleared on reboot, which is not
> > >what I was looking for.
> >
> > It appears that it always formats a new filesystem because that's what
> > mount_mfs did, and mdmfs is a replacement for mount_mfs.  I agree
> > with you that that should not be the default behavior for a file-backed
> > (vnode) disk, so I wrote a little patch to fix that:
>
> [patch omitted]
>

So after all that, NOW I notice that there is already a published 
patch for this:

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/74105

Oh, well.  It was an amusing exercise.

- Bob
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Are quotas possbile on md filesystems?

2005-03-04 Thread Bob Johnson
On Friday 04 March 2005 05:56 pm, Bob Johnson wrote:
> Michael R. Wayne wrote:
> >On Thu, 03 Mar 2005 16:53:19 -0500, Michael R. Wayne <[EMAIL PROTECTED]> 
wrote:
> >>Is it possible to use quotas on file-backed md filesystems
> >>on 5.3?  I was guessing that a line in fstab like:
> >
> >OK, I see the error in my ways.  My goal is to use file-based
> >filesystems that are preserved acoss boots.  vnconfig says to
> >use mdconfig, the handbook suggests that the method I used is
> >correct.  But everything is cleared on reboot, which is not
> >what I was looking for.
>
> It appears that it always formats a new filesystem because that's what
> mount_mfs did, and mdmfs is a replacement for mount_mfs.  I agree
> with you that that should not be the default behavior for a file-backed
> (vnode) disk, so I wrote a little patch to fix that:
>
[patch omitted]

>
> >So, what IS the correct way to create and use file-based file
> >systems?
>

The patch I provided defaulted to NOT formatting the 
filesystem when used with the -F option.  This is the 
opposite of the normal behavior, creating the risk of 
a /etc/fstab that assumes that the filesystem will not 
be formatted being used with a new release that will format 
it by default, thus destroying the filesystem.  That 
would be very very bad.

So here is a new patch that modifies mdmfs / mount_mfs 
to behave as it does now, except that it will not format 
the filesystem before mounting if you supply the -A 
(mount "as-is") option.  Thus, to use /etc/fstab to mount 
a file-backed filesystem without reformatting the filesystem, 
put something like this in /etc/fstab

/dev/md3  /mnt  mfs  rw,-A,-F /home/bob/mdfile,noauto  0  0

So, here is a patch to add this to the original mdmfs, 
as well as a patch to the man page.

=
--- mdmfs.c 2005/03/05 01:45:00 1.1
+++ mdmfs.c 2005/03/05 03:09:17
@@ -32,6 +32,7 @@

 #include 
 __FBSDID("$FreeBSD: src/sbin/mdmfs/mdmfs.c,v 1.20 2004/05/17 07:07:20 ru Exp 
$"
);
+/*$Id: mdmfs.c,v 1.5 2005/03/05 03:09:10 bobj Exp bobj $*/

 #include 
 #include 
@@ -89,7 +90,7 @@
*mount_arg;
enum md_types mdtype;   /* The type of our memory disk. */
bool have_mdtype;
-   bool detach, softdep, autounit;
+   bool detach, softdep, autounit, want_newfs;
char *mtpoint, *unitstr;
char *p;
int ch;
@@ -100,6 +101,7 @@
detach = true;
softdep = true;
autounit = false;
+   want_newfs=true;
have_mdtype = false;
mdname = MD_NAME;
mdnamelen = strlen(mdname);
@@ -119,8 +121,11 @@
compat = true;

while ((ch = getopt(argc, argv,
-   "a:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1)
+   "Aa:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:Ss:Uv:w:X")) != -1)
switch (ch) {
+   case 'A':
+   want_newfs=false;
+   break;
case 'a':
argappend(&newfs_arg, "-a %s", optarg);
break;
@@ -268,7 +273,8 @@
do_mdconfig_attach_au(mdconfig_arg, mdtype);
else
do_mdconfig_attach(mdconfig_arg, mdtype);
-   do_newfs(newfs_arg);
+   if (want_newfs)
+   do_newfs(newfs_arg);
do_mount(mount_arg, mtpoint);
do_mtptsetup(mtpoint, &mi);

@@ -665,13 +671,13 @@
name = "mdmfs";
if (!compat)
fprintf(stderr,
-"usage: %s [-DLlMNSUX] [-a maxcontig [-b block-size] [-c cylinders]\n"
+"usage: %s [-ADLlMNSUX] [-a maxcontig [-b block-size] [-c cylinders]\n"
 "\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
 "\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
 "\t[-o mount-options] [-p permissions] [-s size] [-w user:group]\n"
 "\tmd-device mount-point\n", name);
fprintf(stderr,
-"usage: %s -C [-lNU] [-a maxcontig] [-b block-size] [-c cylinders]\n"
+"usage: %s -C [-AlNU] [-a maxcontig] [-b block-size] [-c cylinders]\n"
 "\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
 "\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
 "\t[-o mount-options] [-s size] md-device mount-point\n", name);
=
--- mdmfs.8 2005/03/05 01:46:09 1.1
+++ mdmfs.8 2005/03/05 03:08:38
@@ -24,6 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/sbin/mdmfs/mdmfs.8,v 1.20 2004/05/17 08:35:41 ru Exp $
+.\" $Id: mdmfs.8,v 1.3 2005/03/05 03:08:21 bobj Exp bobj $
 .\"
 .Dd February 26, 2004
 .Dt MDMFS 8
@@ -36,7 +37,7 @@
 driver
 .Sh SYNOPSIS
 .Nm
-.Op Fl DLlMNSUX
+.Op Fl ADLlMNSUX
 .Op Fl a Ar maxcontig
 .Op Fl b Ar block-size
 .Op Fl c Ar cylinders
@@ -57,7 +58,7 @@
 .Ar mount-point
 .Nm
 .Fl C
-.Op Fl lNU
+.Op Fl AlNUu
 .Op Fl a Ar maxcontig
 .Op Fl b Ar block-size
 .Op Fl c Ar cylinders
@@ -122,6 +123,12 @@
 .Xr mount_mfs 8
 for the same thing.
 .Bl -tag -width indent
+.It Fl A
+Mount filesystem as-is. Do not use newfs to format th

Re: Are quotas possbile on md filesystems?

2005-03-04 Thread Bob Johnson
Michael R. Wayne wrote:
On Thu, 03 Mar 2005 16:53:19 -0500, Michael R. Wayne <[EMAIL PROTECTED]> wrote:
 

Is it possible to use quotas on file-backed md filesystems
on 5.3?  I was guessing that a line in fstab like:
   

OK, I see the error in my ways.  My goal is to use file-based
filesystems that are preserved acoss boots.  vnconfig says to
use mdconfig, the handbook suggests that the method I used is 
correct.  But everything is cleared on reboot, which is not 
what I was looking for.

 

It appears that it always formats a new filesystem because that's what
mount_mfs did, and mdmfs is a replacement for mount_mfs.  I agree
with you that that should not be the default behavior for a file-backed
(vnode) disk, so I wrote a little patch to fix that:
===
--- mdmfs.c 2005/03/04 21:09:50 1.1
+++ mdmfs.c 2005/03/04 22:04:54
@@ -32,6 +32,7 @@
#include 
__FBSDID("$FreeBSD: src/sbin/mdmfs/mdmfs.c,v 1.20 2004/05/17 07:07:20 
ru Exp $");
+/*$Id: mdmfs.c,v 1.5 2005/03/04 22:04:47 bobj Exp bobj $*/

#include 
#include 
@@ -89,7 +90,7 @@
   *mount_arg;
   enum md_types mdtype;   /* The type of our memory disk. */
   bool have_mdtype;
-   bool detach, softdep, autounit;
+   bool detach, softdep, autounit, want_newfs;
   char *mtpoint, *unitstr;
   char *p;
   int ch;
@@ -100,6 +101,7 @@
   detach = true;
   softdep = true;
   autounit = false;
+   want_newfs = true;
   have_mdtype = false;
   mdname = MD_NAME;
   mdnamelen = strlen(mdname);
@@ -119,10 +121,10 @@
   compat = true;
   while ((ch = getopt(argc, argv,
-   "a:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1)
+   "a:b:Cc:Dd:e:F:f:hi:LlMm:Nn:O:o:p:Ss:Uuv:w:X")) != -1)
   switch (ch) {
   case 'a':
-   argappend(&newfs_arg, "-a %s", optarg);
+   argappend(&newfs_arg, "-a %s", optarg);
   break;
   case 'b':
   argappend(&newfs_arg, "-b %s", optarg);
@@ -151,6 +153,7 @@
   usage();
   mdtype = MD_VNODE;
   have_mdtype = true;
+   want_newfs = false;
   argappend(&mdconfig_arg, "-f %s", optarg);
   break;
   case 'f':
@@ -213,6 +216,9 @@
   case 'U':
   softdep = true;
   break;
+   case 'u':
+   want_newfs = true;
+   break;
   case 'v':
   argappend(&newfs_arg, "-O %s", optarg);
   break;
@@ -268,7 +274,8 @@
   do_mdconfig_attach_au(mdconfig_arg, mdtype);
   else
   do_mdconfig_attach(mdconfig_arg, mdtype);
-   do_newfs(newfs_arg);
+   if (want_newfs)
+   do_newfs(newfs_arg);
   do_mount(mount_arg, mtpoint);
   do_mtptsetup(mtpoint, &mi);
@@ -666,7 +673,7 @@
   if (!compat)
   fprintf(stderr,
"usage: %s [-DLlMNSUX] [-a maxcontig [-b block-size] [-c cylinders]\n"
-"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n"
+"\t[-d rotdelay] [-e maxbpg] [-F file [-u]] [-f frag-size] [-i bytes]\n"
"\t[-m percent-free] [-n rotational-positions] [-O optimization]\n"
"\t[-o mount-options] [-p permissions] [-s size] [-w user:group]\n"
"\tmd-device mount-point\n", name);

So, what IS the correct way to create and use file-based file
systems? 

 

Apply the patch above, then something in /etc/fstab like the following will
not reformat the filesystem:
/dev/md3   /mnt   mfs   rw,-F/vnodes/fileimage,noauto   0   0
If you want it to reformat the filesystem as the old mount_mfs did
(or at least, as the old man pages say it did), then use something like
/dev/md3   /mnt   mfs   rw,-F/vnodes/fileimage,-u,noauto   0   0
Note that -u MUST follow -F on the command line to have any effect.
This breaks compatibility with the old mount_newfs.  I guess I should
have used to opposite sense for "-u".  Which still would have broken
compatibility, but not as much.  This means that if this patch ever
makes it into a FreeBSD distribution, it is likely to default to formatting
rather than not formatting.  This will lead to a nasty surprise if you
aren't expecting it.  In other words, don't use this patch unless you
are desperately seeking a solution to a problem that makes it worth
the risk.  Don't blame me when some future change in behavior
deletes your important filesystem.
And, can I put quotas on them?
 

Don't know, but probably.
If applying a patch is a mystery to you, try (assuming you have the
full source installed) something that approximates this:
# cd /usr/src/sbin/mdmfs
# patch < /path/to/patch.file
# make
# make install
If you want to be thorough, apply the following patch to fix the
man page as well:
===
--- mdmfs.8 2005/03/04 22:06:21 1

Re: Are quotas possbile on md filesystems?

2005-03-04 Thread Michael R. Wayne
On Thu, 03 Mar 2005 16:53:19 -0500, Michael R. Wayne <[EMAIL PROTECTED]> wrote:
> 
> Is it possible to use quotas on file-backed md filesystems
> on 5.3?  I was guessing that a line in fstab like:

OK, I see the error in my ways.  My goal is to use file-based
filesystems that are preserved acoss boots.  vnconfig says to
use mdconfig, the handbook suggests that the method I used is 
correct.  But everything is cleared on reboot, which is not 
what I was looking for.

So, what IS the correct way to create and use file-based file
systems? 

And, can I put quotas on them?

/\/\ \/\/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Are quotas possbile on md filesystems?

2005-03-03 Thread Michael R. Wayne

Is it possible to use quotas on file-backed md filesystems
on 5.3?  I was guessing that a line in fstab like:

md  /home  mfs rw,-F/vnodes/home,nosuid,nodev,noexec,userquota  2 0

would work but it's not.  Can I get a working example?

/\/\ \/\/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"