Additional NFS features

Contributors netapp-aoife

XCP includes some additional NFS features that make it easy to change the ownership and permissions of files and directories for any NFS share or POSIX path. You can use the XCP chown and chmod commands to recursively change all of the files and directories for a given NFS share or POSIX path. This increases the performance of millions of files.

About this task

Before changing the ownership of the files, you must configure the new owner. Otherwise, the command will fail. The XCP chown and chmod commands work similar to the Linux chown and chmod commands.

Chmod

The chmod command scans and changes the file permission of all files in the chosen directory structure. The chmod command requires a mode or reference and NFS share or POSIX path as variables. XCP chmod recursively changes the permissions for a given path. You can use the chmod command to display the total files scanned and the permissions that have been changed in the output.

Example:

xcp chmod -mode 777 NFS [server:/export path | file://<NFS mounted path>]
xcp chmod -mode 707 nfs_server01.netapp.com:/export1
xcp chmod -reference nfs_server01.netapp.com:/export/dir1/file.txt  nfs_server02.netapp.com: export1
xcp chmod -match “fnm(‘file.txt’)” -mode 111 file:///mnt/nfs_mount_point/
xcp chmod -exclude “fnm(‘file.txt’)” -mode 111 file:///demo/user1/

Run the xcp help chmod command for more information.

Chown

The chown command scans and changes the ownership of all files in the chosen directory structure. The chown command requires a NFS share or POSIX path as variables. XCP chown recursively change the ownership for a given path.

Example

xcp chown -user user1 NFS [server:/export path | file://<NFS mounted path>
xcp chown -user user1 nfs_server01.netapp.com:/export1
xcp chown -user user1 -group group1 nfs_server01.netapp.com:/export1/dir1/
xcp chown  -reference nfs_server01.netapp.com:/export/dir1/file.txt  nfs_server02.netapp.com:/export1
xcp chown -match “fnm(‘file.txt’)” -user user1 file:///mnt/nfs_mount_point/
xcp chown -exclude “fnm(‘file.txt’)” -user user1 -group group1
xcp chown -user-from user1 -user user2 file:///mnt/nfs_mount_point/
xcp chown -group-from group1 -group group2 nfs_server01.netapp.com:/export1/

Run the xcp help chown command for more information.