On 09/26/17 14:13, Greg Garrison wrote: > Hello, > > > Looking for help. I am trying to run an application that requires 2 GB > of swap. My VPS instance has 256 by default. For some reason the > application will not accept a swap file. It is possible to resize > partitions live to get a bigger swap space?
First of all, let's be accurate: your app requires 2G more memory than you have. You are choosing to use swap. You will probably regret this. But hey, I'm having a cynical day. I didn't follow a boss's direct instructions today, probably saving his job. I feel cheated. So lemme help you aim that gun at your feet as you are requesting. This is either a question about your hosting provider or about OpenBSD. Can you build an OpenBSD system on your hosting provider as you want it? That's between you and them. Mine gives me a crap install, I just download a -current bsd.rd, bring up a console, reboot off that. Now that I've got bsd.rd running, I build the disk layout as I want it, in your case, with lots and lots of swap you will regret using, but also partition it up, like any good OpenBSD install. Now, if you are asking about resizing swap as an OpenBSD function...depends on how you laid out your disks. If you used all your space, nope, you are stuck. If you have unpartitioned space, then yes, you can create a new partition of type "SWAP", and use "swapon" to add it to your existing swap space while the system is running, and put it in /etc/fstab so it's used next time at boot. IF you want to change your swap partition itself, first, you need space. Then you want to remove it from swap (hope you aren't using it), then change your partitions, and add it back in as swap. man swapctl is your friend. (Don't get me wrong, I almost always set up machines with swap as a safety margin. I recently had a system start burning RAM and then swap at an obviously "this isn't gonna work!" rate, so I fairly quickly found a chunk of unused disk, made it a swap partition, and added 30G swap to the system. I then decided to stop my task and try again after maxing the machine out with the most RAM I could with junk on hand -- 4G, which was double what it had, and moving the swap to a different physical disk, so it would spend time only thrashing the disk for memory, not memory+task. The task took days to complete, but it did (using about 3G swap at its peak, iirc). My foot targeting issue is the phrase, "application that requires 2G swap". That's just wrong.) Nick.