Viewing: mdt.enable_foreign_dir.4

.TH ENABLE_FOREIGN_DIR 4 "2026-03-10" "Lustre" "Lustre Kernel Parameters"
.SH NAME
enable_foreign_dir, enable_foreign_dir_gid \- control foreign directory creation
.SH SYNOPSIS
.SY
lctl set_param mdt.\fIFSNAME\fR*.enable_foreign_dir=\fIENABLE
.SY
lctl set_param mdt.\fIFSNAME\fR*.enable_foreign_dir_gid=\fIGID
.YS
.SS PROPERTIES
.TP
.B Access Permissions
.BR 644 | -rw-r--r--
.TP
.br
.B Scope
.br
Per-MDT device.
.TP
.B Config
.br
.B enable_foreign_dir
and
.B enable_foreign_dir_gid
are always present for MDT devices.
.TP
.B Default
.RB enable_foreign_dir= 1
.br
.RB enable_foreign_dir_gid= -1
.SH DESCRIPTION
The boolean
.B enable_foreign_dir
parameter controls whether clients can create
.B foreign
directories that reference objects on external storage.
If
.I ENABLE
is
.B 1
(or aliases
.BR on " or " true ),
then this functionality is globally enabled. If it is
.B 0
or
.B off
then this functionality is globally disabled.
The
.B enable_foreign_dir_gid
parameter controls which user or group can create these directories.
.PP
The default
.I GID
value of
.B \-1
indicates that any user is allowed to create
.B foreign
directories, while
.B 0
indicates that only the root user is allowed to create them.
If
.I GID
is another value, it means users with the numeric Group ID that can do so.
For example, this could be used to allow an
.I admin
group for administrators, or a
.I foreign_dir
group for power users, using the numeric values of those groups.
.PP
The creation of foreign directories may optionally be restricted on
specific client nodes by a per-nodemap
.RB ' foreign_ops '
RBAC, see
.BR lctl-nodemap-modify (8)
for details.
.SH MODULES
This parameter is in the following modules:
.EX
.B mdt.*.enable_foreign_dir
.B mdt.*.enable_foreign_dir_gid
.EE
.SH EXAMPLES
.TP
Enable foreign directory creation for all users on the \fBtestfs\fR filesystem:
.EX
mgs# lctl set_param -P mdt.testfs-*.enable_foreign_dir_gid=-1
.EE
.SH AVAILABILITY
The
.B enable_foreign_dir
and
.B enable_foreign_dir_gid
parameters are part of the
.BR lustre (7)
filesystem package since release 2.18.0.
.\" Added in commit 2.17.5x
.SH SEE ALSO
.BR lfs-setdirstripe (1),
.BR llapi_dir_create_foreign (3),
.BR mdt.enable_remote_dir (4),
.BR nodemap.rbac (4),
.BR lctl-nodemap-modify (8),
.BR lctl-set_param (8)