LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can i set the swap after installation (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-set-the-swap-after-installation-500350/)

adam_blackice 11-10-2006 10:17 AM

can i set the swap after installation
 
hello all

any one here know hwo can i set the swap size after installation and how to know the size of it

cuz i did installation with automatic option and i want to make aswap how can i do that and i will

be thankful .

notice am working on Suse linux Enterprise desktop

deadeyes 11-10-2006 10:28 AM

chances are big that there is already a swap partition.

you can see this by typing "cat /etc/fstab" or "mount".
If you see a line with the word swap then you have already one.

But you can also create a swap file after the installation or make a bigger swap partition.

I dont know exactly what commands are needed but Im shure you need swapon (to turn it on & swapoff) (pls look in google, will be easy to find)

weibullguy 11-10-2006 10:33 AM

Create a partition on your HDD if you don't already have one. Assume that this partition is /dev/hda2, do this
Code:

mkswap /dev/hda2
swapon /dev/hda2

Add a line to /etc/fstab so you don't have to manually turn on swap everytime you boot.

Samoth 11-10-2006 10:38 AM

If you have a swap partition you can do
Code:

mkswap /dev/hdX1
and
Code:

swapon /dev/hdX1
.

adam_blackice 11-11-2006 09:01 AM

thanx for all

so how can i set the swap size howa can i set it as 1024 MB and thanx again

michaelk 11-11-2006 09:30 AM

Do you presently have a swap partition? As previously posted look in your /etc/fstab file and an automatic install should of created a swap partition The console command free will show swap space. If total space is greater then zero your swap is active. How much memory do you have installed in this computer and how much swap is being used?

How much swap space required is determined by what you use the computer for and what applications you run. For the typical basic user 512mb is sufficient. Adding additional swap space might be difficult. An automatic install will use all available space and I assume the automatic install created an LVM partition. So it should be possible to resize but it might not be something you may not be willing to undertake.

Here is an eample to create a 128mb swap file.
dd if=/dev/zero of=/tmp/swapfile bs=1024 count=131072
chmod 600 /tmp/swapfile
mkswap /tmp/swapfile
swapon swapfile
To automatically use the file add an entry to your /etc/fstab file
/tmp/swapfile swap swap defaults 0 0

If your /tmp is automatically cleaned at boot then use another directory.

adam_blackice 11-11-2006 01:35 PM

thanx alot i found that he swap automatically created by set up and thanx for you explination :)


All times are GMT -5. The time now is 06:36 PM.