LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   increase swap size (https://www.linuxquestions.org/questions/linux-newbie-8/increase-swap-size-663581/)

ssilayaraja 08-18-2008 08:33 AM

increase swap size
 
i installed fedora9 in my desktop machine with 512 MB RAM.
partitions size are
/boot=100MB
/root=10GB
swap=1GB
now i increased the RAM 512MB to 1GB i want to increase my swap file to 2GB without losing data
plz tell me how to

garyalex 08-18-2008 08:39 AM

You can use a utility such as parted to resize your partitions to give your swap partition more space.

johnsfine 08-18-2008 08:42 AM

Is that 11.1 GB the size of the whole hard drive? Or do you have unpartitioned space or do you have other partitions you didn't mention?

Do you have a more significant reason to want to increase your swap space or are you just following some formula that says it should be double the ram size?

You can use the partitioning tool when booted from a liveCD to move, shrink and grow partitions as you like, and you could increase that swap partition without losing data. If you move the boot partition, you might need to reinstall stage 1 of grub, but that is also easy while booted in that liveCD.

Before trying any of that, you should have a better idea of whether increasing your swap partition size is a good idea. From the little info you've provided, I would guess it is not.

syg00 08-18-2008 08:45 AM

In other words, don't bother unless you are already paging (with the new memory installed).

b0uncer 08-18-2008 09:42 AM

And if you do use swap considerably with your new memory in use and think you need to extend the swap partition, consider buying even more RAM.

AwesomeMachine 08-18-2008 09:23 PM

You can make another swap file:

linux # dd if=/dev/zero bs=1M count=1000 of=/home/sam/swapfile
mkswap /home/sam/swapfile
swapon /home/sam/swapfile

This way you can test if you really need it, and if you do, put an entry in /etc/fstab, and if you don't, delete it.


All times are GMT -5. The time now is 06:18 AM.