Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Assume that i have installed centos and its running as fine, when i installing os its having ram memory of 2GB, but while installing time i have given as ram size is wrongly as 1024(i.e swap memory is 1024)
Now i just want to update the ram size as 2GB, i.e. i want to extend the swap memory as 2048, this will happen without down the os or without delete the swap memory and again for recreating swap memory like that ...
1) You probably don't need to increase swap. There is no meaning behind whatever rule you found relating ram size to swap size. Increasing swap to 2GB is probably a good idea at some point, but not urgent enough to worry about now.
2) If you really need more swap space right away with minimum disruption on a running system, add a swap file (1GB). Linux can use multiple independent swap allocations (as the total of their sizes). Swap files are a lot easier to add on the fly than adding or resizing partitions.
^ True, that would work- but your partition table gets real ugly real fast that way (not that it matters terribly much, I just like an orderly partition table).
1. forget talking about RAM: you've got what you've got and the system doesn't let you set that on install anyway. It'll use it all.
See the output from 'top'.
2. as above, what you're talking about is swap space on disk.
Its perfectly possible to add and and activate another swap partition without re-booting IF you already have some spare disk space to put it (NB: I don't think you can resize root '/' partition when its running; its risky in any case).
What you need to do is google for your Linux distro and 'add swap' to see how.
Note that a swap partition is different from a swap file, although they perform the same job. I'd go with adding a partition.
Its perfectly possible to add and and activate another swap partition without re-booting IF you already have some spare disk space to put it (NB: I don't think you can resize root '/' partition when its running; its risky in any case).
It's possible to add swap partition(not sure about extending) on running system only if there is free space, if no free space then they will have to free up space from another partition & extend swap. The problem is which partition to free up space & how many partitions have to be moved to access it. Also can the partitions be unmounted to perform task. Most likely OP needs to shutdown to perform task.
Quote:
Assume that i have installed centos and its running as fine, when i installing os its having ram memory of 2GB, but while installing time i have given as ram size is wrongly as 1024(i.e swap memory is 1024)
I've never had a system ask about ram size nor swap.
Note that a swap partition is different from a swap file, although they perform the same job. I'd go with adding a partition.
There is barely any advantage to a swap partition vs. a swap file. In normal operation, there is no advantage to partition vs. file.
If expanding the existing swap partition were easy, I would recommend it. If we saw output from
/sbin/fdisk -l
we would have a better idea whether expanding or adding a swap partition without booting alternate media is easy, difficult, or impossible.
Meanwhile, I'm assuming that is not easy, so adding a swap file is easy and solves the problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.