Score:0

rsync doesnt copy permissions to external drive

gf flag

a similar Q is asked here: https://unix.stackexchange.com/questions/229779/rsync-command-not-preserving-permissions. They suggest using sudo, but sudo makes no difference for me

the command i'm running is: rsync -avxPnh --itemize-changes --out-format="%i|%n|" --update --delete [source directory] [destination directory]'

-a: archive, preserves permissions, but I can see from --itemize-changes that the difference between files in the two directories is the permissions (and nothing else)

the external drive shows full permissions (drwxrwxrwx) on everything. It is a datalocker DL3.

because the permissions differ on the laptop versus external hard drive, the sync is generating a long list of changes every time i sync. Is it the fault of rsync or the external drive?

edit: the datalocker DL3 "comes preformatted with the Windows NTFS file system. All major file systems are supported (HFS, NTFS, EXT, FAT). ... [it] is completely cross-platform compatible and OS agnostic. With no software or special drivers required, the DL3 works with Windows, Linux, MacOS, Android phones and tablets, Chromebooks, and embedded systems - any system that can utilize USB Mass Storage." https://support.datalocker.com/support/solutions/articles/4000076369-dl3-dl3-fe-user-manual I'm using ubuntu 18.04 and have never had any issue using the datalocker DL3

FedKad avatar
cn flag
What is the file system type of the external drive?
neverdimed avatar
gf flag
@FedKad thanks for your Q, i added an update
oldfred avatar
cn flag
If not using Linux format, it will not support Linux ownership & permissions. If using NTFS they are lost. But if only data, not system files, you can easily restore standard permissions for your data.
Score:0
gf flag

as someone noted - permissions are lost because the external drive is using a different file system. Adding --no-p (after -a) will stop the changes being flagged, this seems the simplest solution

note that archive (-a) implies: -rlptgoD, and from the rsync man page:

" --no-OPTION: You may turn off one or more implied options by prefixing the option name with "no-". Not all options may be pre‐fixed with a "no-": only options that are implied by other options (e.g. --no-D, --no-perms) or have different defaults in various circumstances (e.g. --no-whole-file, --no-blocking-io, --no-dirs). You may specify either the short or the long option name after the "no-" prefix (e.g. --no-R is the same as --no-relative).

For example: if you want to use -a (--archive) but don’t want -o (--owner), instead of converting -a into -rlptgD, you could specify -a --no-o (or -a --no-owner). The order of the options is important: if you specify --no-r -a, the -r option would end up being turned on, the opposite of -a --no-r. Note also that the side-effects of the --files-from option are NOT positional, as it affects the default state of several options and slightly changes the meaning of -a (see the --files-from option for more details)."

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.