1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

link an external usb hard drive to the internal hard drive?

Discussion in 'HD/HDR-FOX T2 Customised Firmware' started by sohlinux, Apr 25, 2012.

  1. sohlinux

    sohlinux Member


    Anyone know how create a link from an external usb drive which is plugged into the humax to the My Videos folder on the internal drive?

    I tried ssh by going into /media/My Videos then used the command ln -s /media/drive1/

    it creates a link which is visable and usable via ftp but the link doesnt show up on the humax menu?

    the drive1 symlink is chown root and its chmod 755

    any ideas? should the owner be root or does the humax use another username? its an HDR box.

  2. Ezra Pound

    Ezra Pound Well-Known Member

    The Humax main program humaxtv is executed by 'root'
    drwxr-xr-x 2 root root      127 Jan  4 00:43 .
    drwxr-xr-x 9 root root      87 Aug 31  2011 ..
    -rwx------ 1 root root    4330 Jun 10  2011 devcerttemplate.dat
    -rwx------ 1 root root  112648 Jun 10  2011 dnsmasq
    -rwx------ 1 root root    1034 Jun 10  2011 hmackey.dat
    -rwx------ 1 root root 11672500 Jun 10  2011 humaxtv
    -rwx------ 1 root root    18792 Jun 10  2011 ntpclient
    -rwx------ 1 root root      40 Jun 10  2011 priv.dat
    -rwx------ 1 root root  684745 Jun 10  2011 tcpdump
    -rwx------ 1 root root    41624 Jun 10  2011 tinyftp
  3. xyz321

    xyz321 Well-Known Member

    mkdir "/media/My Video/tmp"
    mount --bind /media/drive1 "/media/My Video/tmp"
  4. sohlinux

    sohlinux Member

    that worked! thanks :)
  5. oijonesey

    oijonesey Hummy.tv SEO Guru

    That sounds handy - so I could have lets say a 'Kids Stuff' folder showing in My Video as if it was on the Hummy disk - but actually the folder is on the external HDD? That sounds like nice easy navigation. Could this be something for the Webif where you navigate to and select a folder on the USB/HDD through the UI and the setup to make it appear in My Video is all done for you?

    What if I tried to move a file to this shortcut - would it also write the file back out to the HDD or is it just read only? Oh and if that's the case you wouldn't get sidecar files?

    Anyway - even without that a simple way to set up shortcuts to USB folders might be nice to add to the webif To Do list maybe?
  6. Black Hole

    Black Hole Theloniuos Abbot

    I'm liking the sound of that. Might even be possible for the auto-filer to send things there.
  7. xyz321

    xyz321 Well-Known Member

    It will have a similar problem to that of samba mount within the "My Video" tree. The Humax UI will treat the mount as if it on the same disk so it will attempt to move files into (and out of) the mounted directory when it should be copying the files. It is best to access external disks using the more usual methods, this was just really a one-off for a particular problem.
  8. Black Hole

    Black Hole Theloniuos Abbot

    I get you. What you mean is the data won't actually move, just the pointers to it.
  9. xyz321

    xyz321 Well-Known Member

    Yes. The main problem is that when it fails to "move" the files it does so silently, so that the user may think it has been successful.
  10. sohlinux

    sohlinux Member

    so far it works OK, I havnt seen anything being copied off the external drive.
  11. sohlinux

    sohlinux Member

    each time I reboot the humax I lose the link to the USB drive, how do I make the link permanent?

    ssh: mount --bind /media/drive1 "/media/My Video/"
  12. xyz321

    xyz321 Well-Known Member

    It is a bit of a hack. I don't really see why you would want to make it permanent. Once 'unencrypt' has decrypted all the files on your external disk then you should not need to do this again. As long as you have auto-unprotect running then all files copied to the external disk should be decrypted.
  13. sohlinux

    sohlinux Member

    the link was a lot easier than changing drives from the menu, also if I access the humax with media-house on my tablet pc there is no option to choose usb drive, I can only access the usb drive from the bind mount link in media-house. if its too difficult to setup mount at boot I can just type mount --bind each time I reboot.
  14. xyz321

    xyz321 Well-Known Member

    Ah, OK, you just need to create a new script under /mod/etc/init.d - something like this should work (providing only one disk is attached):

    Edit: Please do not use this script any more. Install the package 'mvdisks' instead.

    mp="/media/My Video/tmp"
    [ ! -d "$drv" ] && exit 0
    case "$1" in
                    mkdir -p "$mp"
                    mount --bind $drv "$mp"
                    umount "$mp"
                    rmdir "$mp"
                    exit 1
    exit 0
  15. af123

    af123 Administrator Staff Member

    Call the script something starting with a capital S and make it executable (chmod o+x /mod/etc/init.d/S....) and it will run automatically at boot time once the disks are mounted and the Humax software is up and running.
  16. sohlinux

    sohlinux Member

    thanks 321 and 123, ill try that!

    just wondered why unmount and remove directory is necessary?

  17. Wallace

    Wallace Slightly Pickled

    Blimey, I thought Ted Rogers and Dusty Bin were in the room for a moment there....:)
  18. af123

    af123 Administrator Staff Member

    It isn't strictly necessary but every init script should provide a start and stop method so that the system can cleanly transition between runlevels. It's less important here in a busybox environment but still good practice.
  19. sohlinux

    sohlinux Member

    thanks :)
  20. xyz321

    xyz321 Well-Known Member

    Actually there is a better way to do this using the mdev mechanism- it might be worth making a new package.