LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 07-01-2005, 01:29 PM   #1
mazzo
Member
 
Registered: Jun 2003
Location: Thames Valley, UK
Distribution: RedHat from 4 -9, Fedora, Ubuntu, Centos 3 - 7, Puppy Linux, and lots of raspberry pi
Posts: 142

Rep: Reputation: 15
swap memory on second drive


Hi

I have "merged" Fedora Core 1 and Ubuntu onto one drive.

Fedora was originally on hda and Ubuntu on a drive in another identical PC. I managed to copy the Ubuntu image onto hda, then thought I'd be really clever and use the spare drive to create a universal /home.

In this way both distros can access the same /home. This works fine.

BUT, Ubuntu seemed to use more space for swap. Now on my hda is the original fedora swap of about 126M, whereas Ubuntu's was about 600M

Ubuntu is running slowly, so I have repartitioned hdb and put an 800M swap file on there. I then changed fstab to say:

/dev/hdb3 none swap sw 0 0

But it won't use it. A df -h shows /dev/shm as only the 126M partition.

The partition is correct and is of the right type. I am now wondering whether swap HAS to be on the first drive?

What have I failed to do - or done wrong?

Thanks
 
Old 07-01-2005, 02:26 PM   #2
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
run this

swapon /dev/hdbX

whatever ur swap partition is
and also run
swapoff /dev/hdaX
to stop use of this swap partition

regards
 
Old 07-01-2005, 02:38 PM   #3
mazzo
Member
 
Registered: Jun 2003
Location: Thames Valley, UK
Distribution: RedHat from 4 -9, Fedora, Ubuntu, Centos 3 - 7, Puppy Linux, and lots of raspberry pi
Posts: 142

Original Poster
Rep: Reputation: 15
Thanks - perfect!

I now have 1.2G of swap. This may be too much, but if it doesn't slow it down, it will be ok.

I need to sort out in my head the difference between tmpfs and swapfile.

Thanks again.
 
Old 07-01-2005, 02:44 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Tmpfs is a filesystem that is stored in ram. Conversely, swap is a way for "virtual ram" to be stored on disk.

FYI, Look into the pri= option of fstab for multiple swap spaces: with swaps on multiple drives, you can see a significant performance boost if they are at the same priority. Otherwise (as a default), the first swap must be full before it uses the second.
 
Old 07-01-2005, 03:00 PM   #5
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
Quote:
Originally posted by mazzo
Thanks - perfect!

I now have 1.2G of swap. This may be too much, but if it doesn't slow it down, it will be ok.

I need to sort out in my head the difference between tmpfs and swapfile.

Thanks again.
gr8

well if i have good amount of RAM then i do not like to use more swap
it can slow down some time too
 
Old 07-01-2005, 03:25 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940Reputation: 3940
It's a good idea to have swap-space on multiple drives, particularly if your hardware is such that more than one input/output operation can be going on simultaneously.

The rule of thumb, afaik, is that total swap-space should be about 2x the size of RAM. Beyond that, it probably won't be used. And of course, "chips are cheap." Purchase as much RAM as the box will hold.
 
Old 07-01-2005, 03:41 PM   #7
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Quote:
Originally posted by masand
gr8

well if i have good amount of RAM then i do not like to use more swap
it can slow down some time too
lots of swap doesn't slow things down
swap on two different hardrives is a good thing

having no swap and lots of ram is worse than having lots of swap and lots of ram just because the kernel vm is designed to have swap -- without swap the kernel vm is all screwed up
 
Old 07-01-2005, 03:46 PM   #8
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 69
well i meant to say that ,it is not good to be much dependent on swap

if i have good RAM then i like to minimize swap usage with modifying some kernel VM parameters

regards
 
Old 07-01-2005, 04:07 PM   #9
mazzo
Member
 
Registered: Jun 2003
Location: Thames Valley, UK
Distribution: RedHat from 4 -9, Fedora, Ubuntu, Centos 3 - 7, Puppy Linux, and lots of raspberry pi
Posts: 142

Original Poster
Rep: Reputation: 15
Thanks for that - it has helped greatly. Made it a lot clearer!

It certainly is running quicker now I have it enabled. It crashed earlier when I was scanning a large image. Now it's fine.

Thanks to all of you!

Last edited by mazzo; 07-01-2005 at 04:10 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Swap being used before memory gone bmiley_ncaa Linux - Hardware 2 09-29-2004 03:53 PM
no memory swap os2 Programming 2 06-11-2004 12:32 PM
Difference between Swap Virtrual memory and Swap Parition Nappa Slackware 4 11-27-2003 07:58 PM
Swap Memory in use or not? Qebex Linux - Hardware 5 09-21-2002 07:59 AM
swap drive, physical memory glock19 Linux - General 6 03-08-2002 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration