Create Swap File on Ubuntu Server on Rasp Pi 3


#1

Hello, I have an Owncloud server running on Ubuntu Server 16.04 on a Raspberry Pi 3. I've had it up for a few days now and everything for the most part is working very well. I haven't set up any swap area on my server. I have an idea for a set up and I just wanted to get some feedback on whether or not this is a good idea.

So the OS and Owncloud backend is installed on the PI's 32 GB sd card. The owncloud data folder is on a separate usb HDD. I know it's not a good idea to put a swap file onto an sd card, so I want to put one on the same partition as the owncloud/data on the spinning hard disk. I was going to use the fallocate utility to set this up, but this returned an error because the HDD is a fat32 file system and fallocate does not support fat32. So another option, which I'm almost certain will create the swap file, is to run a dd if=dev/zero of=/mnt/sda1/swap.file bs=1M count=3072, and then make that 3GB file into a swap file for the system. The Raspberry Pi 3 has 1GB of memory. I read somewhere else that Owncloud would like to have 3GB of swap to go along with this amount of memory.

I am hesitant to execute this operation because my instance of Owncloud is working "good enough" right now as is. There are times when navigating the web interface that it gets a little laggy though, and I thought maybe some swap could help remedy this.

Does this sound like an okay idea? Is putting the swap file on the same partition as the owncloud/data going to mess anything up? I know that dd can take awhile to do its job. Does anyone have any idea how long it will take to make my 3GB swap file?

Thanks


#2

Hi,

system operations like this will never affect a PHP application like ownCloud as long as it doesn't affect the stability or performance of your system.

As creating such a swap file is something which is nothing ownCloud specific and highly depends on your setup and operating system i'm suggesting to jump over to a community like https://www.raspberrypi.org/forums/ where you can meet people be able to telling you if this is a good idea.


#3

Thank you! I'll head over and check that out. I appreciate it.