[mvdisks] an external usb hard drive to the internal hard drive?

sohlinux

Member
Hi,

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.

thanks
 
The Humax main program humaxtv is executed by 'root'
Code:
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
 
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?
Code:
mkdir "/media/My Video/tmp"
mount --bind /media/drive1 "/media/My Video/tmp"
 
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?
 
I'm liking the sound of that. Might even be possible for the auto-filer to send things there.
 
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.
 
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.
 
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.

so far it works OK, I havnt seen anything being copied off the external drive.
 
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/"
 
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.
 
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.
 
if I access the humax with media-house on my tablet pc there is no option to choose usb drive
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.

Code:
#!/bin/sh
 
mp="/media/My Video/tmp"
drv=/media/drive1
 
[ ! -d "$drv" ] && exit 0
 
case "$1" in
        start)
                mkdir -p "$mp"
                mount --bind $drv "$mp"
                ;;
        stop)
                umount "$mp"
                rmdir "$mp"
                ;;
        *)
                exit 1
                ;;
esac
 
exit 0
 
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):

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.
 
thanks 321 and 123, ill try that!

just wondered why unmount and remove directory is necessary?

thanks
 
just wondered why unmount and remove directory is necessary?
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.
 
Actually there is a better way to do this using the mdev mechanism- it might be worth making a new package.
 
Back
Top