.br
.B lfs quotacheck [-ug] <filesystem>
.br
-.B lfs quotachown [-i] <filesystem>
-.br
.B lfs quotaon [-ugf] <filesystem>
.br
.B lfs quotaoff [-ug] <filesystem>
.br
-.B lfs quotainv [-ug] [-f] <filesystem>
-.br
.B lfs setquota <-u|--user|-g|--group> <uname|uid|gname|gid>
\fB[--block-softlimit <block-softlimit>]
\fB[--block-hardlimit <block-hardlimit>]
.B quota -t <-u|-g> <filesystem>
To display block and inode grace times for user (-u) or group (-g) quotas
.TP
-.B quotachown
-To change files' owner and group on OSTs of the specified filesystem
-.TP
-.B quotacheck [-ugf] <filesystem>
-To scan the specified filesystem for disk usage, and create or update quota files. Options specify quota for users (-u) groups (-g) and force (-f)
-.TP
-.B quotaon [-ugf] <filesystem>
-To turn filesystem quotas on. Options specify quota for users (-u) groups (-g) and force (-f)
+.B quotacheck [-ugf] <filesystem> (deprecated as of 2.4.0)
+To scan the specified filesystem for disk usage, and create or update quota files. Options specify quota for users (-u) groups (-g) and force (-f). Not useful anymore with servers >= 2.4.0 since space accounting is always turned on.
.TP
-.B quotaoff [-ugf] <filesystem>
-To turn filesystem quotas off. Options specify quota for users (-u) groups (-g) and force (-f)
+.B quotaon [-ugf] <filesystem> (deprecated as of 2.4.0)
+To turn filesystem quotas on. Options specify quota for users (-u) groups (-g) and force (-f). Not used anymore in lustre 2.4.0 where quota enforcement must be enabled via conf_param (e.g. lctl conf_param ${FSNAME}.quota.<ost|mdt>=<u|g|ug>)
.TP
-.B quotainv [-ug] [-f] <filesystem>
-Clear quota files (administrative quota files if used without -f, operational quota files otherwise), all of their quota entries, for (-u) users or (-g) groups; after quotainv one must use quotacheck before using quotas. DO NOT USE THIS COMMAND UNLESS YOU REALLY KNOW WHAT IT DOES. IT IS MAINLY FOR INTERNAL PURPOSES.
+.B quotaoff [-ugf] <filesystem> (deprecated as of 2.4.0)
+To turn filesystem quotas off. Options specify quota for users (-u) groups (-g) and force (-f). Not used anymore in lustre 2.4.0 where quota enforcement can be turned off (for inode or block) by running the following command on the MGS: lctl conf_param ${FSNAME}.quota.<ost|mdt>=""
.TP
.B setquota <-u|-g> <uname>|<uid>|<gname>|<gid> [--block-softlimit <block-softlimit>] [--block-hardlimit <block-hardlimit>] [--inode-softlimit <inode-softlimit>] [--inode-hardlimit <inode-hardlimit>] <filesystem>
To set filesystem quotas for users or groups. Limits can be specified with -b, -k, -m, -g, -t, -p suffixes which specify units of 1, 2^10, 2^20, 2^30, 2^40 and 2^50 accordingly. Block limits unit is kilobyte (1024) by default and block limits are always kilobyte-grained (even if specified in bytes), see EXAMPLES
static int lfs_getname(int argc, char **argv);
static int lfs_check(int argc, char **argv);
#ifdef HAVE_SYS_QUOTA_H
-static int lfs_quotachown(int argc, char **argv);
static int lfs_quotacheck(int argc, char **argv);
static int lfs_quotaon(int argc, char **argv);
static int lfs_quotaoff(int argc, char **argv);
static int lfs_setquota(int argc, char **argv);
static int lfs_quota(int argc, char **argv);
-static int lfs_quotainv(int argc, char **argv);
#endif
static int lfs_flushctx(int argc, char **argv);
static int lfs_join(int argc, char **argv);
"[for specified path only]\n"
"Usage: getname [-h]|[path ...] "},
#ifdef HAVE_SYS_QUOTA_H
- {"quotachown",lfs_quotachown, 0,
- "Change files' owner or group on the specified filesystem.\n"
- "usage: quotachown [-i] <filesystem>\n"
- "\t-i: ignore error if file is not exist\n"},
{"quotacheck", lfs_quotacheck, 0,
"Scan the specified filesystem for disk usage, and create,\n"
- "or update quota files.\n"
+ "or update quota files. Deprecated as of 2.4.0.\n"
"usage: quotacheck [ -ug ] <filesystem>"},
- {"quotaon", lfs_quotaon, 0, "Turn filesystem quotas on.\n"
+ {"quotaon", lfs_quotaon, 0, "Turn filesystem"
+ " quotas on. Deprecated as of 2.4.0.\n"
"usage: quotaon [ -ugf ] <filesystem>"},
- {"quotaoff", lfs_quotaoff, 0, "Turn filesystem quotas off.\n"
+ {"quotaoff", lfs_quotaoff, 0, "Turn filesystem"
+ " quotas off. Deprecated as of 2.4.0.\n"
"usage: quotaoff [ -ug ] <filesystem>"},
{"setquota", lfs_setquota, 0, "Set filesystem quotas.\n"
"usage: setquota <-u|-g> <uname>|<uid>|<gname>|<gid>\n"
" -b <block-softlimit> -B <block-hardlimit>\n"
" -i <inode-softlimit> -I <inode-hardlimit> <filesystem>\n"
- " setquota -t <-u|-g> <block-grace> <inode-grace> <filesystem>\n"
" setquota <-u|--user|-g|--group> <uname>|<uid>|<gname>|<gid>\n"
" [--block-softlimit <block-softlimit>]\n"
" [--block-hardlimit <block-hardlimit>]\n"
"usage: quota [-q] [-v] [-o <obd_uuid>|-i <mdt_idx>|-I <ost_idx>]\n"
" [<-u|-g> <uname>|<uid>|<gname>|<gid>] <filesystem>\n"
" quota [-o <obd_uuid>|-i <mdt_idx>|-I <ost_idx>] -t <-u|-g> <filesystem>"},
- {"quotainv", lfs_quotainv, 0, "Invalidate quota data.\n"
- "usage: quotainv [-u|-g] <filesystem>"},
#endif
{"flushctx", lfs_flushctx, 0, "Flush security context for current user.\n"
"usage: flushctx [-k] [mountpoint...]"},
}
#ifdef HAVE_SYS_QUOTA_H
-static int lfs_quotachown(int argc, char **argv)
-{
-
- int c,rc;
- int flag = 0;
-
- optind = 0;
- while ((c = getopt(argc, argv, "i")) != -1) {
- switch (c) {
- case 'i':
- flag++;
- break;
- default:
- fprintf(stderr, "error: %s: option '-%c' "
- "unrecognized\n", argv[0], c);
- return CMD_HELP;
- }
- }
- if (optind == argc)
- return CMD_HELP;
- rc = llapi_quotachown(argv[optind], flag);
- if(rc)
- fprintf(stderr,"error: change file owner/group failed.\n");
- return rc;
-}
-
static int lfs_quotacheck(int argc, char **argv)
{
int c, check_type = 0;
mnt = argv[optind];
rc = llapi_quotacheck(mnt, check_type);
- if (rc) {
+ if (rc == -EOPNOTSUPP) {
+ fprintf(stderr, "error: quotacheck not supported by the quota "
+ "master.\nPlease note that quotacheck is deprecated as "
+ "of lustre 2.4.0 since space accounting is always "
+ "enabled.\nFilesystems not formatted with 2.4 utils or "
+ "beyond can be upgraded with tunefs.lustre --quota.\n");
+ return rc;
+ } else if (rc) {
fprintf(stderr, "quotacheck failed: %s\n", strerror(-rc));
return rc;
}
rc = llapi_quotactl(mnt, &qctl);
if (rc) {
- if (rc == -EALREADY) {
+ if (rc == -EOPNOTSUPP) {
+ fprintf(stderr, "error: quotaon not supported by the "
+ "quota master.\nPlease note that quotaon/off is"
+ " deprecated as of lustre 2.4.0.\nQuota "
+ "enforcement should now be enabled on the MGS "
+ "via:\nmgs# lctl conf_param ${FSNAME}.quota."
+ "<ost|mdt>=<u|g|ug>\n(ost for block quota, mdt "
+ "for inode quota, u for user and g for group"
+ "\n");
+ } else if (rc == -EALREADY) {
rc = 0;
} else if (rc == -ENOENT) {
fprintf(stderr, "error: cannot find quota database, "
rc = llapi_quotactl(mnt, &qctl);
if (rc) {
- if (rc == -EALREADY) {
+ if (rc == -EOPNOTSUPP) {
+ fprintf(stderr, "error: quotaoff not supported by the "
+ "quota master.\nPlease note that quotaon/off is"
+ " deprecated as of lustre 2.4.0.\nQuota "
+ "enforcement can be disabled on the MGS via:\n"
+ "mgs# lctl conf_param ${FSNAME}.quota.<ost|mdt>"
+ "=\"\"\n");
+ } else if (rc == -EALREADY) {
rc = 0;
} else {
if (*obd_type)
return rc;
}
-static int lfs_quotainv(int argc, char **argv)
-{
- int c;
- char *mnt;
- struct if_quotactl qctl;
- int rc;
-
- memset(&qctl, 0, sizeof(qctl));
- qctl.qc_cmd = LUSTRE_Q_INVALIDATE;
-
- optind = 0;
- while ((c = getopt(argc, argv, "fgu")) != -1) {
- switch (c) {
- case 'u':
- qctl.qc_type |= 0x01;
- break;
- case 'g':
- qctl.qc_type |= 0x02;
- break;
- case 'f':
- qctl.qc_cmd = LUSTRE_Q_FINVALIDATE;
- break;
- default:
- fprintf(stderr, "error: %s: option '-%c' "
- "unrecognized\n", argv[0], c);
- return CMD_HELP;
- }
- }
-
- if (qctl.qc_type)
- qctl.qc_type--;
- else /* by default, invalidate quota for both user & group */
- qctl.qc_type = 0x02;
-
- if (argc == optind)
- return CMD_HELP;
-
- mnt = argv[optind];
-
- rc = llapi_quotactl(mnt, &qctl);
- if (rc) {
- fprintf(stderr, "quotainv failed: %s\n", strerror(-rc));
- return rc;
- }
-
- return 0;
-}
-
#define ARG2INT(nr, str, msg) \
do { \
char *endp; \