IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Swap basics for Ubuntu users.....

3 posters

Go down

Swap basics for Ubuntu users..... Empty Swap basics for Ubuntu users.....

Post by BIT0111-muctadir Mon Aug 02, 2010 12:08 am

What is swap?
Swap space is the area on a hard disk which is part of the Virtual
Memory of your machine, which is a combination of accessible physical
memory (RAM) and the swap space. Swap space temporarily holds memory
pages that are inactive.

How much swap do you need?
it's highly recommended that the swap space should be equal to the
amount of physical memory (RAM). Also, it's recommended that the swap
space is twice the amount of physical memory (RAM) depending upon the
amount of hard disk space available for the system.

Creating swap
At the time of installing ubuntu we can specify how much swap we will use. But it is also possible to add more swap without partitioning any of the HD space. We can create a swap file and allow the os to use that as virtual memory. This is possible because Linux treats everything as a file (like - directory). Now, lets create a swap file and tell our UBUNTU to use that-

First of all we will create a 512MB .swap file
Code:
sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512
Formatting that file to create a swapping device
Code:
sudo mkswap /mnt/512Mb.swap
Adding the swap to the running system:
Code:
sudo swapon /mnt/512Mb.swap
The additional swap is now available and can be seen by
Code:
cat /proc/meminfo
To make the change permanent -
Code:
gksudo gedit /etc/fstab
and add this line at the end of the file
Code:
/mnt/512Mb.swap  none  swap  sw  0 0
BIT0111-muctadir
BIT0111-muctadir
Expert
Expert

Course(s) :
  • BIT

Blood Group : B+
Posts : 233
Points : 395

Back to top Go down

Swap basics for Ubuntu users..... Empty Re: Swap basics for Ubuntu users.....

Post by BIT0122-Amit Mon Aug 02, 2010 1:07 am

nice Very Happy
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Swap basics for Ubuntu users..... Empty Re: Swap basics for Ubuntu users.....

Post by Wasik Ovee Sun Nov 21, 2010 2:10 am

As a swap drive, is it working?
Wasik Ovee
Wasik Ovee
Beta Release
Beta Release

Course(s) :
  • N/A

Blood Group : O+
Posts : 92
Points : 117

http://wasikovee.blogspot.com/

Back to top Go down

Swap basics for Ubuntu users..... Empty Re: Swap basics for Ubuntu users.....

Post by BIT0122-Amit Sun Nov 21, 2010 2:13 am

With the 2.6 kernel, "a swap file is just as fast as a swap partition."

Source:
https://help.ubuntu.com/community/SwapFaq
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Swap basics for Ubuntu users..... Empty Re: Swap basics for Ubuntu users.....

Post by Wasik Ovee Mon Jan 10, 2011 4:31 am

ক্রিয়েট করা সোয়াপ ফাইল রিমুভ করব কিভাবে?
Wasik Ovee
Wasik Ovee
Beta Release
Beta Release

Course(s) :
  • N/A

Blood Group : O+
Posts : 92
Points : 117

http://wasikovee.blogspot.com/

Back to top Go down

Swap basics for Ubuntu users..... Empty Re: Swap basics for Ubuntu users.....

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum