[gpfsug-discuss] Change uidNumber and gidNumber for billions of files

Jonathan Buzzard jonathan.buzzard at strath.ac.uk
Tue Jun 9 23:40:33 BST 2020


On 09/06/2020 14:57, Jonathan Buzzard wrote:

[SNIP]

> 
> I actually thinking on it more thought a generic C random UID/GID to 
> UID/GID mapping program is a really simple piece of code and should be 
> nearly as fast as chown -R. It will be very slightly slower as you have 
> to look the mapping up for each file. Read the mappings in from a CSV 
> file into memory and just use nftw/lchown calls to walk the file system 
> and change the UID/GID as necessary.
> 

Because I was curious I thought I would have a go this evening coding 
something up in C.

It's standing at 213 lines of code put there is some extra fluff and 
some error checking and a large copyright comment. Updating ACL's would 
increase the size too. It would however be relatively simple I think. 
The public GPFS API documentation on ACL's is incomplete so some guess 
work and testing would be required.

It's stupidly fast on my laptop changing the ownership of the latest 
version of gcc untarred. However there is only one user in the map file 
and it's an SSD. Obviously if you have billions of files it is going to 
take longer :-)

JAB.

-- 
Jonathan A. Buzzard                         Tel: +44141-5483420
HPC System Administrator, ARCHIE-WeSt.
University of Strathclyde, John Anderson Building, Glasgow. G4 0NG



More information about the gpfsug-discuss mailing list