Rsync: failed to set permissions on
Fix the Rsync 'failed to set permissions on' error caused by FAT32, NTFS, or exFAT filesystems, ownership mismatches, and insufficient privileges.
Rsync produces the "failed to set permissions on" message when the destination filesystem or user account does not support or allow Unix file permission changes.
When Rsync Produces This Error
Rsync produces "failed to set permissions on" when copying files to a FAT32, NTFS, or exFAT destination filesystem. These Windows-native filesystems do not support Unix-style file permissions (chmod), and Rsync's attempt to call
chmod() on the destination fails with an
EPERM (Operation not permitted) error.
Rsync also produces "failed to set permissions on" when the user running the Rsync command does not own the destination files or directories. Rsync cannot change permissions on files owned by a different user unless the Rsync process runs as root.
What Causes the "failed to set permissions on" Error in Rsync
Rsync's archive mode (
-a flag) includes the
-p (preserve permissions) option by default. Rsync attempts to replicate the source file's Unix permission bits (read, write, execute for owner, group, others) on the destination file. FAT32 and exFAT do not store Unix permission metadata at all. NTFS simulates Unix permissions through Linux mount options but may not support
chmod() for all permission bits.
Rsync calls the
chmod() system call on the destination file after the transfer completes. The Linux kernel returns
EPERM when the underlying filesystem does not implement permission changes. Rsync surfaces this kernel error as "failed to set permissions on" followed by the file path.
Rsync produces the same error on ext4 or XFS filesystems when the user running Rsync is not the owner of the destination file. Unix filesystems enforce that only the file owner or root can change permissions. A non-root user attempting to set permissions on files owned by another user triggers the
EPERM error.
How to Fix "failed to set permissions on" in Rsync
Skip permission preservationby adding
--no-perms,--no-o(no owner), and--no-g(no group) flags to the Rsync command. Rsync applies the destination's default umask instead of replicating the source permissions.rsync -avz --no-perms --no-o --no-g /home/user/src/ /mnt/usb-drive/dest/Rsync transfers all files without attempting to set Unix permissions, ownership, or group. This fix works for FAT32, NTFS, and exFAT destinations.
Replace
-awith explicit flagsthat exclude permission-related options. Rsync's-rltzcombination provides recursive mode, symlinks, timestamps, and compression without permissions or ownership.rsync -rltz /home/user/src/ /mnt/usb-drive/dest/Rsync transfers files recursively with timestamps and compression but skips permissions, owner, and group metadata.
Fix ownership on the destinationwhen the error occurs on a Unix filesystem (ext4, XFS, Btrfs). Change the destination directory owner to match the user running Rsync.
sudo chown -R $(whoami) /path/to/destination/Rsync can now set permissions on the destination files because the running user owns them.
Run Rsync as rootwhen the transfer requires preserving ownership across different user accounts on Unix filesystems.
sudo rsync -avz /home/user/src/ /path/to/destination/Root has permission to call
chmod()andchown()on any file regardless of ownership.
How to Verify the Fix
Rsync completes the transfer without "failed to set permissions on" warnings when the fix is applied. Run the transfer and check for clean output.
rsync -avz --no-perms --no-o --no-g /home/user/src/ /mnt/usb-drive/dest/Rsync prints the file list and summary without permission-related error messages. Verify that the destination files exist with
ls -la /mnt/usb-drive/dest/.
Edge Cases and Variations
Rsync produces "failed to set permissions on" on NFS-mounted directories when the NFS export uses
root_squash. The NFS server maps root to
nobody, preventing Rsync from setting permissions even when run as root. Use
no_root_squash in the NFS export configuration or add
--no-perms to the Rsync command.
Rsync produces a similar error on CIFS/SMB-mounted shares from Windows servers. CIFS mounts simulate Unix permissions through mount options (
file_mode,
dir_mode). Add
--no-perms --no-o --no-g to the Rsync command when syncing to CIFS-mounted destinations.
Rsync on Arch Linux with glibc versions prior to the fix in rsync 3.2.3-3 triggers a spurious "failed to set permissions" error due to a
lchmod() bug. Update Rsync to version 3.2.3-3 or later to resolve this issue.
Related Rsync Errors
Rsync: failed to set times on-- caused by similar filesystem compatibility issues when the destination does not support Unix timestamp modification.
Rsync: error in rsync protocol data stream-- destination permission problems are one of several causes of protocol data stream errors.