From 83f299175e79c37beaa5cc3580dcf52eb9a3385e Mon Sep 17 00:00:00 2001 From: Emoly Liu Date: Wed, 27 Jun 2018 12:18:57 +0800 Subject: [PATCH] LU-11099 doc: include "-N" option to lfs_setstripe.1 This patch includes mirror option "-N[mirror_count]" to lfs_setstripe.1 man page so that the user can follow the manual to create a mirrored file or set s default mirror layout on a directory correctly. The command format is like: $lfs setstripe -N[mirror_count] [STRIPE_OPTIONS] Test-Parameters: trivial Change-Id: If0fabd79d218e5582f9c64336f60466f35dbd968 Signed-off-by: Emoly Liu Reviewed-on: https://review.whamcloud.com/32734 Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Tested-by: Jenkins Tested-by: Maloo --- lustre/doc/lfs-setstripe.1 | 27 +++++++++++++++++++++++++++ lustre/utils/lfs.c | 3 +++ 2 files changed, 30 insertions(+) diff --git a/lustre/doc/lfs-setstripe.1 b/lustre/doc/lfs-setstripe.1 index e73bbff..ec9d342 100644 --- a/lustre/doc/lfs-setstripe.1 +++ b/lustre/doc/lfs-setstripe.1 @@ -19,6 +19,8 @@ lfs setstripe \- set striping pattern of a file or directory default .br .B lfs setstripe -d \fR<\fIdirectory\fR> .br +.B lfs setstripe -N\fR[\fImirror_count\fR] \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR> +.br .B lfs setstripe --yaml= .br .SH DESCRIPTION @@ -114,6 +116,21 @@ to delete the default layout on a directory before replacing it. This is only needed if the directory should revert from a directory-specific layout to using the global filesystem default layout stored on the root directory. .TP +.B lfs setstripe -N\fR[\fImirror_count\fR] \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR> +.br +The -N option indicates how many mirrors that have the same layout will be set +on a file or directory (see \fBlfs-mirror-create\fR(1)). The \fImirror_count\fR +argument is optional and defaults to 1 if it's not specified; if specified, +it must follow the option without a space. +.br +The \fISTRIPE_OPTIONS\fR specify the specific layout for the mirror. It can +be a plain layout with specific striping pattern or a composite layout. +If they are not specified, the stripe options inherited from the previous +component will be used. If there is no previous component, the +\fIstripe_count\fR and \fIstripe_size\fR options inherited from filesystem-wide +default values will be used, and OST \fIpool_name\fR inherited from parent +directory will be used. +.TP .B lfs setstripe --yaml= .br Create a file with layout information specified by a YAML format template @@ -243,6 +260,16 @@ This creates a file striped on two OSTs with 128kB on each stripe. This deletes a default stripe pattern on dir. New files created in that directory will use the filesystem global default instead. .TP +.B lfs setstripe -N2 -E 1M -E eof -c -1 /mnt/lustre/dir1 +This sets a default mirror layout on a directory with 2 PFL mirrors. Each mirror +has the same specified PFL layout. +.TP +.B lfs setstripe -N2 /mnt/lustre/file1 +This creates a mirrored file with 2 mirrors. Each mirror has the same default +striping pattern with \fIstripe_count\fR and \fIstripe_size\fR inherited from +filesystem-wide default values, and OST \fIpool_name\fR inherited from parent +directory. +.TP .B $ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1 This creates a file with composite layout, the component has 1 stripe and \ covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \ diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 445cfa7..86900f7 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -308,6 +308,9 @@ command_t cmdlist[] = { "To totally delete the default striping from an existing directory:\n" "usage: setstripe -d \n" " or\n" + "To create a mirrored file or set s default mirror layout on a directory:\n" + "usage: setstripe -N[mirror_count] [STRIPE_OPTIONS] \n" + " or\n" "To delete the last component(s) from an existing composite file\n" "(note that this will also delete any data in those components):\n" "usage: setstripe --component-del [--component-id|-I ]\n" -- 1.8.3.1