Extend THE VAR memory been used on your Dreambox 500

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alunfennell
    V.I.P. Member
    • Oct 2008
    • 1525

    #1

    Extend THE VAR memory been used on your Dreambox 500

    Here is some interesting reading for anybody who has issues with Dreambox 500 Var been maxed out or wants to have as much memory as a Dreambox 500+ or more by using your Network Pc or External Hard Drive.


    Some people find that their 500 just does not have enough space on the /var partition to suit them. Most everyone knows that the 500 may either be multi-booted, or have it's /var moved to a network file system. Unfortunately some people don't like either solution, usually citing that they don't want to be required to run their network 24/7 or at least anytime the DB is in use. Here's a simple workaround that, while it does require a network share, the network only needs to be up as the DB boots and loads the extra EMU/s the first time. After that the network can be shut down until the next time the DB is rebooted.

    The concept is simple and the execution is not complicated. The idea is to move the EMU to the network storage, either CIFS or NFS should work fine. In it's place in /var/bin, a SIMPLE shell script is used to do 2 things:

    1. Copy the EMU from the network store to /tmp
    2. Run the EMU from /tmp

    I'm not suggesting for anyone to copy 6MB of files into /tmp on every boot, but it shouldn't be any problem to run a couple EMUs from there, freeing up the space in /var.

    NOTE: If you choose to do this, please don't report any EMU bugs until confirming the bugs still exist when installed normally...

    In the following example, examplecam will be the EMU, but the principles should work w/ any EMU, even other items mostly limited by your imagination. I'll use /hdd as the mount point for the network share (as that is the most common), and I'll underline any shell/telnet commands that may be used. Feel free to edit anything to suit your setup... To keep things neat, we'll use subdirectories in the /hdd & /tmp directories to help reduce the clutter...

    1. Create a /hdd/emu directory to help keep things organized. ( mkdir /hdd/emu )

    2. Move the /var/bin/examplecam file to /hdd/emu/examplecam ( mv /var/bin/examplecam /hdd/emu )

    3. In examplecam's place in /var/bin, add a simple shell script. The script MUST be named EXACTLY the same as the moved EMU ( examplecam ), so that the emu manager will be able to start & stop it. The shell script simply contains:

    Code:
    #!/bin/sh
    cp /hdd/emu/examplecam /tmp
    /tmp/examplecam &
    Don't forget to change the script's attributes to 755 ( chmod 755 /var/bin/examplecam ) and if you create the script on Windows it may be a good idea to clean out the carriage returns:

    dos2unix /var/bin/examplecam

    note: Don't run dos2unix on the actual EMU, just the shell script we created to replace the actual EMU...


    That's basically it, I told you it wasn't complicated. As long as the network is up the first time examplecam is run, it will be copied to /tmp for future use, after that the network can be shut down and the examplecam is still in /tmp for use until the next reboot...


    Even more space could be saved by moving support files too, /var/scce for example, add them to the script, and symlink them from /tmp back to the original location.

    To expand the available /var space on a 500/7000. This time around we'll try to tweak & streamline the various shell scripts. The examples above should work, but they are also relatively dumb, for example, everytime an EMU is started, the DB will attempt to copy it from the share to /tmp, regardless of whether it is already there. Although it won't hurt the functionality if it overwrites the opencam, or the copy fails if the share is no longer available, it could be handled by passing a few conditions to the scripts. It might also be nice to place all the copied files in a subdirectory of /tmp, rather than mixing them in with the files already populating there. This may make things easier to find...

    New & Improved Script
    Code:
    #!/bin/sh
    if [ ! -d "/tmp/emu" ]
    then
    mkdir /tmp/emu
    fi
    if [ ! -f "/tmp/emu/examplecam" ]
    then
    cp /hdd/emu/examplecam /tmp/emu
    fi
    /tmp/emu/examplecam &
    The improved script probably needs some explanation to many users:
    Code:
    if [ ! -d "/tmp/emu" ]    (If a /tmp/emu directory doesn't exist...)
    then                      (Then)
    mkdir /tmp/emu            (Create the /tmp/emu directory)
    fi                        (Finish this section of the script)
    Code:
    if [ ! -f "/tmp/emu/examplecam" ]   (If there is no /tmp/emu/somecam file...)
    then                             (Then)
    cp /hdd/emu/examplecam /tmp/emu     (Copy the somecam file from /hdd/emu to /tmp/emu)
    fi                               (Finish this section of the script)
    Code:
    /tmp/emu/examplecam &     (Run examplecam from /tmp/emu)
    Hopefully that was fairly easy to follow. I'm no script expert, but it's still a relatively simple script, although slightly more complicated that the original. It's also good to know and understand the concepts, as it could be used in other instances if you try to accomplish something a bit on the unusual side... The script could actually be cleaned up and streamlined a bit more, but it should serve it's purpose well as is.

    For this to work, we'll need to move the scce directory & files from /var/scce to /hdd/emu/scce, as mentioned in the first post, and symlink /tmp/emu/scce to /var/scce. The symlink only needs to be created once per image install, after that it is always in /var, waiting for the scce files to be copied to /tmp/emu/scce. This can be accomplished in telnet with a couple commands:

    1. Move /var/scce to the network share. ( mv /var/scce /hdd/emu )

    We'll also need it copied to /tmp/emu to create the symlink, this only needs to be done once:

    2. Also copy the scce directory to /tmp/emu to create the symlink to /var/scce ( cp -rp /hdd/emu/scce /tmp/emu )
    3. Symlink /tmp/emu/scce to /var/scce. ( ln -s /tmp/emu/scce /var/scce )

    Now the only thing left to do is add an entry to the /var/etc/uinit file to copy the scce files back to /hdd/emu on shutdown. This is needed because with dynamic scce files, they may have changed during use. We want to keep these changes and not start from scratch everytime we start the EMU. If you don't have a /var/etc/uinit file, just create it and place the command inside:

    cp -fpr /tmp/emu/scce /hdd/emu

    Again, if you created the uinit file on Windows, it may be a good idea to clean out the carriage returns:

    dos2unix /var/etc/uinit

    Just like the /var/etc/init file gets run on everybootup, the /var/etc/uinit file gets run on every shutdown. Remember that, it may come in handy in the future and is worth knowing...

    Regards:
    Alun
    **The Worlds Best Interactive F1 Strategy Game**
    sigpic
  • .: JaCkPoT :.
    Retired Sat TV Addict
    • Aug 2008
    • 5607

    #2
    How do you know all this? I dont even understand half of it ..

    Read the Rules here; they apply to Everyone.

    ___________________
    In the good old days, I had
    DM800s HD
    Openbox S10
    TM500
    DM500s
    90cm FortecStar dish
    Maxx 110cm Dish
    Technomate 2300 Motors

    sigpic

    Comment

    • satman
      V.I.P. Member
      • Jun 2008
      • 736

      #3
      I'd say probably better for mmc cards, usb sticks or networked drives mabie. on some boxes, ( depends if your box support ),
      having files like emu on Internal HDD will cause HDD to be spinning constant, i.e no sleepy time,

      all good looking drives need there beuty sleeps
      boom!

      Comment

      • alunfennell
        V.I.P. Member
        • Oct 2008
        • 1525

        #4
        I am just after setting this up on an External Network Drive and its realy very good basically running with unlimited VAR space once I sort out a few other things, now I can load as many applications and run them without the fear of running out of space ! It is also now possable to multiboot using different images (I have not gone that far yet).

        Code:
        .:|SaDiQ999uK|:. 	 How do you know all this? I dont even understand half of it ..
        Because I have been working on it all weekend, Its simple to understand your just basically using a PC or External hard drive to extended the Var folder, most of us use a PC or external hard drive for recording or PVR functions anyway now you can use it for storing all your applications without having the size of the var holding you back.

        .:|SaDiQ999uK|:. you have to get yourself a Dreambox m8 ! even if it has to be a clone ..... your missing out on some realy good fun...

        Regards:
        Alun
        Last edited by alunfennell; 7 April, 2009, 14:05.
        **The Worlds Best Interactive F1 Strategy Game**
        sigpic

        Comment

        • .: JaCkPoT :.
          Retired Sat TV Addict
          • Aug 2008
          • 5607

          #5
          Ah, get it now! Well if i do get a dreambox it will be after digitv goes and after a few months pass to give me am idea on whats opening on emu etc..

          Read the Rules here; they apply to Everyone.

          ___________________
          In the good old days, I had
          DM800s HD
          Openbox S10
          TM500
          DM500s
          90cm FortecStar dish
          Maxx 110cm Dish
          Technomate 2300 Motors

          sigpic

          Comment

          • alunfennell
            V.I.P. Member
            • Oct 2008
            • 1525

            #6
            I think you will have as much joy out biscuit box shortly, so yeah your better off waiting m8 !


            Regards:
            Alun
            **The Worlds Best Interactive F1 Strategy Game**
            sigpic

            Comment

            Working...