From 624e78ae80cd60ed1888eb11cbafd9f0ad55dffd Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Mon, 7 Nov 2022 14:56:24 -0700 Subject: [PATCH] LU-930 docs: add lfs-rm_entry.8 man page Add man page for "lfs rm_entry" and alias "lfs rmentry". Test-Parameters: trivial Fixes: 2ad263c602 ("LU-1187 utils: add lfs setdirstripe/getdirstripe") Signed-off-by: Andreas Dilger Change-Id: I783f23ec8fd0c75c69bcc78c180a07e54dd0c8a1 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49064 Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Reviewed-by: Qian Yingjin Tested-by: jenkins Tested-by: Maloo --- lustre/doc/Makefile.am | 2 ++ lustre/doc/lfs-rm_entry.8 | 36 ++++++++++++++++++++++++++++++++++++ lustre/doc/lfs-rmentry.8 | 1 + lustre/utils/lfs.c | 1 + 4 files changed, 40 insertions(+) create mode 100644 lustre/doc/lfs-rm_entry.8 create mode 100644 lustre/doc/lfs-rmentry.8 diff --git a/lustre/doc/Makefile.am b/lustre/doc/Makefile.am index d98de39..2c6e699 100644 --- a/lustre/doc/Makefile.am +++ b/lustre/doc/Makefile.am @@ -77,6 +77,8 @@ MANFILES = \ lfs-pcc.1 \ lfs-project.1 \ lfs-quota.1 \ + lfs-rm_entry.8 \ + lfs-rmentry.8 \ lfs-rmfid.1 \ lfs-setdirstripe.1 \ lfs-setquota.1 \ diff --git a/lustre/doc/lfs-rm_entry.8 b/lustre/doc/lfs-rm_entry.8 new file mode 100644 index 0000000..f62c194 --- /dev/null +++ b/lustre/doc/lfs-rm_entry.8 @@ -0,0 +1,36 @@ +.TH LFS-RMENTRY 8 2017-07-25 "Lustre" "Lustre Utilities" +.SH NAME +lfs-rmentry \- remove only filename from directory +.SH SYNOPSIS +.B lfs rmentry +.SH DESCRIPTION +In cases where an MDT is permanently offline, or if there is an inconsistency +between MDT directory contents and files (e.g. broken striped directory), the +.B lfs rmentry +command removes +.B only +the filename entry from a directory, but does not try to delete the inode +corresponding to the filename. The MDT inode itself (or a local agent inode +in the case of DNE remote entries) will still remain on the MDT filesystem, +and will be reconnected to the internal MDT lost+found directory when +e2fsck is next run. Since the MDT inode itself is not deleted, any OST +objects referenced by this inode will also not be destroyed, so no space +will be released. +.SH WARNING +The main reason to use +.B lfs rmentry +is to remove filenames or directory names that are permanently inaccessible, +in order to allow them to be restored from backup, or to avoid application +errors when accessing these filenames. It should not be used to delete files +that are normally accessible, and can only be run by the root user. +.SH EXAMPLES +.TP +.B lfs rmentry /mnt/testfs/mdt7/newdir +Remove directory entry +.B newdir +on MDT0007 since the remote MDT it is referencing is no longer accessible. +.SH AUTHOR +The \fBlfs rmentry\fR command is part of the Lustre filesystem. +.SH SEE ALSO +.BR lfs (1), +.BR lfs-rmfid (1) diff --git a/lustre/doc/lfs-rmentry.8 b/lustre/doc/lfs-rmentry.8 new file mode 100644 index 0000000..8ceeadd --- /dev/null +++ b/lustre/doc/lfs-rmentry.8 @@ -0,0 +1 @@ +.so man8/lfs-rm_entry.8 diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index cafc758..58890c8 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -388,6 +388,7 @@ command_t cmdlist[] = { "will become inaccessable after this command. This can only be done\n" "by the administrator\n" "usage: rm_entry \n"}, + {"rmentry", lfs_rmentry, 0, "remove a dir entry, same as 'rm_entry'\n"}, {"unlink_foreign", lfs_unlink_foreign, 0, "To remove the foreign file/dir.\n" "Note: This is for files/dirs prevented to be removed using\n" -- 1.8.3.1