LFS-SETDIRSTRIPE(1)
π LFS-SETDIRSTRIPE(1) π
okay bestie, you found the Lustre Utilities corner of the manual, and specifically the lfs setdirstripe page. Buckle up, this one's a bop. π¦
β¨ NAME β¨
lfs setdirstripe, mkdir β set striping pattern of a directory.
πΈ SYNOPSIS πΈ
lfs setdirstripe [-cCdDhHioTxX] DIR...
π DESCRIPTION π
So like, this makes a striped directory with the striping pattern you asked for. She's basically lfs setstripe's cousin, but instead of files she's out here creating striped dirs, or setting the default layout that subdirectories will pick up. π
She can also make a directory with a foreign (free format) striping pattern β peep --foreign and --xattr for that whole situation.
Also plot twist: lfs mkdir is literally just an alias for this command. Same girl, different name. π
π OPTIONS π
-c,-T,--mdt-count=COUNTβ stripe the new directory overCOUNTMDTs. that's the whole vibe.-C,--overstripe-count STRIPE_COUNTβ the number of stripes to create, and ifSTRIPE_COUNTgoes over the number of MDTs in the filesystem, she'll make more than 1 stripe per MDT.0means "use the filesystem-wide default stripe count" (default is1). A negative value-Nmeans N stripes per available MDT:-1gives one stripe per MDT, and-2,-3,-4,-5give 2, 3, 4, and 5 stripes per MDT respectively. The max multiplier allowed rn is-5.-h,--helpβ prints the usage message, no thoughts just vibes.-i,--mdt-index=START_MDT_INDEX[,MDT_INDEX...]β use the MDT whose index isSTART_MDT_INDEXas the master/starting MDT for the directory. If you hand her multipleMDT_INDEXvalues, then the stripes get allocated on those exact specified MDT indices. If-1(the default) is used, the client will round-robin subdirectory creation across all MDTs when their free space is withinlod.*.mdt_qos_threshold_rrpercent of each other β otherwise the client prefers to pickCOUNTMDT(s) proportional to the free space and inodes on each. π§
β οΈ okay so listen: if you provide multipleMDT_INDEXvalues while trying to set the default striping pattern of subdirectories with-D, it will not load balance subdirectory creation amongst the MDTs. Instead it makes all new subdirectories striped across all of the specified MDTs. This is discouraged and can lead to filesystem problems if too many striped directories get created π. If you're gonna do it anyway,-c Nmust also be specified, whereNmatches the number of MDT indices you gave.
-H,--mdt-hash=HASH_TYPEβ usehash_typefor the striped directory. the options are:crushβ CRUSH hash algorithm. This is a consistent hash algorithm, so minimum sub files need to relocate during directory restripe.fnv_1a_64β Fowler-Noll-Vo (FNV-1a) hash algorithm. This provides reasonably uniform, but not cryptographically strong, hashing of the filename. (this is the default, bestie π )all_charβ sum of ASCII characters modulo number of MDTs. This provides weak hashing of the filename, and is suitable for only testing or when the input is known to have perfectly uniform distribution (e.g. sequential numbers).
-d,--deleteβ delete the default striping layout from the directory. New subdirectories created in this directory will inherit the global default directory layout (by default they will not be striped).-D,--defaultβ set the default striping pattern of subdirectories. Newly created sub-directories will use the new default striping pattern, but existing sub-directories will not be affected. The newly created sub-directories will also inherit the specified default striping pattern.
π«Ά note that striping all directories across all MDTs by default is not recommended at this time, because the clients have to do more RPCs to create and access each directory, which hurts performance instead of improving it. Default striped directories are preferred only for parent directories where large subdirectories will be created (e.g. file-per-process job output directories). Instead, using-c 1 -i -1on top-level directories balancesmkdirtherein over MDTs automatically without causing all subdirectories to be remote by default. slay.
-o,--mode=MODEβ set the file access permissions of the new directory to the specified numericMODE(typically octal), same energy aschmod(1). It is not affected by the currentumask(1p).--foreign[=type]β create a directory with a foreign (non-Lustre/free format, see the--xattroption) striping. Wheretypespecifies a known foreign type (likenone,symlink, ...) or a 32-bit numeric type.--flags=<hex>β specify a numeric bitmask of type-specific layout flags for the foreign layout.-x,--xattr=STRINGβ specify a string to be used as a foreign (free format) striping.-X,--max-inherit=MAX_INHERITβ set the inherit depth of default directory layout. If non-zero, thenMAX_INHERITis the number of subdirectory levels for which this default layout is inherited, up to a maximum of250levels, and it gets decremented by one when copying the default layout to each new subdirectory, until zero and the default layout is no longer copied. AMAX_INHERITof-1means the default layout is inherited for all subdirectories. π--max-inherit-rr=MAX_INHERIT_RRβ set the round-robin inherit depth of the default directory layout, only whenSTART_MDT_INDEXis-1. IfMAX_INHERIT_RRis zero (unset), then new subdirectories are preferentially created on MDTs with more free space and inodes if the MDTs are imbalanced. If non-zero, thenMAX_INHERIT_RRis the number of subdirectory levels, up to a maximum of250levels, for which new subdirectories will be created in a round-robin manner across all available MDTs, rather than using MDT space balancing for new subdirectories. Otherwise,MAX_INHERIT_RRis decremented by one when copying the default layout to each new subdirectory, until zero and round-robin is no longer used. It may be useful to setMAX_INHERIT_RRto2or3when setting the default directory layout on the root of a new filesystem, so that top-level subdirectories are immediately spread across MDTs, rather than waiting for the MDTs to become imbalanced. Round-robin subdirectory creation is unlikely to be useful for existing filesystems that already have many files and imbalanced MDTs, since space balancing will already happen, and this will unnecessarily increase the number of remote subdirectories (increasing overhead) without any benefit. π
π NOTE π
If neither -c nor -i are specified, lfs mkdir will default to -c 1 -i -1 and create the directory on an MDT that is less full than the others.
The lfs setdirstripe command is only usable by root unless the mdt.*.enable_remote_dir_gid is set on the MDS via lctl set_param to be either a non-zero numeric GID to limit it to a single group (e.g. the operator or admin GID), or -1 to allow any user/group to create remote directories. By default, it is 0 to limit remote/striped directories to only the root user.
The root directory of the file system is on MDT0000, and a filesystem-wide default directory layout is set on it by default:
lfs setdirstripe -D -i -1 -c 1 --max-inherit -1 --max-inherit-rr 3
which is a space balanced directory layout β¨ therefore new directories will be created on all MDTs by inode and space usage, and the top three level of new directories will be created in roundrobin mode if system is balanced. If user doesn't want automatic space balance, deleting this default directory layout won't work, because it will be recreated if not set. Instead, user can run
lfs setdirstripe -D -i -1 -c 1 --max-inherit 1 <mountpoint>
to limit space balance in the top level, or run
lfs setdirstripe -D -i 0 -c 1 --max-inherit 1 <mountpoint>
to disable it.
π₯ EXAMPLES π₯
$ lfs setdirstripe -c 2 -i 1 -H all_char /mnt/lustre/dir1
This creates a directory striped on two MDTs, whose first stripe is on MDT0001 (MDT index 1), and whose hash type is all_char. iconic.
$ lfs mkdir --foreign=symlink --xattr PUUID/CUUID /mnt/lustre/dir1
This creates dir1 with foreign (non-lustre/free format) PUUID/CUUID striping/LMV EA value (symlink type). π she ate fr fr.
β AVAILABILITY β
The lfs setdirstripe command is part of the Lustre filesystem.
π SEE ALSO π
lctl(8), lfs(1), lfs-getdirstripe(1), lfs-setstripe(1), lustre(7)
okay that's the whole page bestie, you're so welcome π this lil number comes to you from Lustre, dated 2017-11-07, and her name is LFS-SETDIRSTRIPE(1) β go forth and stripe responsibly, ily, bye π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms