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:
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
The improved script probably needs some explanation to many users:
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
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 &
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 &
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)
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
..
Comment