I'm using RHEL 6.5, andhave an auto-mounted external USB drive. Any and all files created in the mounted filesystem are given permission 700 for dirs and 777 for files. The chmod command does not change the permissions.
I want to use rsync to backup my files to the drive, but I don't want to lose my permission settings. My trial runs with "rsync -avh" preserve the time stamps and the user and group settings, but not permissions.
Where are these being controlled for such a drive, and how can I turn off this forced setting?
Best Answer
It all depends on the filesystem you are using on your external drive. Since you have mentioned that permission changing operations do not work, it is likely you have either NTFS or FAT32.
Since you want to make a backup, the best way to do that to different file-system would be to make an archive with a tool like
tar
or similar. They have command switches for preserving permissions etc.Regarding permissions of NTFS/FAT32 filesystems: while you can't control permissions of individual files or directories, you can specify permission which will be used when mounting the drive using
dmask
,fmask
andumask
options:uid
set the owner user of all filesgid
set the owner group of all filesdmask
controls permissions for directoriesfmask
controls permissions for filesumask
controls the bitmask of the permissions that are not present (defaults to the umask of current process)These can be either put into
/etc/fstab
or just added tomount
command as-o
arguments:If you want to put it in
/etc/fstab
instead, you have to put them underoptions
(4th column):