-   Linux - Newbie (
-   -   2 swap partitions (

librano 08-25-2004 10:23 AM

2 swap partitions
hi all..

i have 2 hard disks each 40 gb and 7200rpm matrox... at the moment i have mandrake 10 installed on one of them (hda) and the other has 2 NTFS partitions (hdb)... remnants of winXP :D.... being NTFS they are kinda locked since i cant write to them and i dont have winXP any more... so i want to format them into ReiserFS partitions...

I also want to try out some other distros to see which exactly fits my needs... i plan to install the 2nd distro on the 2nd hardisk (hdb)... undecided still about which one to go for but probably SuSE...

question is... i want to create a 2nd swap partition on hdb for the 2nd distro.... now
1. is it possible for both of the distros to use both swap paritions while they are running (not at the same time of course)
2. will this cause problems for the other distro??
3. how much of a performance gain can i expect?? considering that linux will have access to 2 swap partitions on separate hard disks... which i suppose (suppose being the key word) means doubled speeds at which it can access swap...

other info that might be relevant... i have only one ide ribbon cable connecting both harddisks to the motherboard... my present ram situation = 256 sdram with 499mb swap partition on hda.... i want to add another 500mb swap partition on hdb...

thanks for your replies!

AvePtah 08-25-2004 10:45 AM

I am fairly certain that two or more distributions can share the same swap partition without problem.

A swap partition is just virtual memory. Memory is volatile, thus any data stored in swap will be erased when the system is rebooted, meaning it is blank when you boot either distro.

As for performance, I don't think you will see a performance difference whichever method you choose; the gain that you would see by using a single swap partition is that you will save 500mb of space :)

AvePtah 08-25-2004 10:55 AM

ok I just re-read your question.


is it possible for both of the distros to use both swap paritions while they are running (not at the same time of course)
Well I don't entirely understand what you are asking. Do you want the distros to use both swap partitions, i.e. so you have a total of 1GB of swap? I don't know if that is possible, whether it's at the same time or not.

IMO you should just stick with the single swap partition for both distros.

halo14 08-25-2004 12:45 PM

I would suggest using the single swap partition on each distro... unless you have a really slow box.. you probably don't even need too much swap... as linux takes good care of ram... i hate 512 DDR... and rarely ever even use up all of that running xterm/mozilla/OOoW/X-Chat at the same time... so just give yourself a swap that's 1.5 - 2 times the amount of ram you have.. and you'll be sittin' pretty... ;) Good Luck...

michaelk 08-25-2004 01:40 PM

Yes, you can have multiple swap partitions and by both distros. I believe the max is 128 partitions each being 2GB in size.

Do you monitor swap usage? How much of the 499MB is being used? Wether or not you need extra swap depends on the applications and what the PC is used for. For most desktop workstations 512MB is more then sufficient.

J.W. 08-25-2004 02:24 PM

You can definitely share a single swap partition between 2 distros. However, keep in mind that anytime you system uses swap, you are performing physical reads/writes, which are approx 6 orders of magnitude (ms versus ns) slower than accessing the same data in RAM. If you swap usage is high, you will be seeing a dramactic decrease in system response time rather than an increase.

Swap was important back in the days were 64Mg of RAM was considered bleeding edge. Today, with PC's typically using 256 or 512Mg as the standard, it's far less likely that swap will be used on a consistent basis, and I would say that if you've got at least 256Mg of swap that would be plenty, regardless of the amount of RAM. (Again, the rule of thumb to make swap twice as large as RAM is pretty much a remnant of ancient times - it's probably a useful exercise to inspect what your current swap usage actually is.) If you do see high swap usage, I'd recommend buying more RAM. Ideally, if you are aiming for maximum system performance, you'd want your swap usage to remain as close to zero as possible. -- J.W.

librano 08-25-2004 02:55 PM

thanks for the replies...

let me give you my memory situation now... i'm running mandrake 10 with KDE now... i have opera open with 3 pages, azureus with 2 torrents running, KDE system Load (monitor app), XMMS with Madman music library and stereo effects, Mandrake Control Center, and the rest of the system processes running... all 256 mb ram of physical memory is being used and about 210 mb of swap.. azureus is using the most ram 272mb ram... and X is using 100mb...opera 80mb..

everything is running fine now without a glitch... the problem comes when i run VMWare with WinXP... when i do... my harddisk hardly ever stops working... then everything grinds to a crawl...even then not all my swap is used... about 300mb... i was thinking if i split the swap load between 2 hard disks maybe it would run faster... i know more ram would fix it but i dont want to spend money on sdram... i'd rather save and get a new mother board and some ddram...

it is amazing though when VMWare really clogged up my system i was expecting something to crash... everything worked slow... but linux was stable as a rock... once i closed VMWare everything was back to normal.... if i were on XP the only way out of that would have been reset... i didnt even have to reboot... i'm impressed!!!

u may be thinkin why i dont just dual boot... well thats coz my mother board and processor are not the best of friends... my old processor got fried... and i have to update the BIOS for my motherboard to recognise the processor as Athlon XP 2000 ... right now it says unknown AMD processor... and WinXP gives a hardware configuration error and wont install... strange isnt it... mine is probably the only box which has hardware probs with WinXP and not with Linux!! and i need macromedia flash MX 2004 for this project i'm doing... so i just need WinXP for a couple weeks only...

anyways.. i guess i'll try the 2 swap partition idea... and see if it actually helps...but i dont want to reboot :( i'm shattering every uptime record i ever had with WinXP... and aiming to shatter my friend's WinXP uptime record of about a week ;) :D

thanks for the help...

ps.. i was wondering if there is a way to force a program like azureus (java bittorrent client) to use more swap instead of my physical ram... coz its only downloading... i dont really need it to be super responsive...

All times are GMT -5. The time now is 05:27 AM.