Operating System - Linux
1751805 Members
5295 Online
108781 Solutions
New Discussion юеВ

How to add swap on SUSE Linux?

 
Kenneth Leung_2
Frequent Advisor

How to add swap on SUSE Linux?

Can anyone teach me how to add swap on SUSE Linux? thanks a lot.
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: How to add swap on SUSE Linux?

Shalom,

To add temporary swap.

http://www.puschitz.com/InstallingOracle10gOnSUSE.shtml

Permanent:

http://en.opensuse.org/Encrypted_Root_File_System_with_SUSE_HOWTO

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Terlisten
Honored Contributor

Re: How to add swap on SUSE Linux?

Hello Kenneth,

if you have a empty blockdevice, you can format it with mkswap, for example:

mkswap /dev/sdb3

With swapon /dev/sdb3 you can add this new formatted swapspace on the fly to you system. With an entry for this swapdevice you can mount it on every boot. Simply add the following line to you /etc/fstab:

/dev/sdb3 swap swap defaults 0 0

If you have no blockdevice, you can use a file as well:

dd if=/dev/zero of=/tmp/swapfile bs=1M count=1024

With this command you create a file with a size of 1 GB.

After that you do the same as above described:

mkswap /tmp/swapfile
swapon /tmp/swapfile

If you wish to mount this swapfile on every boot, put an entry in the /etc/fstab:

/tmp/swapfile swap swap defaults 0 0

You can check the success of your work with swapon -s.

Kind regards,
Patrick
Best regards,
Patrick