[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 
[200] Local disc name in NMT browser
04-18-2012, 08:38 PM (This post was last modified: 04-18-2012 08:39 PM by xray.)
Post: #1
Local disc name in NMT browser
Hello Guys,

I'm trying to find out how popcorn C-200 is naming the hard disks in the NMT hard disk file browser.

I have a disk mounted

/dev/md0 on /opt/sybhttpd/localhost.drives/SATA_DISK_MD0

But if i list the devices

http://nmt_ip:8008/system?arg0=list_devices

I'm getting no "name" variable.

Code:
<device>
<accessPath>SATA_DISK_MD0</accessPath>
<name/>
<type>harddisk</type>
</device>

and not like this:

Code:
<device>
<accessPath>SATA_DISK_MD0</accessPath>
<name>SATA_DISK_MD0</name>
<type>harddisk</type>
</device>

What should i do to have valid "name" recognized by syb_framework?
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 08:41 PM (This post was last modified: 04-18-2012 08:42 PM by accident.)
Post: #2
RE: Local disc name in NMT browser
that's because the mounts are made from the settings, not the settings made from the mounts... Your also on a 200, there is a slight disconnect in the area of drives and shares between the gaya ui and the api so it may not always line up exactly no matter how hard you try. physically attached drives are usually pretty good though.

change the volume label of the drive itself and you don't need to do anything fancy to make it work and a path of file:///name of drive/ will be there.
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 08:44 PM
Post: #3
RE: Local disc name in NMT browser
(04-18-2012 08:41 PM)accident Wrote:  that's because the mounts are made from the settings, not the settings made from the mounts... Your also on a 200, there is a slight disconnect in the area of drives and shares between the gaya ui and the api so it may not always line up exactly no matter how hard you try. physically attached drives are usually pretty good though.

change the volume label of the drive itself and you don't need to do anything fancy to make it work and a path of file:///name of drive/ will be there.

i did already a

tune2fs -L "SATA_DISK_RAID" /dev/md0

but still the same issue Sad

/dev/md0 contains an ext3 fs.
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 08:46 PM (This post was last modified: 04-18-2012 08:46 PM by accident.)
Post: #4
RE: Local disc name in NMT browser
you may need to reboot the hardware for the api to pick that up.

then I would skip your mount and you should find the drive mounted to /name of drive (if you ls / you'll see it)
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 08:49 PM (This post was last modified: 04-18-2012 08:49 PM by xray.)
Post: #5
RE: Local disc name in NMT browser
well this FS is mounted by a script created by me. The script is executed as a part of nmt applications. So the FS label i assume will not be recognized by the firmware itself during the boot. Because the md0 device is assembled/created after the hw booted and starting the nmt apps. Maybe i need to reload some base service after mounted the fs?
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 08:52 PM
Post: #6
RE: Local disc name in NMT browser
ah.. so it can't be discovered by the pch and automounted? not sure what you need to do to fix it, never really heard of anyone dealing with needing to mount a drive on their own.. best recommendation here is wander around the drive and try to find the normal mount script for a drive to see what your missing.
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 08:58 PM (This post was last modified: 04-18-2012 09:02 PM by xray.)
Post: #7
RE: Local disc name in NMT browser
Well let me explain what i did Smile

I have installed the NMT apps on an internally attached USB drive.
I have two physical disks installed into the PCH.
I have compiled kernel modules and mdadm to support RAID on the PCH.
The script which is started by the nmt app "local" is loading the kernel raid modules, assembling the array and mounting it.
Thats why it is mounted the "disk" after the normal startup of the PCH.
Find all posts by this user
Add Thank You Quote this message in a reply
04-18-2012, 09:05 PM
Post: #8
RE: Local disc name in NMT browser
I would look and find the normal scripts the framework calls to mount/detect the drives then.. it's probably something minor you can easily add to your script
Find all posts by this user
Add Thank You Quote this message in a reply
04-19-2012, 09:20 PM
Post: #9
RE: Local disc name in NMT browser
After a little reverse engineering i found out how it is working.

There is a file called /tmp/usb_name.txt where you have to add your mount point name from dir /opt/sybhttpd/localhost.drives/

Example:

If /dev/md0 is mounted to /opt/sybhttpd/localhost.drives/SATA_DISK_MD0

You have to append the line

"SATA_DISK_MD0|SATA_DISK_MD0" to /tmp/usb_name.txt

like:
C200[~]# cat /tmp/usb_name.txt
SATA_DISK_B4|SATA_DISK_B4
USB_DRIVE_C-1|USB_DRIVE_C-1
USB_DRIVE|USB_DRIVE
SATA_DISK_MD0|SATA_DISK_MD0


Where the first string before the pipe (|) is the mountpoint name and the second is the label which will be displayed on the NMT GUI browser.
I simply add the same string as name if the md device has no label.

If it has a label then i will apeend the label as second param:

"SATA_DISK_MD0|Disk_Label_what_the_disk_has" to /tmp/usb_name.txt

Like
C200[~]# cat /tmp/usb_name.txt
SATA_DISK_B4|SATA_DISK_B4
USB_DRIVE_C-1|USB_DRIVE_C-1
USB_DRIVE|USB_DRIVE
SATA_DISK_MD0|Disk_Label_what_the_disk_has

When i umount the device it will remove the line from /tmp/usb_name.txt aswell.
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [100/200/300/400] Cross Compile Request Thread - For all NMT Series vaidyasr 30 6,380 05-19-2013 02:59 AM
Last Post: studlee2
  [100/200/300/400] How to install remote syslog server on NMT A-200 jwalczak 0 209 05-10-2013 05:00 PM
Last Post: jwalczak
Heart [200] NMT remote iPhone native app for C-200 vise_guy 237 73,784 05-10-2013 09:57 AM
Last Post: DAVE1971
  [100/200/300/400] Do NMT devices reply to M-SEARCH SSDP requisitions? pflynn 0 284 02-28-2013 04:05 PM
Last Post: pflynn
  [200/300] [Apps] QtWebKit - Web Browser - Updated 23rd Sep vaidyasr 269 112,934 02-12-2013 12:41 PM
Last Post: Willem53
Question [100/200/300/400] initiating play from tablet web browser doubledrat 0 363 02-01-2013 07:40 PM
Last Post: doubledrat
  [200] [Apps] NMT CSI IPTV Player romanr 34 12,014 12-31-2012 07:57 PM
Last Post: romanr
  [200/300/400] Qt 5.0.0-rc1 for NMT - GUI Apps/Games/Utilities vaidyasr 2 912 12-23-2012 06:03 PM
Last Post: vaidyasr
  [100/200/300/400] List of Compilers and Interpreters - For NMT vaidyasr 0 498 12-10-2012 08:48 AM
Last Post: vaidyasr
  [100/200/300/400] List of UPnP/DLNA Server Applications - For NMT vaidyasr 0 1,050 12-10-2012 08:37 AM
Last Post: vaidyasr

Forum Jump: