LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Swap Space (https://www.linuxquestions.org/questions/linux-newbie-8/swap-space-4175511677/)

abhijeetdutta 07-20-2014 11:57 AM

Swap Space
 
Hello Members,

Just a small question to all my friends.

I know how to increase or decrease a swap partition, but i have scenario in my mind, how can I increase a swap partition if i don't have any free space in any of my partition.

I am not interested to add any extra disk.

Is this scenario is possible?

Cheers!

jailbait 07-20-2014 12:01 PM

Yes, you can add a swap file:

http://www.cyberciti.biz/faq/linux-a...ap-file-howto/

-------------------------
Steve Stites

TB0ne 07-20-2014 12:07 PM

Quote:

Originally Posted by abhijeetdutta (Post 5206848)
Hello Members,

Just a small question to all my friends. I know how to increase or decrease a swap partition, but i have scenario in my mind, how can I increase a swap partition if i don't have any free space in any of my partition. I am not interested to add any extra disk. Is this scenario is possible?

You can create a swap file, but the better question is "Why???" If your server is configured and sized correctly, chances are you will NEVER use swap, and there's no need to create more. What is telling you that you need more swap space? And if ALL your disks are 100% full, you have other issues as well.

Also, since you've been here for five years now, and have been an administrator for that long, you should know that asking questions requires DETAILS...things like what kind of hardware, version/distro of Linux, what you've done/tried so far, what this server does, and what error(s) you're seeing that would lead you to think performing this action is a good thing.

What are you trying to accomplish??

abhijeetdutta 07-20-2014 12:21 PM

Okay, My mistake. It just a question that comes in my mind, I haven't yet faced any such challenges.

It could be any hardware or virtual server.

Take distro as RHEL-6 or Centos-6

I just had a swap decrease from ubuntu server, because it wrongly configured while building.

Same time i have question what I will do if i face such scenario, where I don't have any space left in partition and can't add any extra disk.

That's all

TB0ne 07-20-2014 01:24 PM

Quote:

Originally Posted by abhijeetdutta (Post 5206856)
Okay, My mistake. It just a question that comes in my mind, I haven't yet faced any such challenges.
It could be any hardware or virtual server. Take distro as RHEL-6 or Centos-6

I just had a swap decrease from ubuntu server, because it wrongly configured while building.

And again, why would it matter? Swap is VERY rarely used these days, ever. I've got plenty of servers with only a 2GB swap, and that is WAY more than is needed.
Quote:

Same time i have question what I will do if i face such scenario, where I don't have any space left in partition and can't add any extra disk.
You will NEVER be in that scenario, since you can ALWAYS add more disks to a server. And again, if you have been an administrator for five years, you should know how to properly size and configure a server, so that you don't run out of resources and NEED swap space, much less run out of disk space.

JeremyBoden 07-20-2014 05:33 PM

For the future...
Read up on LVM - you need never have to resize a partition again.


All times are GMT -5. The time now is 10:03 AM.