PDA

View Full Version : [ubuntu] After installing Ubuntu 12.04, cannot chmod file to be exectable on separate disk



sprilutsky
September 25th, 2012, 07:51 PM
Hi there,

After I performed fresh install of Ubuntu 12.04 on sda drive, I cannot change perms on one of the files to make it executable.

I own the file as a user, i ran chmod as user or root with either +x, or u+x, or 700. Command runs, but file is still rw, not rwx.

I even tried to right click on it using GUI, then click the box for the "executable". It marks it as executable, and then immediately removes it by itself.


Anyone ran into this before?

cortman
September 25th, 2012, 08:02 PM
Re-own it as your user


sudo chown username file

Then try changing the permissions:


chmod u+rwx file

Make sure you're logged in as your user when running chmod.

sprilutsky
September 25th, 2012, 08:11 PM
Already tried all that, do not work.

Morbius1
September 25th, 2012, 08:24 PM
Is the file in question sitting on an NTFS or FAT32 partition? You can't chown or chmod such a file.

sprilutsky
September 25th, 2012, 08:31 PM
I was able to before, than I was running Ubuntu 9.04.

sprilutsky
September 25th, 2012, 08:46 PM
I am thinking - 12.04 mounts it differently than 9.04. Can someone confirm/deny that

cortman
September 26th, 2012, 01:10 PM
I don't think so, but your question is a little unclear.

I know you'd tried some of the commands earlier- did you try them again in the sequence I gave?

Morbius1
September 26th, 2012, 02:05 PM
There was a change to the default mount parameters for NTFS partitions around maybe 10.04 or so - I can't remember exactly when. Before then all files would be 777 now all files are 600.

If this is an internal partition you can reproduce the way it was done back then by creating your own entry in fstab. Use the following template as a guide:

UUID=DA9056C19056A3B3 /media/Win ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0This will mount the NTFS partition with you as owner and all folders and files will have permissions of 777.

To find the correct UUID number for you partition run the following command:

sudo blkid -c /dev/nullCreate the mount point:

sudo mkdir /media/WinIf you have mounted the partition manually unmount it first then run the following command to mount it again with the new line in fstab:

sudo mount -a
Note: If you only want it to be accessible and executable to you then change the umask to 077. this will make all files and folders 700:

UUID=DA9056C19056A3B3 /media/Win ntfs defaults,nls=utf8,umask=077,uid=1000,windows_names 0 0