Watch movies from uncompressed rar files via NFS. rar2fs?

Here for general support for F series TVs, request and problem solve area.
Post Reply

svantovit
Posts: 5
Joined: Mon Jan 06, 2014 7:25 pm

Watch movies from uncompressed rar files via NFS. rar2fs?

Post by svantovit »

I just worked on the rar2fs script, it kinda works but I have one major problem:
I cant create new folders in the mounted (nfs-)filesystem on the virtual usb-drive for rar2fs to mount the rar files in.

Right now I scan the entire virtual usb stick for %filename%.rar files, create folders /tmp/%filename%/ and mount the rar file into this tmp-folder. Works, but you can't access the files via the TV. I tried creating symlink in the mounted filesystem linking to the /tmp/... folder, but that doesn't work, either.

Does anyone have any ideas how to create folders in the mounted drive?



What I got so far (WIP, ignore my path and -maxdepth in find):

Code: Select all

#!/bin/sh
#
# . Copyright 2012,
#       by juuso <juuso@gmail.com>
#
#       Version: SamyGO svn $Id: 04_09.rar2fs.init 1205 2012-04-15 12:15:26Z arris69 $
#
# TODO: more sysv style, more error handling
#

. /dtv/SGO.env

case $1 in
        start)
        for i in `find ${MOUNT_PATH}/nfs/192.168.1.127/_volume1_downloads/series/ -name '*.rar' -maxdepth 1`
        do
               echo ${i}
               tmpdir=${i%.ra*}
               dir=${tmpdir##*/}

               if [ ! -d "/tmp/$dir" ]; then
                       mkdir "/tmp/${dir}"
                       echo "/tmp/$dir created"
               else
                       echo "/tmp/$dir exists"
               fi

               if [ `$SYSROOT/bin/busybox mount | grep -c "/tmp/$dir"` == 1 ] ; then
                       echo "/tmp/$dir already mounted"
               else
                       echo "rar2fs $i /tmp/$dir"
                       rar2fs $i /tmp/$dir
               fi
        done
#       find . -type d -empty -exec rmdir {} \;
#       echo "empty directories deleted"
        ;;
        stop)
        for i in `$SYSROOT/bin/busybox mount | grep "fuse.rar2fs" | awk '{print $3}'`; do
                umount $i
                echo "$i unmounted"
        done
        ;;
        status)
        $SYSROOT/bin/busybox mount | grep "fuse.rar2fs" | awk '{print $3}'
        ;;
        *)
        echo "Usage: $0 {start|stop|status}" 1>&2
        exit 0
        ;;
esac

Reference: viewtopic.php?f=16&t=3173
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Watch movies from uncompressed rar files via NFS. rar2fs

Post by juusso »

What about this?
04_09_rar2fs.init.dis.gz
You do not have the required permissions to view the files attached to this post.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
svantovit
Posts: 5
Joined: Mon Jan 06, 2014 7:25 pm

Re: Watch movies from uncompressed rar files via NFS. rar2fs

Post by svantovit »

That creates new folders in /mnt/etc/init.d, still not accessible from the tv.

Right now I'm working on mounting them to /dtv/usb/sda/unrar/... so you can at least access them, even if it's not too comfortable.

Would it be possible to get a newer version of find? The version right now doesn't support the -empty argument. If not I'll try to find another solution for removing the empty folders.

But it does take for fucking ever with a big file server. (8min for ~1600 rar files, 1,5tb data, 100mbit)
And.. well... it didn't work too well. After a couple of files (~190) I got a "No space left on device"-message from rar2fs.
Problem: movies rar'd as .part001.rar, .part002.rar, etc.: rar2fs tries to unrar each file, even if they belong to just one movie.

But thats enough for today, I'll continue tomorrow and try to think of some filter to ignore files that end with .part002/.part02 and above.
You do not have the required permissions to view the files attached to this post.
hasse69
Posts: 66
Joined: Fri Feb 10, 2012 8:09 pm

Re: Watch movies from uncompressed rar files via NFS. rar2fs

Post by hasse69 »

svantovit wrote: And.. well... it didn't work too well. After a couple of files (~190) I got a "No space left on device"-message from rar2fs.
Problem: movies rar'd as .part001.rar, .part002.rar, etc.: rar2fs tries to unrar each file, even if they belong to just one movie.
Hold on here. Why would rar2fs cause a "No space left on device"-message? rar2fs does normally not extract anything to any external file system, it is in-memory or on-the-fly extraction depending on compression level. Simply because you get the error message from one program (and it is usually not the programs themselves, it is from the kernel) does not necessarily mean that that program is the cause of filling up your file system. I really do not believe the theory that rar2fs in this case should be the one cluttering your file system. It is most likely something else. Do you have any details exactly what file system became full and with what?
And what do you mean by rar2fs tries to unrar each file? Of course it tries to unrar things in every volume part if you asked for file extraction and it was split over several volumes?
Try to use the --seek-length=1 flag when mounting and rar2fs should ignore all but the first file in a volume when doing listing of directories, unless you try to extract the files inside it of course.
And, trying to filter out .partNNN is probably a good idea, not because it is really needed since rar2fs actually will throw an error if you try to mount anything but the first file in a volume set, but because it seems unnecessary to even try ;)

EDIT:

Btw, I quickly checked your script so I might have overlooked something. But why are you trying to mount single archives one by one!? That is going to result in an enormous amount of wasted resources and mount points in /tmp or whatever! It will start one new instance of rar2fs for each archive! That will grow to a lot of used up RAM. Why don't you simply mount the entire folder once containing *all* your RAR archives? Did I miss something here? But regardless of that, if you mount a single archive on a mount point, that mount point is read-only by design (by rar2fs) since it is *the* RAR archive you have in that mount point. If you instead mount a folder containing RAR files on a mount point, that mount point becomes read/write provided you have proper permissions. But you can never write to something that is inside a RAR archive.

EDIT2:

@juuso: What version of rar2fs are you on right now? I know we struggled some time back to get this thing working on your platform. A lot has happend since then, maybe it is time to make another go at this? If I recall correctly you had some issues with compressed archives, right?

Post Reply

Return to “[F] Support”