CodexBloom - Programming Q&A Platform

Permissions guide when using `rsync` to backup files from external drive on Ubuntu 22.04

👀 Views: 16 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-03
linux rsync ntfs ubuntu bash

I'm testing a new approach and I'm prototyping a solution and I'm working on a project and hit a roadblock. I'm trying to use `rsync` to back up files from an external NTFS drive to a local directory on my Ubuntu 22.04 system, but I'm running into permission issues. When I run the command: ```bash rsync -av --progress /media/external_drive/ /home/user/backup/ ``` I get the following behavior messages: ``` rsync: recv_generator: failed to stat "/media/external_drive/some_file.txt": Permission denied (13) rsync: mkstemp "backup/some_file.txt.XXXXXX" failed: Permission denied (13) rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync behavior: behavior in rsync protocol data stream (code 12) at io.c(226) [sender=3.2.3] ``` I've checked the mount options for the NTFS drive using `mount | grep ntfs`, and I see it mounted with the following options: ``` typenfs-3.0.0, uid=1000, gid=1000, fmask=007, dmask=007, Windows_names ``` I attempted to change the permissions on the source files using `chmod` but it doesn't seem to have any effect since it's an NTFS filesystem. I also tried using `sudo` with the `rsync` command: ```bash sudo rsync -av --progress /media/external_drive/ /home/user/backup/ ``` However, I still encounter the same permission denied errors. I suspect this may be related to the way the NTFS filesystem handles permissions. How can I resolve these permission issues to successfully back up my files? For context: I'm using Bash on macOS. My development environment is Ubuntu 22.04. Am I approaching this the right way?