New File is Created as Executable

Whenever I create a new file in my other hard drive partitions(they are like “Windows” D or F drives), it’s created as an executable file for user, group and others. Whenever I try to open it with Pluma, it shows me that message box that it’s an executable file and asks if I want to run it or simply display the contents.

I tried to change the permissions with chmod, but it’s not working. This is not what happens in my /home or root directories(Linux partitions). Even the .txt files that were created with Notepad when I used Windows have become executable under Linux.

What can I do here guys?

Are the files stored on a protected drive? This may explain why the permissions on the files are not changing.

Have you tried the chmod command on the files with a sudo prefix?

I don’t know what you mean by protected, but if it were the case how do I undo it?
Yes I’ve tried with sudo, but nothing happens.
Interesting this is ‘allow executing file as program’, from the properties of a file, is uncheckable too!:confused:

Are these partitions nfs/cifs? well, to provide compat with windows files are created with -x set. Samba does not transmit unix permissions. Take a look at “mount cifs” and look for parameters you can set with the -o flag like dir_mask=0775,file_mask=0664

Yea these are NTFS partitions.

Hi @Apollonius, Can I assume these were mounted in Caja by selecting the partition automatically detected as something like a “123GB Filesystem”?

If so, perhaps someone can help with how to control the ‘x’ permission in such a mount with Caja as I don’t have a local ntfs partition to test.

I personally avoid file managers mounting anything as it always seems to do something I don’t like. Instead, I permanently mount local and network drives with a line for each in the File System Table (/etc/fstab).

You may have better luck finding a friendly page on how to do this than I did. Here’s Ubuntu’s community page with examples including ntfs:

https://help.ubuntu.com/community/Fstab

The bottom line is ntfs has no ‘x’ permission so its value completely depends on how it’s mounted and is all or nothing. The format differs slightly in /etc/fstab than the sudo mount command but not too much so one can test the mount parameters first.

HTH

1 Like

Thanks for the tip! I will certainly give it a try.

I have three NTFS partitions, and they are named: Entertainment, Files and Programs and the other is the Widnows C drive where Windows is installed named “87 GB Volume”. All three partitions show similar trait when I open a new file.

Could you reinstall all of your windows partitions as win32? That is to say, I am wondering of this is still an issue with win32 partitions.

Ok… scratch that…

I have just read that Windows 8 onward will not install on anything other than NTFS.

However, Windows will happily read and write to Win32 drives and partitions. Similarly, Linux will also read and write to Win32.

So, if it was me, I would leave the Windows partition alone. But, would reformat all of the other storage partitions that are used by both Windows and Linux as Fat32. That way, on those partitions, the file permission issue should go away.

1 Like

I have exactly the same plan. I’m just keeping Windows(and the NTFS) partitions purely because of academic purposes. When everything clears out, I’m going to remove Windows and reformat all the other drives too. Maybe will do a complete reformat of my whole hard drive and perform a clean UM installation!:slight_smile:

I just don’t have the time and scope just yet for that!

I should say, I also use windows for one or two windows programs that are linked to work that I cannot get for Linux.

However, I just use Virtualbox with Windows installed on a virtual machine. It just saves all of the hassle of having real-world differing partitions for Windows and Linux.

It’s also possible to create a folder on your host machine and then, inside the settings manager of your virtual machine, set this folder as a shared folder between host and guest. The weird thing is, even though the host’s shared folder is on a partition that is formatted to, say, ext4, the virtual Windows machine has no problem reading and writing to it as if it was a Win32/NTFS drive. So, Virtualbox must be working some kind of magic on that front. Suffice to say, I don’t care, it just works and the files are immediately accessible from the Linux host side and there are no Linux permission problems with files in that shared folder, as far as I am aware.

1 Like

Just to clarify. My shared folder is on an ext2 partition. I don’t know if that is relevant or not. But, thought it best to mention in in case it is.