NFS & Create 'New Folder' Within / Media

KTO2

Member
HDR Fox T2 with CF 3.13

The web interface (v1.5.0-9) has an option in 'browse / media' to create a new folder (see below screen print) which, when you are in the interface appears to work and save accordingly; however it does not survive a reboot and the folder (and any subsequent folders therein) which have been created (and saved) disappear. What am I doing wrong please?

img9.jpg

The reason I am trying to do this is to make use of NFS on my LAN which is up and running fine, I have no problems with NFS. The folder(s) I am trying to create will be used to store video files obtained from outside the Humax eco system which will then be played back via Kodi installed on a Firestick. I have checked that things work the way I want them to by creating a test folder within 'My Video' (and also 'My Photos') and they do and I could actually live with it staying this way if it is not possible to achieve the above. Even renaming either the 'My Music' or 'My Photos' folder would work for me as I never use them. The web interface does allow you to rename these but again (after saving) the rename does not survive a reboot.

It does not matter to me that if I try to watch any of these videos on the TV via the Humax software they may not work or will show as corrupted files I am just trying to make use of the NFS aspect.

The only other question is to do with speeeeed. If I move a video file on my W11 laptop from one folder to another (on the said laptop/same ssd) the transfer takes place at circa 150 MB/s. If I move a video file from one folder to another within the HDR Fox T2 (which has the same make/model/size ssd fitted as the laptop) the transfer is circa 4 MB/s. Is there a particular reason for this or is it just the way it goes for the HDR Fox T2?
 

Attachments

  • img9.jpg
    img9.jpg
    6.8 KB · Views: 15
Last edited:
If I move a video file from one folder to another within the HDR Fox T2 (which has the same make/model/size ssd fitted as the laptop) the transfer is circa 4 MB/s. Is there a particular reason for this or is it just the way it goes for the HDR Fox T2?
Let's deal with the easy bit first: the processor in the HDR-FOX is puny! The apparent 'speed' for native transfers is achieved using DMA (a form of hardware acceleration), which is not available for raw OS commands. However, moving a file within one drive partition should be pretty much instant, because no data gets moved at all (just the file system pointers get updated), so I suspect you're not actually doing what you think you are.

The web interface (v1.5.0-9) has an option in 'browse / media' to create a new folder (see below screen print) which, when you are in the interface appears to work and save accordingly; however it does not survive a reboot and the folder (and any subsequent folders therein) which have been created (and saved) disappear.
That will be because "/media" does not exist, it is a redirection to /mnt/hd2/... which gets reinstated each boot. One of the things network-shares-automount does is to reinstate the mounts under /media.

A few ideas for you:
  • In WebIF, try clicking the initial "/" in the breadcrumb trail, then navigating to /mnt/hd2 (where you will see My Video etc in their "real" location). You might find your folders there, but as the WebIF wasn't written with that in mind don't be too surprised if they're not.

  • If they are there, then you now know how to access them. If you want to have them mounted under /media you will need a boot script to make that happen each boot - see Creating a script to auto-run at boot (click).
/mnt/hd1, hd2 etc are the separate partitions which then get amalgamated into one file system by the OS. Moving stuff within (say) hd2 should be quick, but not quick if (say) moving between hd1 and hd2, or any copy operation.

It does not matter to me that if I try to watch any of these videos on the TV via the Humax software they may not work or will show as corrupted files
Good, because the Humax native player UI won't access any video file outside My Video, any music file outside My Music, nor any image file outside My Photo (nor any internal location other than those). The only way to bypass that is to go to USB storage (whether that be real or virtual).
 
Reply appreciated.

moving a file within one drive partition should be pretty much instant

This is what I thought and was expecting, however, prompted by your reply I appear to now have sussed it and have indeed put the speed thing down to how I was doing it. I.E if I cut/paste or copy/paste it gives me 4 MB/s there or there abouts. If I go in to FileZilla and move the video file therein (move not FTP) it is instantaneous as in probably not even one second. If I open two W11 file explorer windows and drag/move the video file it is also instantaneous. This works for me as I would only be deleting the original file anyway if I was to go the cut or copy route.

In WebIF, try clicking the initial "/" in the breadcrumb trail, then navigating to /mnt/hd2

Ok done that and then within /mnt/hd2 created a folder called 'KO Server NFS' and then within that created 4 more folders as it is 4 I need and they are all still there after a reboot and accessible within Kodi. Where are these folders actually stored? Is it just in empty space on the ssd as I can see them via the web interface and FileZilla but not if I go in to the Humax menu on the TV. I am asking the question out of interest as I will never actually want to access them through the Humax TV menu. (I also can't currently see them in W11 file explorer but am pretty confident I will be able to sort that).

If you want to have them mounted under /media you will need a boot script to make that happen each boot

Yes I would love to but my brain started to melt when reading through the supplied hyperlink. I understand the principles and the logic of how it works but getting my fingertips to press the right buttons is another matter. Maybe after some more reading things will click and I will be able to do it.
 
Where are these folders actually stored?
I think you are getting confused by the differences between a Linux-style file system and what you may be more used to with Windows. In Windows/DOS, each device is separate and given a drive letter to identify it. In Linux, everything is within the overall file system tree, and there may be multiple ways to get to any specific directory/file according to how the system is configured with mount points.

Thus, to get directly to the hardware all the driver instances are listed under /dev (for "device"), and the first SCSI (including SATA) HDD is /dev/sda (then sdb, sdc...), while the partitions on sda are /dev/sda1, sda2...

But the Humax boot configuration then then standardises the Humax view of the storage (and decouples it from any changes they might make to the hardware) by mapping /dev/sda1 as /mnt/hd1 etc. So, regarding your actual question, /mnt/hd2 is a pointer to the second partition on the HDD (or SSD in your case), which contains actual directories My Video etc.

The reason you can't "see" your new folders alongside My Video from the Humax UI is because it's not programmed to show them to you. If you created a virtual USB drive mapped to /mnt/hd2 (or even just /), you would be able to navigate the directory tree from Media >> Storage (blue) >> USB. Not that you need to.

Is it just in empty space on the ssd as I can see them via the web interface and FileZilla but not if I go in to the Humax menu on the TV.
If by "empty space" you mean unallocated storage, the answer is no. It's all in the same file system under hd2, just that the Humax UI is programmed to show you only My Video (or My Music or My Photos).
 
The web interface (v1.5.0-9) has an option in 'browse / media' to create a new folder (see below screen print) which, when you are in the interface appears to work and save accordingly; however it does not survive a reboot
/media is a filesystem created in temporary storage i.e. RAM, so disappears when you reboot. It's also limited to 64MB, so you aren't going to get anything usable in there anyway.
Even renaming either the 'My Music' or 'My Photos' folder would work for me as I never use them. The web interface does allow you to rename these but again (after saving) the rename does not survive a reboot.
Because they are below /media they are also volatile. They get recreated at reboot by the Humax software.
within /mnt/hd2 created a folder called 'KO Server NFS' and then within that created 4 more folders as it is 4 I need and they are all still there after a reboot and accessible within Kodi. Where are these folders actually stored? Is it just in empty space on the ssd as I can see them via the web interface and FileZilla but not if I go in to the Humax menu on the TV.
On the second (large) partition of the hard disk. It's one level above the contents of "My Video", so a sibling of it effectively. The on-screen UI will only show stuff in "My Video" and below.
 
Right. So without adding a boot script, only specified folders in hd2 (ie My Video etc) get instantiated in /media.

The OP should be OK using /mnt/hd2 though.
 
It is all working fine and doing exactly what I wanted it to do. Thank you for the guidance.

I am off now to try and work out how to do that boot script wizardry even though I don't think I need it and will never make use of it but hey ho why do people climb mountains.

🤷‍♂️
 
The ln command (as shown in the worked example) is exactly what you need, to create a soft link (redirection) from /media to your actual folder(s) under /mnt/hd2, so it really shouldn't be difficult! You don't even need the command line:
it is worth commenting that the WebIF >> DIagnostics >> File Editor offers the options to create a file and to make it executable, no command line needed.
 
It might be worth adding that you could use a different HDD partition for your server files than the main recordings partition (hd2), and still link it to /media. I don't have access to my machines at the time of writing to check, but IIRC either hd1 or hd3 is under-used.
 
Nope, I'm not getting it. Through File Editor I have created a file called S99myserversymlink at /mod/etc/init.d and used various modified concoctions of the scripts shown in Creating a script to auto-run at boot (click) and I cannot get this extra folder which I have created in /mnt/hd2 called 'My Server' (with four subfolders) to get instantiated in /media and show in addition to drive1, My Music, My Photo and My Video.

Using the below unamended cut and pasted script from the link supplied by Black Hole what does it need to be changed to please for my situation or is there a different one altogther that I should be using instead? (There are also some screen prints underneath which may or may not be of use).

#!/bin/sh

video="/media/My Video"
folder="[Unclassified]"
[ -d "$video/$folder" ] && ln -s "$video/$folder" "/media/$folder"

1.jpg

2.jpg
 
Try looking at the simple version, and reading information about the Linux ln command!

Code:
#!/bin/sh
 
ln -s "/mnt/hd2/My Server" "/media"

Simples. Then reboot (which auto-runs the script).

ln = link
-s = symbolic rather than a hard link

ln -s <what you want to create a link to> <where you want to create the link>

If a path contains spaces, putting it in quotes prevents the spaces breaking the path into multiple strings.

NB (for everyone else): the script file needs to be made executable, which is available as a button in the WebIF >> Diagnostics >> File Editor – but I didn't mention that before because the OP had already done it.
 
Last edited:
Back
Top