From owner-freebsd-fs Fri Jun 9 18:38: 9 2000 Delivered-To: freebsd-fs@freebsd.org Received: from lafontaine.cybercable.fr (lafontaine.cybercable.fr [212.198.0.202]) by hub.freebsd.org (Postfix) with SMTP id 3B18937C65A for ; Fri, 9 Jun 2000 18:37:55 -0700 (PDT) (envelope-from root@gits.dyndns.org) Received: (qmail 2457402 invoked from network); 10 Jun 2000 01:37:49 -0000 Received: from r224m65.cybercable.tm.fr (HELO gits.dyndns.org) ([195.132.224.65]) (envelope-sender ) by lafontaine.cybercable.fr (qmail-ldap-1.03) with SMTP for ; 10 Jun 2000 01:37:49 -0000 Received: (from root@localhost) by gits.dyndns.org (8.9.3/8.9.3) id DAA02649; Thu, 8 Jun 2000 03:24:08 +0200 (CEST) (envelope-from root) From: Cyrille Lefevre Posted-Date: Thu, 8 Jun 2000 03:24:08 +0200 (CEST) Message-Id: <200006080124.DAA02649@gits.dyndns.org> Subject: quota/mount commands inconsistency To: freebsd-fs@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Date: Thu, 8 Jun 2000 03:24:08 +0200 (CEST) Cc: peter@FreeBSD.ORG Reply-To: clefevre@citeweb.net Organization: ACME X-Face: V|+c;4!|B?E%BE^{E6);aI.[<97Zd*>^#%Y5Cxv;%Y[PT-LW3;A:fRrJ8+^k"e7@+30g0YD0*^^3jgyShN7o?a]C la*Zv'5NA,=963bM%J^o]C X-Mailer: ELM [version 2.4ME+ PL77 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, recently, I have tried to setup quotas as usual. the first things I tries where the "rq" option then the "quota" option. ok, the "quota" option isn't supported under FreeBSD, as well as the "rq" option while the later is a little documented in fstab(5) : #define FSTAB_RQ "rq" /* read/write with quotas */ so, I use the FreeBSD "userquota" and "groupquota" options. here is my configuration (/disk0 is my fallback root partition): # egrep 'disk|\B/\B' /etc/fstab /dev/ad0s3 /disk0 ufs rw,userquota,groupquota,noauto 1 1 /dev/da0s1a / ufs rw,userquota,groupquota 1 1 /dev/da1s1c /disk2 ufs rw,userquota,groupquota 1 2 /dev/da2s1a /disk1 ufs rw,userquota,groupquota 1 2 /dev/da3s1a /disk4 ufs rw,userquota,groupquota 1 2 # df -k Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/da0s1a 1904559 1255135 497060 72% / /dev/da1s1c 2031922 1372446 496923 73% /disk2 /dev/da2s1a 1904559 1662507 89688 95% /disk1 /dev/da3s1a 1904559 1751524 671 100% /disk4 as I already says, the "rq" option seems to no be supported any more while mounting an ufs filesystem and the userquota and groupquota options aren't checked as well to turn quota on while an ufs filesystem is mounted. you have to turn on quota manually using quotaon. huh! # mount -o rq /dev/ad0s3a /disk0 mount: -o rq: option not supported (well) # mount -v /disk0 /dev/ad0s3 on /disk0 (ufs, local, soft-updates, writes: sync 2 async 0, reads: s ync 1 async 0) (humm... quota are not enabled at mount time!) # mount | grep /disk1 /dev/da2s1a on /disk1 (ufs, local, with quotas, writes: sync 34 async 110, reads: sync 43 async 5) (while there are at boot time) # cat /tmp/c.c #include #include int main () { char *path = "/disk0"; struct statfs buf; if (statfs (path, &buf) < 0) { perror ("statfs"); return (1); } printf ("%s: %s", path, (buf.f_flags & MNT_RDONLY) ? "ro" : "rw"); /* ufs stuffs */ if (buf.f_flags & MNT_SYNCHRONOUS) printf (",%s", "sync"); if (buf.f_flags & MNT_NOEXEC) printf (",%s", "noexec"); if (buf.f_flags & MNT_NOSUID) printf (",%s", "nosuid"); if (buf.f_flags & MNT_NODEV) printf (",%s", "nodev"); if (buf.f_flags & MNT_UNION) printf (",%s", "union"); if (buf.f_flags & MNT_ASYNC) printf (",%s", "async"); if (buf.f_flags & MNT_NOATIME) printf (",%s", "noatime"); if (buf.f_flags & MNT_NOCLUSTERR) printf (",%s", "noclusterr"); if (buf.f_flags & MNT_NOCLUSTERW) printf (",%s", "noclusterw"); if (buf.f_flags & MNT_NOSYMFOLLOW) printf (",%s", "nosymfollow"); if (buf.f_flags & MNT_SUIDDIR) printf (",%s", "suiddir"); if (buf.f_flags & MNT_SOFTDEP) printf (",%s", "soft-updates"); /* misc stuffs */ if (buf.f_flags & MNT_LOCAL) printf (",%s", "local"); if (buf.f_flags & MNT_QUOTA) printf (",%s", "quota"); if (buf.f_flags & MNT_ROOTFS) printf (",%s", "rootfs"); if (buf.f_flags & MNT_USER) printf (",%s", "user"); if (buf.f_flags & MNT_IGNORE) printf (",%s", "ignore"); /* nfs stuffs */ if (buf.f_flags & MNT_EXPORTED) { printf (" nfs: %s", (buf.f_flags & MNT_EXRDONLY) ? "ro" : "rw"); if (buf.f_flags & MNT_DEFEXPORTED) printf (",%s", "world"); if (buf.f_flags & MNT_EXPORTANON) printf (",%s", "maproot"); if (buf.f_flags & MNT_EXKERB) printf (",%s", "kerb"); if (buf.f_flags & MNT_EXPUBLIC) printf (",%s", "webnfs"); } printf ("\n"); return (0); } # make /tmp/c cc -O -pipe /tmp/c.c -o /tmp/c # /tmp/c /disk0: rw,soft-updates,local # quotaon -a (oops, panic! checking for core dump...savecore: no core dump) (reboot, then same things until quotaon -a) # quotaon /disk0 # mount | grep /disk0 /dev/da0s1a on / (ufs, local, with quotas, soft-updates, writes: sync 173 async 2939, reads: sync 1779 async 180) (ok... quota are now enabled) # /tmp/c /disk0: rw,soft-updates,local,quota # umount /disk0 (goto first mount :) also, if a filesystem isn't mounted at boot time and quotacheck is requested, quota files are created w/ hole in the mount point of that filesystem. other quota commands just create an empty file. so, quotacheck lacks to check if the filesystem is mounted before to do anything as well as every other quota commands. # quotacheck -a (doesn't complain about unmounted /disk0 which is ok) # ls -l /disk0 total 80 -rw-r----- 1 root operator 2097120 Jun 5 22:09 quota.group -rw-r----- 1 root operator 2097120 Jun 5 22:09 quota.user kernel panic seems to arrive when multiple quotaon -a are done and/or doing quotaoff -a, then quotaon -a. questions are here : why did you get rid of the "rq" option ? if the "userquota" and "groupquota" options are not given, but "rq" is, isn't it possible to use the same behaviour than other systems, which is to turn on quota at mount time and not at boot time and defaulting to userquota to /disk0/quotas in my case ? of course, more control needs to be done in every quota commands such as, don't create a quota file if the filesystem isn't mounted. and mount needs to be completed to activate quotas at mount time. so, I am right to make these modifications and more if needed, but before, I want to be sure I'm not wrong somewhere ? and before to send a bug-report, I'm asking you. PS : there is a lot of quota PRs which are not assigned right now. Regards, Cyrille Lefevre. -- home: mailto:clefevre@citeweb.net work: mailto:Cyrille.Lefevre@edf.fr To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message