From 6bfa4a31e182ed3c033cd346a76adf899c3448c2 Mon Sep 17 00:00:00 2001 From: Joseph Gmitter Date: Thu, 1 Nov 2018 13:50:32 -0400 Subject: [PATCH] LUDOC-395 dne: striped directory migration documentation This patch adds documentation for the manual striped directory supported added by LU-4684. Signed-off-by: Joseph Gmitter Change-Id: Ib04f8e1860dfc8d383bd7910a44965de00b5b9b3 Reviewed-on: https://review.whamcloud.com/33550 Reviewed-by: Andreas Dilger Tested-by: Jenkins --- ManagingFileSystemIO.xml | 86 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 23 deletions(-) diff --git a/ManagingFileSystemIO.xml b/ManagingFileSystemIO.xml index c00c63c..1ff1dc8 100644 --- a/ManagingFileSystemIO.xml +++ b/ManagingFileSystemIO.xml @@ -126,38 +126,78 @@ mds# lctl set_param osp.fsname-OSTnnnn
- - <indexterm> + <title><indexterm> <primary>migrating metadata</primary> - </indexterm>Migrating Directories to a new MDT - Lustre software version 2.8 includes a feature - to migrate metadata (directories and inodes therein) between MDTs. - This migration can only be performed on whole directories. For example, - to migrate the contents of the /testfs/testremote - directory from the MDT it currently resides on to MDT0000, the - sequence of commands is as follows: - $ cd /testfs -lfs getdirstripe -M ./testremote which MDT is dir on? + Migrating Metadata within a Filesystem +
+ <indexterm> + <primary>migrating metadata</primary> + </indexterm>Whole Directory Migration + Lustre software version 2.8 includes a feature + to migrate metadata (directories and inodes therein) between MDTs. + This migration can only be performed on whole directories. Striped + directories are not supported until Lustre 2.12. For example, to + migrate the contents of the /testfs/remotedir + directory from the MDT where it currently is located to MDT0000 to + allow that MDT to be removed, the sequence of commands is as follows: + + $ cd /testfs +$ lfs getdirstripe -m ./remotedir which MDT is dir on? 1 -$ for i in $(seq 3); do touch ./testremote/${i}.txt; done create test files -$ for i in $(seq 3); do lfs getstripe -M ./testremote/${i}.txt; done check files are on MDT 1 +$ touch ./remotedir/file.{1,2,3}.txtcreate test files +$ lfs getstripe -m ./remotedir/file.*.txtcheck files are on MDT0001 1 1 1 -$ lfs migrate -m 0 ./testremote migrate testremote to MDT 0 -$ lfs getdirstripe -M ./testremote which MDT is dir on now? +$ lfs migrate -m 0 ./remotedir migrate testremote to MDT0000 +$ lfs getdirstripe -m ./remotedir which MDT is dir on now? 0 -$ for i in $(seq 3); do lfs getstripe -M ./testremote/${i}.txt; done check files are on MDT 0 too +$ lfs getstripe -m ./remotedir/file.*.txtcheck files are on MDT0000 0 0 0 - For more information, see man lfs-migrate - Currently, only whole directories can be migrated - between MDTs. During migration each file receives a new identifier - (FID). As a consequence, the file will report a new inode number. Some - system tools (for example, backup and archiving tools) may consider - the migrated files to be new, even though the contents are unchanged. - + For more information, see man lfs-migrate. + + During migration each file receives a new identifier + (FID). As a consequence, the file will report a new inode number to + userspace applications. Some system tools (for example, backup and + archiving tools, NFS, Samba) that identify files by inode number may + consider the migrated files to be new, even though the contents are + unchanged. If a Lustre system is re-exporting to NFS, the migrated + files may become inaccessible during and after migration if the + client or server are caching a stale file handle with the old FID. + Restarting the NFS service will flush the local file handle cache, + but clients may also need to be restarted as they may cache stale + file handles as well. + +
+
+ <indexterm> + <primary>migrating metadata</primary> + </indexterm>Striped Directory Migration + Lustre 2.8 included a feature to migrate metadata (directories + and inodes therein) between MDTs, however it did not support migration + of striped directories, or changing the stripe count of an existing + directory. Lustre 2.12 adds support for migrating and restriping + directories. The lfs migrate -m command can only + only be performed on whole directories, though it will migrate both + the specified directory and its sub-entries recursively. + For example, to migrate the contents of a large directory + /testfs/largedir from its current location on + MDT0000 to MDT0001 and MDT0003, run the following command: + $ lfs migrate -m 1,3 /testfs/largedir + Metadata migration will migrate file dirent and inode to other + MDTs, but it won't touch file data. During migration, directory and + its sub-files can be accessed like normal ones, though the same + warning above applies to tools that depend on the file inode number. + Migration may fail for various reasons such as MDS restart, or disk + full. In those cases, some of the sub-files may have been migrated to + the new MDTs, while others are still on the original MDT. The files + can be accessed normally. The same lfs migrate -m + command should be executed again when these issues are fixed to finish + this migration. However, you cannot abort a failed migration, or + migrate to different MDTs from previous migration command. +
-- 1.8.3.1