Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I just got done upgrading one of our servers to Redhat 7.2 When I was adding the swap space I mistakenly created it as 8MB! Oops. Now some of my customers are getting forking errors when my swap space is full. My question is how can I change the swap size on that partition. Can I do it without interupting access? I have no free space left, so can I reduce the size of one of the other partitions and allocate it over to swap? Thanks for your help on this.
Is it possible to delete my current swap partition, change the sizes of others and recreate a bigger swap partition, or am I asking for too much? The mkswap command seems to use space on an existing partition. What does this do to the use of that partition?
yeah you can make a swap parition with the mkswap command then add it to your fstab file so it mounts it at bootup, but you first have to have the parition setup that you would want to use.. that usually requires third party software if you want to move or change a current partition setup.
Your system is busy enough that swap is being maxed out. You have now free space in your HD. You want to increase the amount of swap available.
this is tricky
if your swap is being consumed, you don't want to shut down the one and only swap partition. If you had free disk space you could create another swap file and that would help alleviate your problem.
I beleive you can even create a swap file on an NFS mount, but dont quote me on this.
You cannot shut off your swap if it is the only one present and it is maxed out.
as for resizing partitions while the system is live. You would likely get away with swap, but not anything mounted. If you touch a mounted filesystem, you could inadvertently truncate and be really hosed.
Here is what I would do. Get another HD, and find a time to put it in the box. Slice up the drive so that you can have some extra partitions for more swap in the future as well as regular filesystem space. Once the box is back up you can create and add and extra swap partition or two. Make it permanent by editing /etc/fstab and adding it in.
More memory would be good too.
unfortunately, native Linux does not handle dynamic resizing of filesystems. there are logical volume management software solutions that do do this though. However none that I have used (Veritas, SDS, AIX's LVM) would I ever try to shrink a volume.
I'm pretty sure I don't need more physical memory, but it is a good suggestion. I currently have 1GB of RAM and I think the main problem is that my swap is so much smaller (8MB). We normally go for 2xRAM for swap size, but I totally goofed when setting up the fs's during install. Obviously now that I've gotten all of my users and everything set-up I'm not too keen on re-installing an OS.
I guess my final question would be, how do I display the amount of non-partitioned free space available? I thought perhaps a df would show it, but I don't see it. Thanks alot, trickykid and jatimon for your help guys.
Also the adding a hard drive idea is good as well. Since I don't want to mess with the mounted filesystems. But I may have some unallocated free space, I just need to figure out how to see what there is available.
Fdisk will display your patition info. There's also a hardware browser in Redhat which will give you the info. It's buried in one of the configuration/system info menus under the "start"" button; I think you can also just open a term and type "hwbrowser" to launch it.
I to would suggest another hd. However since you weren't quite clear on having free space on the currect hd[s] a fix that I can suggest if indeed to have space to spare is a swap file. mkswap will work equally well on a file, and the kernel doesn't care about partition or file either way. Simply make an empty file. dd if=/dev/zero of=swapfile bs=1024k count=500. Now obviously place this somewhere logical like a partition you have space to spare, and change 500 to suit your mb size, it's currently 500, then just mkswap swapfile and swapon swapfile, add it to /etc/fstab and you're off to the races. There won't be any speed problems from this and if/when you do get a new hd or repartition or what have just delete that swapfile and you've lost nothing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.