Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had copied a directory contain C language source code files and some shell scripts from my Ubuntu 12.10 64 bit laptop to a portable hard disk some time back. I had copied it under root login. Now, today when I copied it back from the portable disk to the same laptop under root login, I observed that the file permissions had changed from the original 755 to 400 which caused some scripts to fail. How should I copy to the hard disk so that the directory and its content retain the permissions?

share|improve this question
up vote 3 down vote accepted

Your external drive is using either FAT32 or NTFS, which do not support permissions. You either need to switch to a unix compatible format on the external drive, or you can use tar ( or the gui archive utility ) to preserve the correct permissions in the archive while it is stored on such a disk.

share|improve this answer

Maybe this is not the case, but it may depend on the filesystem: e.g. FAT32 formatted drives do not support file permissions. have a look at this question: How do I change file permissions on a FAT32 drive?.

Other than that, I would have a look at rsync manual.

rsync -aPv what where

-a is for archive mode, which is often what you want: permissions/owner/group preserved, recursive behavior, and quite a lot of other staff. (-P and -v increase the verbosity and gives you a better look)

specifically, the -p flag will keep your permissions.

share|improve this answer
is it -p or -P ? – Jay Jan 9 '14 at 14:41
-p is for permissions only. you may want to use -a instead. -P stands for --progressive --partial, which means keep the partial transferred files and gives you something to look at while the file transfer is going on. so a totally unrelated option, but useful. – MarcDuQuesne Jan 9 '14 at 14:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.