View Full Version : Fedora has changed permissions on a folder I copied hours ago!

11th August 2010, 12:29 AM
I can't see how this happened, but here's the story:

Just this afternoon I successfully copied my backed-up data (130gb) from an external HD to my fedora13 laptop.

That folder and all subfolders had been given read/write permission for all users via the nautilus advanced permissions tab in LinuxMint. (The HD is actually an internal in an external exclosure).

Now I check the folder and see it is marked with an X, and only the owner can access it.

Is there any alternative to re-copying all that data, and if not, how do I now delete the X'ed folder?

Many thanks

11th August 2010, 01:31 PM
If you were root when you copied the files, then the ownership would be changed to root on the copies. To keep ownership the same you need to use the -p argument to cp, or --preserve.

11th August 2010, 02:45 PM
I think there are several ways to fix this. It all depends on what you want to see, and if you are completely comfortable in the terminal. Rather than worry about changing ownership, I'll just cover changing permissions. (Although the other way is actually faster.)

Fast and dirty permissions method:

Mount the drive graphically.
Then, in a terminal ...
su -
(provide the root password)
cd /media
ls -a
(Note the name of your mounted drive)
chmod 777 -R (here give the name of your mounted drive)

(If you really want to watch all the bloodshed, add -v after the -R.)

To do this graphically:

(You'll still need the terminal here to get a root browser.)

su -
(give the root password)
nautilus --no-desktop
use that browser window to surf to the /media directory, and then right click the mounted drive and use the GUI tools to change permissions recursively to read & write for all users.

I hope I haven't forgotten anything here, but if I did, I'm very sure someone will be all too happy to call me down on it. (Normally, I just grope around until I accidentally land on the correct syntax.) <..:p..>

11th August 2010, 07:44 PM

Still interesting is the question who (if anybody) changed (if it indeed changed) folder permissions.

Whenever you copy (copy, not move) a file, the new file is created with a default permissions obtained from an account (strictly, a shell) property know as umask. By default, its value is 022, which means new directories are created with permissions of 755 and new files - with 644. Again, by default, files are created with you as an owner and your default group as group. Some programmes allow this behaviour to be influenced, like the "-p" command line option of "cp". So, there is a good chance that Fedora did not do anything unexpected - just that you did not expect what Fedora will do :-)

As a side note, there is a Gnome applet which runs in background and "fixes" names of some directories in your home directory to make them match your locale. However, I wouldn't blame this on it.


11th August 2010, 08:47 PM
A drawback of hiding things behind GUIs is that one isn't motivated to read man cp or man umask, or the Shell Execution Environment, so operations become mysterious and have unexpected results.