2

I am looking for a feature similar to that existed in Earlier Ubuntu releases (until Ubuntu Lucid AFAIK).

The feature was, When I click on the drive icon on the left side bar of nautilus, NTFS drives get mounted and when I want to run any script and/or executable files on that drive, The nautilus display a message asking "Whether it should display the file, or Run or Open in terminal etc" like the following image

Image of the message displayed when clicked on an executable file

It seems, that feature is removed since Ubuntu 10.10.

My question is How can I configure nautilus to do that kind of mounting with exec permission? or In other words, "How can I get that feature back in precise?"

I am asking this question because, I have to run several executable scripts in NTFS partition and don't want to mount it automatically with fstab and also with terminal.

Note:

I can mount the NTFS drives with exec permission from terminal using this simple command:

udisks --mount /dev/sda2 --mount-options umask=022

So, I am sure that, they can be mounted with executable permission. I just do not like to mount them using terminal, I can also add a script in the startup, but I want to know, How to configure to do this.

Also, I don't think, it is a bug, since that feature existed in the Ubuntu 10.04 and was working greatly. I think, this is a change in default policy, which I need to find.

6
  • But, I am still able to mount the drive with executable permission using command line
    – Anwar
    Jun 25, 2012 at 16:56
  • This bug report seems related, but it's not solved.
    – Samik
    Jun 25, 2012 at 19:13
  • 1
    @LordofTime while ntfs doesn't support execute bit, ntfs-3g does. It uses the ntfs partition's data and ACLs to implement Linux-type file permission and ntfs-3g is used by default to mount ntfs partitions.
    – Samik
    Jun 25, 2012 at 19:41
  • 1
    @Samik Also, Windows uses some combination of NTFS features to implement somthing like an executable bit, too. When you download a program from an Internet source in Windows and try to execute it, you are asked if you really want to run it. There is a check-box you can check not to be warned again. This setting survives the file being moved, a different user running it, or it being moved over a local network to a different Windows machine. Jul 23, 2012 at 16:07
  • @EliahKagan, found this information is managed by alternate file-streams here in an answer in Super User, but as the answer says, it's not only for executable files but for any files downloaded from internet, so it's really not an equivalent for executable bit, right?
    – Samik
    Jul 23, 2012 at 16:33

1 Answer 1

0

Before Ubuntu 10.04 HAL was used to mount removable devices instead of udev. So, by configuring /usr/share/hal/fdi/policy/10osvendor/25-ntfs-3g-policy.fdi i.e. adding

<merge key="volume.policy.mount_option.exec" type="bool">true</merge>

under the

<match key="volume.fstype" string="ntfs">

section, one could automate mounting them with exec permission, but now with udev you can write an udev-rule like

KERNEL="sd*|hd*", ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", ENV{pmount_options}="%E{pmount_options} -t ntfs-3g --umask 022"

to mount ntfs partitions with executable permission.

Create a rule file in /etc/udev/rules.d. Under /etc/udev/rules.d the udev .rule files should be named in the same manner as for init scripts, i.e. priority-filename.rule form. Whenever a sdxy or hdxy is added to your system with ID_FS_TYPE device key matching to ntfs then this rule sets the pmount options. You can find details on creating udev rules Writing udev rules by Daniel Drake and obviously in man 7 udev.

3
  • Can you illustrate more on creating udev rules
    – Anwar
    Jul 24, 2012 at 16:08
  • I think, you should add those information in the answer and also give a generic rules
    – Anwar
    Jul 24, 2012 at 16:34
  • @AnwarShah With so many options available for key-value pairs I think a generic rule would be very long and I dare not to mention those options which I don't understand properly. I've mentioned some of the options I'm familiar with, and then the page I've linked to explains writing the rules from ground-up. For an exhaustive list of keys, expressions I think the man page is right place to look for.
    – Samik
    Jul 24, 2012 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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