NTFS USB drive: sh-execution permission denied

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
myRooty
DD-WRT Novice


Joined: 13 Mar 2017
Posts: 9

PostPosted: Thu Mar 23, 2017 16:22    Post subject: NTFS USB drive: sh-execution permission denied Reply with quote
My final goal is to get running on my Kong dd-wrt
- 1st: transmission
- 2nd: miniDNLA

On the road to achieve this, I have run into a permission issue I simply cannot find to resolve.

My road so far:

The transmission guide tailored to my router (by user ismaelgokufox - thanks much) prerequisites having mounted ones:
- /JFFS
- /OPT
For what concerns SWAP, the solution in his guide is to create a SWAP file rather than using a partition with linux-swap as file system.

For this I have a USB stick, i.e. USB flash drive.

Now, my tools are very limited:
- my router
- my USB stick
- a MacBook Pro with NO installation rights and NO sudo access
- just to be clear: NO further computer, laptop, whatsoever at my hand

Furthermore, I am
- well, MOST HAPPILY, as it works like a charm: Many Thanks to Kong -
BOUND TO running a KONG build
(as my internet runs through my iPhone attached via USB to the first USB port of my router which BS builds are merely offering for Android phones for now);
BOUNT TO NTFS as file system for my USB stick
(as A) only EXTx and NTFS support symlinks (aka soft links) and B) not having the rights to install software on the MacBook I am dependent on (Mac) Disk Utility which supports only NTFS of the former noted two file systems)
BOUND TO (mac) TERMINAL
(as for the reasons stated above; so no PuTTY and stuff)

Googling, I have learned that Ismaelgokufox mount-binds a folder named 'opt' on his JFFS-mount-binded USB drive to /OPT rather than creating and mount-binding a separate/dedicated partition (nota bene: not mentioned in Ismaelgokufox's transmission installation guide).
For the sake of further applications probably needing /OPT properly mounted, I went for a dedicated /OPT partition; equally so in what regards SWAP.
With USB core support, USB Printer support (need that one), USB Storage support and Automount on,
the four NTFS partitions
- sda1: OPT (1 GB)
- sda2: SWAP (1 GB, to carry later to create SWAP file)
- sda3: DATA (approx. 60 GB)
- sda5: JFFS (1 GB)
(- sda4: ..mbr, I guess)
of my USB stick get easily recognized:
(dd-wrt via webgui)
cf. images below
(dd-wrt via terminal)
cf. image below

Telnetting to my router,
it only lists me folders and files or lets me access any folder after once having accessed an existing folder with cd + preceding slash.
However, it allows me to immediatly execute commands.
With
Code:
mount -o bind -t ntfs-3g /mnt/sda5 /jffs

mounting USB-opt-partition to /JFFS works like a charm
(ditto for mounting OPT)
cf. image below

Following the transmission installation guide, I can easily download Entware through the router (via telnet) onto the stick:
Code:
cd /jffs
mkdir scripts
wget -c -O entware.arm-setup.sh http://goo.gl/FUX7Nv
chmod +x ./entware.arm-setup.sh


And here, I run into the permission issue:
running
Code:
./entware.arm-setup.sh

in order to start the Entware installation, I get:
Code:
-sh: ./entware.arm-setup.sh: Permission denied
(cf. image below)

Permissions are stated as follows using command ls:
777 (rwxrwxrwx) for:
/dev, /dev/sda1-5, /tmp, tmp/mnt/sda1-5, tmp/mnt/sda5/scripts, /mnt, /mnt/sda1-5, /mnt/sda5/scripts, /jffs, /opt, /jffs/scripts
755 (rwxr-xr-x) for:
/root, /usr, /tmp/mnt, (/mnt -> /tmp/mnt)

Googling again, I came across a suggestion to specify executability via ntfs-3g, and notably at the end of the options as otherwise the exec option might get overwritten again.

However, even with:
Code:
mount -t ntfs-3g -o bind,users,rw,exec /mnt/sda5 /jffs

(and ditto for mounting OPT)
I continue getting:
Code:
-sh: ./entware.arm-setup.sh: Permission denied
(cf. image below)



How Sad do I resolve this? Question ?
(in order to get entware and ultimately transmission installed, and later in addition miniDNLA running)



Router: Asus rt-ac68u
Firmware: Kong dd-wrt.v24-K3_AC_ARM_STD_r31050 (01/01/17)



USB-recognition-webgui.png
 Description:
 Filesize:  56.06 KB
 Viewed:  9506 Time(s)

USB-recognition-webgui.png



USB-recognition-webgui-volumes-1-3.png
 Description:
 Filesize:  58.78 KB
 Viewed:  9506 Time(s)

USB-recognition-webgui-volumes-1-3.png



USB-recognition-webgui-volumes-4-5.png
 Description:
 Filesize:  52.05 KB
 Viewed:  9506 Time(s)

USB-recognition-webgui-volumes-4-5.png


Sponsor
myRooty
DD-WRT Novice


Joined: 13 Mar 2017
Posts: 9

PostPosted: Thu Mar 23, 2017 16:27    Post subject: Reply with quote
here the rest of the print screens


USB-recognition-terminal.png
 Description:
 Filesize:  14.85 KB
 Viewed:  9504 Time(s)

USB-recognition-terminal.png



USB-recognition-volumes-mount-binded.png
 Description:
 Filesize:  35.16 KB
 Viewed:  9504 Time(s)

USB-recognition-volumes-mount-binded.png



USB-partition-file-execution-permission-denied.png
 Description:
 Filesize:  8.65 KB
 Viewed:  9504 Time(s)

USB-partition-file-execution-permission-denied.png


myRooty
DD-WRT Novice


Joined: 13 Mar 2017
Posts: 9

PostPosted: Thu Mar 23, 2017 17:14    Post subject: Reply with quote
here the print screen of the drive recognition status with the
terminal command
Code:
cat /proc/mounts

after mount-binding them using ntfs-3g

maybe also I just have to make the dd-wrt system aware about the modification you have made while mounting with -o exec analog to the last example on this page http://en.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html ? But even if yes, I would not know how (as the commands shown are not properly displayed) ?



USB-recognitions-volumes-mount-binded-terminal-command-cat.png
 Description:
 Filesize:  48.46 KB
 Viewed:  9495 Time(s)

USB-recognitions-volumes-mount-binded-terminal-command-cat.png


egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12873
Location: Netherlands

PostPosted: Thu Mar 23, 2017 18:00    Post subject: Reply with quote
Did you enable JFFS2 support on the Administration tab?
If so you should disable it and probably erase nvram, if you are on it then update to the latest kong build Smile

You are in a difficult situation, for a windwos PC I include a document with instructions, hope that this helps you



DDWRT USB storage support.doc
 Description:

Download
 Filename:  DDWRT USB storage support.doc
 Filesize:  509.5 KB
 Downloaded:  298 Time(s)


_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
myRooty
DD-WRT Novice


Joined: 13 Mar 2017
Posts: 9

PostPosted: Thu Mar 23, 2017 19:50    Post subject: Reply with quote
hi egc

regarding JFFS2 support
all guides regarding JFFS2 support I have read so far (incl the ones here, incl the one speaking of adding USB storage to /JFFS) say that I shall enable it. why do you think I should not?

regarding updating
no go. It is not feasible for me to loose my internet connection or basically as worse brick my router with upgrading to newest release just for the fun of it. the Kong release on my router is well long-tested by other users as an extremely stable and full-working one. last but not least, the Kong release on my router is a very recent one.

regarding your WIN PC document
thank you. Smile BUT as stated my tools include but a MacBook. Sad also this document does not cover anything about possible execution permission issues with a /JFFS nor /OPT mounted NTFS USB partition or drive?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12873
Location: Netherlands

PostPosted: Thu Mar 23, 2017 22:24    Post subject: Reply with quote
Enabling JFFS2 support on the Administration tab is for dedicating the remaing NVRAM as a drive where you can read /write and which gives you permanent storage, this gives you perhaps 20KB storage and the NVRAM wears out pretty quick usually already after 200-300 write cycles.

Fortunately you have a USB stick so you can not enable JFFS2, the problem reported by many people is that after enabling it (and a part of your NVRAM is dedicated/formatted as a drive), you can not simply disable it and use an USB stick. Maybe a bug, but many people report that they have to erase NVRAM first before they get a USB stick working.

The guide is not only for windows it describes what kind of formatting you can use and how dd wrt automounts (simply by labeling an ext2 formatted partition as jffs or opt), it also describes how to mount by UUID

Your problems stem from the above mentioned, I use a USB stick on different routers and have no problem with reading/writing/executing

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
myRooty
DD-WRT Novice


Joined: 13 Mar 2017
Posts: 9

PostPosted: Fri Mar 24, 2017 0:33    Post subject: Reply with quote
Thank you for your specifications. I am surprised to hear about such problems as the official dd-wrt wiki JFFS guide specifies under the sub chapter 'Add USB Storage' that JFFS2 needs to be enabled. Maybe then the wiki guide might need an update.

For my USB stick, it works well regarding read and write (and delete). My problem lies with getting 'permission denied' only when trying to run a .SH-file (exec file), cf. my start post.

For your guide, as much as I understand it only mentions the possibility of NTFS (as cf. my start post) but elaborates on the how-to specifically only with EXTx (do know that an UUID of EXT is different from a NTFS UUID, so you cannot apply EXTx rules as is to handling NTFS nor would e.g. an 'JFFS' labelled NTFS partition get automatically mounted - all tried before finally I started to feel Crying or Very sad .. ).

You say you use a USB stick without problems. Supposing you have read my initial post, your USB stick must in consequence be formatted as NTFS for all of its partitions, also for the OPT and the JFFS partition, just like mine as you mention it as master example. Now that is awesome, and of course I am very keen to know how you managed to mount your NTFS partition to JFFS and your other NTFS partition to OPT and you are able to execute a .SH-file (exec file) on your JFFS partition? What were the steps? What are your settings to have got this work on your NTFS formatted JFFS partition?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12873
Location: Netherlands

PostPosted: Fri Mar 24, 2017 6:50    Post subject: Reply with quote
This is from the guide:

Quote:
1. Ext2 (USB stick) or Ext4 or Fat32 or NTFS for file sharing, if you are using the usb stick to swap between computers and want FAT32 or NTFS then make this the first partition otherwise windows cannot recognize it
2. Ext2 (USB stick) or Ext4 /jffs partition, if you label the partition as jffs then the partition will automount to /jffs.
3. Ext2 (USB stick) or Ext4 /opt partition, if you label the partion: opt , then the partition will automount to /opt
4. If your router has Ram below 64 MB then you can make a small linux swap partition (just choose 512MB and format as linux swap), the partition mounts automatically as /swap. See figure 2
This is however not recommended on an USB stick, and will not be discussed further. See: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=968683


As you could have read: for an /opt or /jffs partition format with ext2 or ext4

The linux ddwrt shell has the commands to partition (fdisk) and format (mke2fs) (I have never used it so I am not sure about the correct working)
see: https://www.dd-wrt.com/wiki/index.php/How_to_-_Format_and_Partition_External_Storage_Device

Oh and where did you read that you should enable JFFS2 support for using an USB stick?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
myRooty
DD-WRT Novice


Joined: 13 Mar 2017
Posts: 9

PostPosted: Fri Mar 24, 2017 17:28    Post subject: Reply with quote
wow wow, man, stay nice

I am very grateful for your hints and your expertise and everything that helps me to move forward with my NTFS endeavor Wink
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum