[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
Need help debugging a simple script to enable NTFS write on HDD
04-01-2011, 06:34 PM
Post: #1
Need help debugging a simple script to enable NTFS write on HDD
I am able to telnet to nmt (A100) and run these commands to enable the write access to the NTFS format partition:
Code:
/etc/init_nmt stop
umount /dev/hda3
mount -t tntfs -o rw,uid=1001,gid=1001,umask=00,nls=utf8,errors=continue,mft_zone_multiplier=1 /dev/hda3 /opt/sybhttpd/localhost.drives/HARD_DISK
/etc/init_nmt start
/opt/sybhttpd/default/setups.cgi

I want to run this as a cgi script on nmt from a html file, so I created a simple html file (NTFS.html) with the code:
Code:
<html>
<body>

<a href="http://localhost.drives:8883/HARD_DISK/NTFS.cgi">
Run from HARD_DISK
</a>

</body>
</html>

I then created a simple cgi script (NTFS.cgi):
Code:
#!/bin/sh

/etc/init_nmt stop
umount /dev/hda3
mount -t tntfs -o rw,uid=1001,gid=1001,umask=00,nls=utf8,errors=continue,mft_zone_multiplier=1 /dev/hda3 /opt/sybhttpd/localhost.drives/HARD_DISK
/etc/init_nmt start
/opt/sybhttpd/default/setups.cgi
exit 0

I copied the 2 files above to the HDD (partition3, NTFS), from nmt I browsed to NTFS.html, ran it, but it returned: "Failed to execute the requested commands" error.

Can anyone help me to debug the cgi script? the same commands in the cgi script worked when I ran them from the telnet, but failed when I ran them as cgi script from nmt.

Thanks in advance!
Find all posts by this user
Add Thank You Quote this message in a reply
04-01-2011, 07:14 PM
Post: #2
RE: Need help debugging a simple script to enable NTFS write on HDD
Are you running the latest firmware? It should be fixed with it.

Quote:1. Still same NMT apps 00-17-091216-15-POP-402
2. Fixed jerky playback VIDEO TS files through SMB
3. Fixed unable to play FLAC files with extra ID3 tag.
4. Fixed NTFS mount internal HDD as read-only bug.
5. Fixed OSD Message erased when updating subtitle
- Issue fixed for all sub type, except VOBSUB
6. Fixed halfway through Audio playback, jumps back to listing page.
7. Fixed Photo transition not working.

http://www.networkedmediatank.com/showth...?tid=51049

C-200, A-110 both playing from a DIY Linux Raid 5 server.

Remuxes, Captures and Transcodes done on a desktop running;
Win7, Intel i7 hexacore processor with 24 GB ram, WD VR OS drive and a WD Black 2 TB data drive.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to nuke12 for this post
04-01-2011, 07:28 PM
Post: #3
RE: Need help debugging a simple script to enable NTFS write on HDD
Yes I am running the latest FW, I updated from USB first, didn't fix the NTFS bug as it should, so I updated again using the online update option, still didn't fix the NTFS bug.

I am able to run the manual commands from telnet to umount and re-mount using the correct setting (as I posted above), but these same commands failed to run from nmt as a cgi script.

If anyone has insights about this issue or about the cgi script, please help. Thanks!
Find all posts by this user
Add Thank You Quote this message in a reply
04-01-2011, 07:44 PM (This post was last modified: 04-01-2011 07:55 PM by nuke12.)
Post: #4
RE: Need help debugging a simple script to enable NTFS write on HDD
I would test this, but I don't have an A-100. I found the problem when doing some work on the A-110 but they have not released new firmware for it yet.

What do you see when you telnet in and just type "mount" at the command prompt? Could you paste it here?

I can't believe Syabas screwed this up. It should be such a simple fix.

P.S. - Even if the commands have to be executed, there is a way simpler method to do this, then what your using.

C-200, A-110 both playing from a DIY Linux Raid 5 server.

Remuxes, Captures and Transcodes done on a desktop running;
Win7, Intel i7 hexacore processor with 24 GB ram, WD VR OS drive and a WD Black 2 TB data drive.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to nuke12 for this post
04-01-2011, 09:00 PM (This post was last modified: 04-01-2011 09:02 PM by user33.)
Post: #5
RE: Need help debugging a simple script to enable NTFS write on HDD
this is what I got when I typed mount:
Code:
/ # mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,nodiratime)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
none on /sys type sysfs (rw)
/dev/hda1 on /mnt type ext3 (rw,data=ordered)
/dev/hda3 on /opt/sybhttpd/localhost.drives/HARD_DISK type ntfs (ro,noatime,nodiratime,uid=1001,gid=1001,fmask=0177,dmask=077,nls=utf8,errors=co​ntinue,mft_zone_multiplier=1)
/dev/sda1 on /opt/sybhttpd/localhost.drives/USB_DRIVE_A-1 type ext3 (rw,data=ordered)

as you can see, the ntfs drive is mounted as ro

after I ran the commands from telnet, it mounts correctly:
Code:
/ # mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,nodiratime)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
none on /sys type sysfs (rw)
/dev/hda1 on /mnt type ext3 (rw,data=ordered)
/dev/sda1 on /opt/sybhttpd/localhost.drives/USB_DRIVE_A-1 type ext3 (rw,data=ordered)
/dev/hda3 on /opt/sybhttpd/localhost.drives/HARD_DISK type tntfs (rw,uid=1001,gid=1001,umask=00,nls=utf8,errors=continue,mft_zone_multiplier=1)

now it's mounted as rw, so it is certain that at least in my nmt hardware with the latest FW and nmt apps (downloaded from PCH website), the NTFS write access bug has not been fixed.

there is also another problem: even with the NTFS mounted as rw, I can install the apps from CSI, but they all failed to actually function before and after I rebooted the nmt. I tried 2 apps: NTFS-3g and Telnetd 1.14.1, both failed to function. I believe it has something to do with the NTFS partition mounting bug. this is frustrating. (I can run telnetd from USB but I would like to install it as a nmt app so that I don't have to run the script everytime from USB to install the telnetd)

Quote:P.S. - Even if the commands have to be executed, there is a way simpler method to do this, then what your using.

Can you tell me how?
Find all posts by this user
Add Thank You Quote this message in a reply
04-01-2011, 09:23 PM
Post: #6
RE: Need help debugging a simple script to enable NTFS write on HDD
Do you have CSI installed? If not install it after you telnet in and enable read-write on the partition.

If not installed then just pick a simple app from the selection that you might use. Basically anything.

After it is installed, place the following lines in the "start_app.sh" file. At the end and before "exit 0" line. Use notepad++ to add the lines.
Code:
sleep 2
umount /dev/hda4
mount -t tntfs -o rw,uid=1001,gid=1001,umask=00,nls=utf8,errors=continue,mft_zone_multiplier=1 /dev/hda4 /opt/sybhttpd/localhost.drives/HARD_DISK_A4

This is easier because it will get run after every reboot and you don't have to do anything.

C-200, A-110 both playing from a DIY Linux Raid 5 server.

Remuxes, Captures and Transcodes done on a desktop running;
Win7, Intel i7 hexacore processor with 24 GB ram, WD VR OS drive and a WD Black 2 TB data drive.
Find all posts by this user
Add Thank You Quote this message in a reply
04-01-2011, 10:24 PM
Post: #7
RE: Need help debugging a simple script to enable NTFS write on HDD
Nuke's suggestion is best,

however if sticking to cgi make sure the first 3 lines output are:
blank
blank
Content-Type: text/html

Also if CGI is running from same partition then I think it may not unmount.

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Add Thank You Quote this message in a reply
04-01-2011, 10:34 PM (This post was last modified: 04-01-2011 10:40 PM by user33.)
Post: #8
RE: Need help debugging a simple script to enable NTFS write on HDD
(04-01-2011 09:23 PM)nuke12 Wrote:  Do you have CSI installed? If not install it after you telnet in and enable read-write on the partition.

If not installed then just pick a simple app from the selection that you might use. Basically anything.

After it is installed, place the following lines in the "start_app.sh" file. At the end and before "exit 0" line. Use notepad++ to add the lines.
Code:
sleep 2
umount /dev/hda4
mount -t tntfs -o rw,uid=1001,gid=1001,umask=00,nls=utf8,errors=continue,mft_zone_multiplier=1 /dev/hda4 /opt/sybhttpd/localhost.drives/HARD_DISK_A4

This is easier because it will get run after every reboot and you don't have to do anything.

Yes, I have CSI installed and also installed 2 apps, both failed to function (won't start).


(04-01-2011 10:24 PM)lordy Wrote:  Nuke's suggestion is best,

however if sticking to cgi make sure the first 3 lines output are:
blank
blank
Content-Type: text/html

Also if CGI is running from same partition then I think it may not unmount.

Thank you! I think you have just found the cause why the script failed: it could not mount because the CGI is running from the same partition.

I still don't have any clue why the CSI apps won't run after CSI installer reported installed successfully, likely because the NTFS partition always boots up as read-only due to this firmware bug?
Find all posts by this user
Add Thank You Quote this message in a reply
04-02-2011, 02:52 AM
Post: #9
RE: Need help debugging a simple script to enable NTFS write on HDD
May I know the firmware version on your A-100 currently?
Find all posts by this user
Add Thank You Quote this message in a reply
04-02-2011, 07:11 PM (This post was last modified: 04-02-2011 07:12 PM by nuke12.)
Post: #10
RE: Need help debugging a simple script to enable NTFS write on HDD
(04-02-2011 02:52 AM)rolandhii Wrote:  May I know the firmware version on your A-100 currently?

Looks like you may not get a reply. I would like to know the answer also. I should have asked in my earlier post but the OP insisted, he had the most recent firmware. But if he does come back, he should have 01-17-110314-15-POP-402. Also there is a note with this firmware that says "IMPORTANT: Please update to 01-17-101217-15-POP-402 firmware first before updating to this firmware". I wonder if that was done?

I assure you, I'll check this feature when the A-110 firmware is released.

C-200, A-110 both playing from a DIY Linux Raid 5 server.

Remuxes, Captures and Transcodes done on a desktop running;
Win7, Intel i7 hexacore processor with 24 GB ram, WD VR OS drive and a WD Black 2 TB data drive.
Find all posts by this user
Add Thank You Quote this message in a reply
04-05-2011, 06:05 PM
Post: #11
RE: Need help debugging a simple script to enable NTFS write on HDD
I checked the newly released A-110 firmware today and it works fine mounting a NTFS partition on the hard drive in the read-write mode.

C-200, A-110 both playing from a DIY Linux Raid 5 server.

Remuxes, Captures and Transcodes done on a desktop running;
Win7, Intel i7 hexacore processor with 24 GB ram, WD VR OS drive and a WD Black 2 TB data drive.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to nuke12 for this post
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Star [Apps] Bierdopje 4 NMT PHP script SilverViper 4 1,312 11-26-2012 04:57 PM
Last Post: Djiest
  how to get myihome lite on internal hdd jenkyceej 1 1,551 05-20-2011 03:14 PM
Last Post: dc11ab
  Help with Server Timeout Error running a script hindibuff 0 1,674 03-29-2011 06:21 AM
Last Post: hindibuff
Bug Executing a script on the server from the NMT? johnk 6 3,188 02-21-2011 10:59 PM
Last Post: johnk
  [AUDIO] lastfm script (bookmarks, auto-login, etc.) mk11 81 35,310 10-09-2010 01:45 AM
Last Post: opfeifer
  Android app to access internal hdd crisarn 3 2,475 10-02-2010 12:03 PM
Last Post: dc11ab
  Access over SMB writes in NTFS partition? hfernandes 7 2,834 09-10-2010 04:59 AM
Last Post: hfernandes
  Transfering files from the internal HDD on a USB Drive rypm77 5 2,675 07-25-2010 01:11 PM
Last Post: JackSpratt
  HDD Temperature monitoring subpop 0 1,313 07-16-2010 10:32 AM
Last Post: subpop
  Problem with Mac and HDD laurasirco 18 3,508 07-04-2010 06:19 PM
Last Post: laurasirco

Forum Jump: