[Lustre-discuss] redistribute used space to other OSTs ( free space )

Alex linux at vfemail.net
Thu Nov 6 01:40:00 PST 2008


On Wednesday 05 November 2008 21:19, Andreas Dilger wrote:
> On Nov 04, 2008  11:49 -0500, Brian J. Murrell wrote:
> > > [root at rs1 ~]# lfs getstripe /mnt/lustre/test3.img
> > > OBDS:
> > > 0: testfs-OST0000_UUID ACTIVE
> > > 1: testfs-OST0001_UUID ACTIVE
> > > 2: testfs-OST0002_UUID ACTIVE
> > > 3: testfs-OST0003_UUID ACTIVE
> > > /mnt/lustre/test3.img
> > >         obdidx           objid          objid            group
> > >              0               7            0x7                0
> > >              2               6            0x6                0
> > >              3              70           0x46                0
> > >              1              69           0x45                0
> > >
> > > [root at rs1 ~]#
> > >
> > > So, how can i move objid=7 from OST:0 to OST:2, keeping
> > > intact /mnt/lustre/test3.img file?
> >
> > You can't work with that much precision.  You first deactivate the OST
> > on the MDS, then when you cp the file, the destination file will be
> > restriped, but will not get striped to the deactivated OST.
>
> As an FYI, being able to migrate data between OSTs arbitrarily is a
> project we are working on, but it won't be ready for some time.
>
> > You must note that the copied file does not inherit the striping policy
> > of the original automatically.  If the files you want to move are just
> > using the filesystem default striping then this is not a problem. 
> > However if the striping for a directory is different than the filesystem,
> > you will want to create your target directory first and set the stripe
> > policy and then cp/rm the files.
>
> If the target file is created in the same directory as the source, then
> it will get the same directory default striping, unless a specific
> striping was specified.  It is easier to cp/rm the files one at a time
> in the same directory tree than to move the whole tree.
>
> > I said earlier that you could use mv.  I'm not positive that will always
> > have the desired results so likely you should stick with cp/rm.
>
> Using "mv" will only rename the inode on the MDS, it doesn't change any
> of the data.  That is true for local filesystems as well as Lustre.

That's brilliant explanation, and conclude some things for clear:
- if you want to influence objects redistribution on OSTs when "moving" a 
file, is a must to use CP&&RM commands. MV command will never influence that 
and is not helpful at all, because it will affect ONLY MDS (as you specified 
above, will only rename the inode on the MDS)
- cp always require to have more free space on your filesystem then mv
- if you don't have enough free space to complete these operations and you 
don't want to erase some files -> add another OST.

Thanks again for answers to all has been part of this thread.

Regards,
Alx



More information about the lustre-discuss mailing list