1
1
Matt Lacey explained how to compile dplyr on low memory VPS. He managed to install dplyr by adding a larger swap space. Unfortunately this operation is not permitted on my VPS (Virtual Private Server): "swapon failed: Operation not permitted". Here is the output:
$ sudo fallocate -l 1G /swapfile
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=3bfbcf12-6b81-46b4-96b0-7de37fa1640b
$ sudo swapon /swapfile
swapon: /swapfile: swapon failed: Operation not permitted
$ cat /proc/swaps
Filename Type Size Used Priority
/dev/null partition 131072 3060 -1
EDIT I used other instructions from digitalocean to create a swap file. But they failed too:
sudo swapon /var/swap.img
swapon: /var/swap.img: swapon failed: Operation not permitted
There is a related issue in the dplyr package's repository.
Are there other, recommended ways to enlarge the swap space?
Are you on an OpenVZ machine? If so, then you may take a look at this purported trick, http://www.serveridol.com/2014/08/03/how-do-i-create-swap-partition-in-linux-mkswap-operation-not-permitted/, which is widely discussed on the Net. I never tried it myself, so I will not try to sell it as the solution, but given the dire straits you seem to find yourself in, it might be worth a try.
– MariusMatutiae – 2015-12-18T09:49:22.087Look interesting. Might get you in trouble if you abuse it, but this might be an option if you needed it just once and right now. (As opposed to waiting to the VPS provider). @Paul4forest. If this works then please leave some feedback. – Hennes – 2015-12-18T10:13:58.047
Yes, pls, leave a feedback if this works. But then, on a different note: do you really want to run the R statistics package on such a small server??? It will easily hog out all of your resources. – MariusMatutiae – 2015-12-18T12:11:04.413
@MariusMatutiae the link you posted proposes 2 solutions: (1) create a swap file or (2)create a swap partition. I used instruction from digitalocean to create a swap file. But this is not permitted
– Paul Rougieux – 2015-12-18T12:38:59.087swapon: /var/swap.img: swapon failed: Operation not permitted
. I didn't figure out how to do option (2), sincels /dev
doesn't show me any sda.This small server is good enough to process a gigabyte of data and share the result in the form of static files. – Paul Rougieux – 2015-12-18T12:39:19.223
1The link I posted has a solution starting with
Create a script file named “create_swap.sh”
. That's what you should try to do. It is quite different from what you have tried so far. – MariusMatutiae – 2015-12-18T13:09:45.503Executing the script file fails with the message:
#sh create_swap.sh create_swap.sh: 2: create_swap.sh: Bad substitution
. – Paul Rougieux – 2015-12-18T13:35:16.493Running the script with bash instead of sh doesn't return an error.
sudo bash create_swap.sh 4096
. But it doesn't add any swap space. I still havemem total 1024
andswap total 128
. @MariusMatutiae To answer your first question I am on openVZ. – Paul Rougieux – 2015-12-22T07:40:40.123