PDA

View Full Version : How to create swap file?



dog-man
09-02-2014, 03:28 PM
I found this on another board.

Telnet to the STB then:

Make sure the device you want your swapfile on is mounted e.g. like "ls /hdd" or "ls /media/hdd" returns a file list (at least lost&found).
The following assumes adjusting and exisiting swap on /hdd - note that using your hard disk is not a good idea as it will have the disk active a lot of the time, rather use a flash disk.
If you are setting up swap for the first time skip step (1).
1. /sbin/swapoff /hdd/swapfile --- do this only if you are adjusting swapfile size, adjust this to where you have a swapfile at the moment if any
2. /bin/dd if=/dev/zero of= /hdd/swapfile bs=1048576 count=32 -- adjust /hdd to where the device is mounted that you want the swapfile on; adjust count=32 to size of swap in MB
3. /sbin/mkswap /hdd/swapfile
4. /sbin/swapon /hdd/swapfile

<<<<<<<<<<<<<<<<<<

This is for a DB800.

Would it also work for a vuduo?

ian
09-02-2014, 04:27 PM
These are the commands used to format an external penstick USB or HDD to Fat Ext3 through Linux.

I have used HDD as an example. But you can replace usb for hdd

Note : anything on the USB/HDD will be eliminated.

Unmount the unit.



umount /dev/sda1


Format the unit in Ext3 through linux.


mkfs.ext3 /dev/sda1

Mount the usb/hdd.


mount /dev/sda1 /media/hdd


Create a folder called Movie for the recordings.


mkdir /media/hdd/movie

Chmod to 777 for the recordings ,etc.


chmod 777 /media/hdd/movie

Create a 512mg swap


dd if=/dev/zero of=/media/hdd/swapfile bs=1024 count=524288

then


mkswap /media/hdd/swapfile

then


swapon /media/hdd/swapfile

then finally add this to your fstab file located in /etc


swapfile swap swap defaults 0 0

now after a proper reboot your HDD is mounted with a 512mg swap

Ian.

dog-man
09-02-2014, 04:37 PM
I assume I can ignore the references to mounting a hard drive for recording movies if my hard drive is already mounted and already saving recorded movies?

zola25
09-02-2014, 05:46 PM
It depends on the image for ViX just push the blue button then goto the vix folder then pick swap manager and you can set it up from there

dog-man
09-02-2014, 05:55 PM
OpenPli v4

ian
09-02-2014, 08:26 PM
all images have software to create a swap file and Pli is no different.

just download and install system tools from the feeds and use the swap manager in that,if you just wish to push buttons.

the thing is though that you cannot create anything bigger than 256mg using these plugins,plus you never learn anything either.

you have the commands above,at least try it and see how you get on.

Ian.

dog-man
09-02-2014, 08:27 PM
I will try it myself.

ian
09-02-2014, 08:37 PM
just had another thought too.

make sure your new image isnt using zram.

in principle,zram is a great idea as it partitions the available ram,and creates a system swap on that to be used before any swap that you create is used.this would always be much faster than any swap created on a HDD or USB stick.

but

in practice,it was a dramatic failure as the idea came from ubunto linux systems that have oodles of ram to play with.
enigma2 boxes dont,so this system swap can never be large enough and will very quickly get used up and when it does,GSOD !

so

open telnet then type

opkg remove zram then hit enter

then reboot.

the box will then remove the zram partition and start to use your own swap file that you have created instead.

this is very important !!

it may not still be in the new images,i just dont know,but if it is get rid now !

Ian.

dog-man
09-02-2014, 08:38 PM
Yes, I did read something about that.

I will definitely check when I get round to flashing openpli v4.

ozzsurf
09-02-2014, 09:27 PM
@ian

swapon swapfile1

swapfile1 swap swap defaults 0 0

you added a 1
and left out the path


should be


swapon /media/hdd/swapfile


fstab file

/media/hdd/swapfile swap swap defaults 0 0

ian
09-02-2014, 09:55 PM
yes i did

thanks for pointing that out.

Ian.

dog-man
04-03-2014, 05:28 PM
Is there a way to check that the swap file is set up correctly and operating correctly?

I have followed the above instructions and didn't get any error messages, so I assume it is ok.

saintomer1866
04-03-2014, 06:29 PM
just telnet into your box and type
free

dog-man
04-03-2014, 07:22 PM
Are you sure that is correct?

I got > -sh: free: command not found