[lustre-discuss] Using lfs migrate to move files between MDTs

Mohr Jr, Richard Frank (Rick Mohr) rmohr at utk.edu
Fri Mar 29 14:36:50 PDT 2019


I have been playing a little bit with DNE today, and I had a question about some odd behavior I saw regarding inode counts.  My Lustre 2.10.6 file system has 2 MDTs. I created a directory (which by default resides on MDT0) and then created 10 files in that directory:

  [root at sip-mgmt2 test]# lfs df -i /lustre/newfs | grep MDT
  siplfs-MDT0000_UUID   3906232784         395  3906232389   0% /lustre/newfs[MDT:0]
  siplfs-MDT0001_UUID   2822275072         276  2822274796   0% /lustre/newfs[MDT:1]

  [root at sip-mgmt2 test]# mkdir subdir

  [root at sip-mgmt2 test]# for i in `seq 1 10`; do touch subdir/file.$i; done

  [root at sip-mgmt2 test]# lfs df -i /lustre/newfs | grep MDT
  siplfs-MDT0000_UUID   3906232784         406  3906232378   0% /lustre/newfs[MDT:0]
  siplfs-MDT0001_UUID   2822275072         276  2822274796   0% /lustre/newfs[MDT:1]

As expected, the inode count for MDT0 increases by about 10.  Then I used “lfs migrate” to move that directory to MDT1:

  [root at sip-mgmt2 test]# lfs migrate -m 1 subdir

  [root at sip-mgmt2 test]# lfs df -i /lustre/newfs | grep MDT
  siplfs-MDT0000_UUID   3906232784         408  3906232376   0% /lustre/newfs[MDT:0]
  siplfs-MDT0001_UUID   2822275072         289  2822274783   0% /lustre/newfs[MDT:1]

I expected the inode count for MDT1 to increase by about 10, but I did not see the MDT0 inode count decrease.  So then I decided to migrate the directory back to MDT0:

  [root at sip-mgmt2 test]# lfs migrate -m 0 subdir

  [root at sip-mgmt2 test]# lfs df -i /lustre/newfs | grep MDT
  siplfs-MDT0000_UUID   3906232784         420  3906232364   0% /lustre/newfs[MDT:0]
  siplfs-MDT0001_UUID   2822275072         290  2822274782   0% /lustre/newfs[MDT:1]

The inode count increases again on MDT0, but it does not decrease on MDT1.  So then I decided to delete the directory and all the files:

  [root at sip-mgmt2 test]# rm -rf subdir

  [root at sip-mgmt2 test]# lfs df -i /lustre/newfs | grep MDT
  siplfs-MDT0000_UUID   3906232784         409  3906232375   0% /lustre/newfs[MDT:0]
  siplfs-MDT0001_UUID   2822275072         290  2822274782   0% /lustre/newfs[MDT:1]

This reclaims about 10 inodes on MDT0, but both MDT0 and MDT1 still seem to have a permanently increased inode count resulting from the previous lfs migrate commands.  Even after waiting a while and remounting the MDTs, the inodes don’t seem to be reclaimed.

It seems like this is a bug, but since this is the first time I have used DNE, I thought maybe I am just misunderstanding something or using the lfs migrate command incorrectly.  It looks similar to LU-11306, but that issue seemed to deal with renaming files and not migrating them.

 Any help would be appreciated.

--
Rick Mohr
Senior HPC System Administrator
National Institute for Computational Sciences
http://www.nics.tennessee.edu



More information about the lustre-discuss mailing list