How to create swapfile in pli?
jalizi 29 May 2015
Hi
How to create swapfile in pli? I mean, which plugin should be used or which command I should run in telnet to create swapfile in pli image?
Regards
Autodelta 30 May 2015
doglover 30 May 2015
Why so complicated. The System tools plug-in does this all for you.
And some of the commands used in this example do not work anymore in OpenPLi.
Willy
hemispherical1 31 May 2015
It's nice for a user to have the option to actually learn something. This terribly "complicated" method would allow a user to create a swapfile on any Linux based box, ranging from $ routers to $$$$ computers & anything inbetween... No crutches required.
--
hemi
gabier 31 May 2015
Here is an example
Why so complicated. The System tools plug-in does this all for you.
And some of the commands used in this example do not work anymore in OpenPLi.
Willy
I can report my experience. I tried to install a swap on an usb stick on my DM8000 openpli 4.0.
I first used Glass System Utilities plugin. There is a prerequisite that your USB stick is formatted in ext3 or ext4. Even so, the plugin installed the swap file but the "used" space was stuck to zero for ever. I suspect this swap file did not really work. I suspect there is a partition issue. My stick was formatted without any partition and the system utilities (or openpli) would require at least a partition in order to install the swap correctly.
Anyway, I deleted the swap and recreated it from the command line with telnet, exactly following the example in autodelta's post. It did install correctly the swap file and now it is working, the "used" space is 120K. The only problem I had is that I have not yet succeeded in the fstab issue, If I reboot the box, I have to telnet a "swapon".
I must confess also that between the 2 implementations, I reformated the stick with a partition. Maybe this is mandatory in openpli, I do not know.
Also doglover is right when writing that some commands do not work, but for me it happened only for the "free" command. I use "cat /proc/meminfo" instead, but the output is too big. There is also the "cat /proc/swaps". It displays only swap stats.
gabier
hemispherical1 1 Jun 2015
I suspect the free command may have been conciously removed from the default install, in an attempt to bring an end to the requests from people about how to "flush" their RAM, as they felt they had too little "Free" ram... Along with no comprhension about how Linux memory management worked...
Just a guess from years of reading those posts...
I'm not sure what the problem is you're having with the fstab, the vi command as listed in the link assumes the user knows how to use the vi editor, basic vi commands are easily googlable. It'd be something like <ignore the comments>
vi /etc/fstab
i <insert mode to add text>
/media/usb/swapfile swap swap defaults 0 0 <as the example in the link>
esc <enter command mode>
:wq <write changes and quit on the Enter key>
Enter
Of course you could use any editor besides vi that you like & install.
Happy learning,
--
hemi
shangi 3 Jun 2015
Install the extension "System Tools"
Here is an option Swap file.
Willy
Where i could found the extension "System Tools" opkg ?
Thanks
Robinson 3 Jun 2015
Install it from the feed (from your box menu) and then you will find it under BLUE.
ims 4 Jun 2015
create swapfile in several steps (this example is for 64MB size, on /media/usb):
in telnet:
dd if=/dev/zero of=/media/usb/swapfile bs=1024 count=64k
mkswap /media/usb/swapfile
chmod 0777 /media/usb/swapfile
then add on end into /etc/fstab line:
/media/usb/swapfile swap swap defaults 0 0
and restart box