Tuesday, April 23, 2024
 Popular · Latest · Hot · Upcoming
34
rated 0 times [  34] [ 0]  / answers: 1 / hits: 23769  / 3 Years ago, sun, july 11, 2021, 9:02:10

If I try to set this option for a file on an external drive it just unmarks itself. Doing chmod +x has no effect. The drive is mounted with default options.


More From » permissions

 Answers
7

Your external disk is likely formatted NTFS or FAT32. Those filesystems do no support Linux file permissions.



You've now at least five options:




  • Just copy it to the desktop (or your Home folder) and set the permissions on that file.

  • Backup the data on it and reformat the drive to the ext4 filesystem. This can be done using the Disk Utility or GParted

  • Execute the file with a program, open a terminal and run:


    • for Bash scripts: bash /path/to/your/file.sh

    • for Python scripts: python /path/to/your/file.py

    • for Perl scripts: perl /path/to/your/file.pl

    • for windows executables: wine /path/to/your/file.exe

    • for 32-bit binaries: /lib/ld-linux.so.2 /path/to/your/file

    • for 64-bit binaries: /lib/ld-linux-x86-64.so.2 /path/to/your/file


  • Copy the file to your computer (e.g. home folder), set the execute bit on it and run it. (this cannot be done for all files)

  • (possibly dangerous) Mount the partition with the execute bit set for all files. To do so, follow these instructions:




    1. Mount the partition (by opening it in a file browser for example)

    2. Open a terminal and run:



      sudo mount -o remount,fmask=027 /media/YOURDRIVE


      If you cannot write / access files, run the command with ,uid=$(id -u) after fmask=022:



      sudo mount -o remount,fmask=027,id=$(id -u) /media/YOURDRIVE



    "Possibly dangerous" because you grant execute permissions to all files, only use this option if the other methods do not work.



[#44569] Monday, July 12, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
errettas

Total Points: 160
Total Questions: 118
Total Answers: 91

Location: Laos
Member since Fri, Sep 11, 2020
4 Years ago
;