Home

How to run swap Spark?

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
Hello, wants to test exchange swap memory on the Spark, wants to run the swap on the / tmp or / var, I know it is a plugin some stuff and it can turn swap, but only on a USB drive, and I want to Spark how to do? I created a swap in / var, but to the system to use it you have to give the command: # swapon, but telnet screams "not found" how to turn swap that at the start of the Spark benefited from it?
 

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
crear archivo para plugin, ejemplo swap_on.sh:

swap_on.sh
Código:
#!/bin/ash
#DESCRIPTION=This script enables exchange swap partition memory
/sbin/mkswap -L SWAPPART /dev/sda2
sleep 3
/usr/local/sbin/swapon /dev/sda2
Copias el archivo creado, en la ruta /var/bin, le das atributos 755, y lo ejecutas por el menú de Plugin del receptor.
Se queda activado, para iniciarse automaticamente en cada reinicio del receptor.
 
  • Me gusta
Reactions: Spartacus5000

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
@Mecha ,
Something does not work, then what I did, activated the plugin swap_on.sh the menu, of course, added script BusyBox in autorun.sh. In the telnet command typed:
Código:
 dd if=/dev/zero of=/var/swapcc bs=1M count=512

then command:
Código:
mkswap /var/swapcc

then command:
Código:
swapon /var/swapcc

but there is still that "swapon not found" where I am doing wrong? I also want to create a swap / tmp / swapcc, but I still have no message "swapon not found". I checked after a restart of different combinations and still when you type the command #free have free swap 0 0 umm?
 
Última edición:

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
Tell me where I am doing wrong? Apparently the swap file is in the directory as given in / var / swapcc, but is not visible in #free swap 0 0 that is not active. Just like creature swap in / tmp / swapcc, so that after the reboot is removed and I have to create it anew, but so free swap 0 0.
 

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
realiza el proceso explicado en este post: http://openspa.info/threads/cómo-agregar-sistema-de-archivos-de-firmware-spark.29250/#post-244249
con el comando:
busybox.sh4 --install -s /usr/local/sbin
crearás unos accesos directos a todas las funciones del busybox.sh4, entre ellas está el swapon que necesitas.

Si no quieres crear todos los link para cada uno de los programas integrados en el busybox.sh4, tambien se puede ejecutar el programa swapon integrado, ejecutandolo de la siguiente forma:
busybox.sh4 swapon /var/swapcc
 
  • Me gusta
Reactions: Spartacus5000

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
I give this command in telnet:
Código:
busybox.sh4 swapon /var/swapcc
??
and that he was in autorun.sh BusyBox it so?

Código:
 ln -sf /bin/busybox~ /usr/sbin/swapon
??

And if in the / tmp / is not it?

Código:
 busybox.sh4 swapon /tmp/swapcc

??
 

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
I gave telnet and I "Invalid argument" Where is the path to be entered because I do not know if telnet or in autorun.sh?
 

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
El swapon para ser efectivo, es para iniciar el archivo de memoria de intercambio en la ruta de un dispositivo (DEVICE), por ello para crear el archivo de intercambio hay que usar alguna unidad de un USB o HDD.
Imagen 24.png
para ver los devices habilitados en el sistema, utiliza el comado "df", y elige entre los que tengas, uno que tenga libre el suficiente espacio para ubicar el archivo de intercambio con el tamaño que necesites o prefieras.


Imagen 23.png

el tamaño que ves en la columna de "Available", están en kb
( kb * 1024 = bytes )
( kb / 1024 = Megabytes )

dd if=/dev/zero of=/storage/d/swapcc bs=256 count=524288
mkswap -L SWAPPART /storage/d/swapcc
busybox.sh4 swapon /storage/d/swapcc
sync
echo 3 > /proc/sys/vm/drop_caches

El tamaño que pretendas tener para memoria swap, lo configuras teniendo en cuenta que el valor del "bs" multiplicado por el del "count", va a ser igual al tamaño del archivo de memoria swap, en este caso del ejemplo tendriamos 256*524288 = 134217728 bytes / 1024 = 131072,00 kb / 1024 = 128 Mb, de memoria swap.

Despues del mkswap y del swapon, si haces un free, veras que el consumo de la memoria ram ha subido, y queda menos libre, eso es por las librerias que se usan para configurar el archivo de intercambio, por lo que te aconsejo que tambien ejecutes el siguiente comando para volver a liberar memoria RAM, para su uso, que es más rapida que la swap.
echo 3 > /proc/sys/vm/drop_caches
 
  • Me gusta
Reactions: Spartacus5000

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
Thanks, but I asked to run the swap system Spark drives I have full, lack of space for the swap, so I prefer to have swap Spark of the drive, but I understand that you can not? As for the plugin for garbage drop_caches is using it for a long time, and unfortunately, when a large number of channels do not give this plugin, so I counted about swap Spark, and not on d / e / and only disk c / or chief Spark.
 

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
Maybe poorly explained, I mean only to activate the swap on the root disk, Spark, no HDD and USB. Can be? After entering #free I swap 0 0 which is not active swap
 

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
podria ser en "/" o "/home/"
pero el problema si te fijas con el comando df, es que dispones de muy poco espacio libre, en "/" podrias usar solo 220 kb. igual que en "/home/"

pruebalo:
dd if=/dev/zero of=/swapcc bs=1 count=524288
solo te creara una archivo de pocos bytes, correspondiente al espacio libre en "/" , que te informa el comando df
 
  • Me gusta
Reactions: Spartacus5000

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
@Mecha,
I did a swap as you have entered / swapcc, but after about 190 channel tuner terribly slowed down, until finally suspended :bad
 

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
@Mecha, Hey :), back to the topic, tell me whether it is good works that I did. I used that recording as plugin, and now when you run the system file is created swapcc attribute 644, and I have a question, does it work correctly or should I add the line "chmod 755" ? 210 MB is the maximum value that Spark take :)
Código:
#!/bin/ash
#210 Mb swap enable
dd if=/dev/zero of=/swapcc bs=1 count=215040
 

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
The attribute 644 for the swap file is correct,
that attribute the owner can read and write in the swap file.
 
  • Me gusta
Reactions: Spartacus5000

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
OK :) can I have this entry in add file "autorun.sh" ? will this work better than the plugin ? So, a logical question, if you just created the file "swapcc" Spark will use this swap ? Asking because when team #free, Swap is 0 0 .How does it work ?
 

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
mejor un archivo script en plugins, así puedes manipularlo y ejecutarlo o no, segun te convenga.
Si lo dejas activado en plugins, al reiniciar el decodificador tambien se ejecuta automáticamente.

Maybe a script file in plugins so you can manipulate it and run it or not, at your convenience.
If you leave it enabled on plugins, restarting the decoder also it runs automatically.

Código:
#!/bin/ash
#210 Mb swap enable
dd if=/dev/zero of=/swapcc bs=1 count=215040
sleep 4
/sbin/mkswap -L SWAPPART /swapcc
sleep 2
/root/spark/etc/lighttpd/sbin/busybox.sh4 swapon /swapcc
sync
sleep 2
echo 3 > /proc/sys/vm/drop_caches
exit 0

(recuerda tienes que tener el "busybox.sh4" en la ruta /root/spark/etc/lighttpd/sbin/, con atributos 755)

(Remember you have to have the "busybox.sh4" in the /root/spark/etc/lighttpd/sbin/, with attributes 755)
 

Spartacus5000

Usuario Activo
Fan de OpenSPA
5 Dic 2011
145
17
0
@Mecha
and isn't it better this record is valid from the beginning of the tuner ? As I tried swappines 10 included plugin (we're talking about swappines) channels encoded a very long time to load, but when he entered the same setting swappines to 10 autorun.sh it was no problem. So it is better not to use such records autorun.sh that is to begin with bootem or better in a plugin, where the plugin is triggered only after loading the logo. From my test, to see what works best in autorun.sh. Setting these records ,I do not have here mainly about swappines, but swapcc and the like.
 
Última edición:

Mecha

Usuario Destacado
Loco por OpenSPA
Fan de OpenSPA
14 Ene 2010
4.132
819
0
España
Try it on the autorun

autorun.sh
########### place /tmp to tmpfs ##############
rm -rf /tmp
umount /dev/shm
mount -t tmpfs tmpfs /dev/shm -o size=6m
mkdir /dev/shm/tmp
chmod 1777 /dev/shm/tmp
mkdir /tmp
mount --bind /dev/shm/tmp /tmp

#############create and activate swap file##############
dd if=/dev/zero of=/home/swapcc bs=1 count=215040
/sbin/mkswap -L SWAPPART /home/swapcc
/root/spark/etc/lighttpd/sbin/busybox.sh4 swapon /home/swapcc
##############################################
 
  • Me gusta
Reactions: Spartacus5000