LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2011, 11:31 PM   #1
darthpinguim
Member
 
Registered: Feb 2011
Location: Belo Horizonte - MG - Brasil
Distribution: Ubuntu 12.04 / Debian 6
Posts: 32

Rep: Reputation: 0
Using swap for more than one distro


Hi. I'm considering formatting my PC and installing more than one distro. Is it possible to use the same swap partition for all the distros, no matter how many they are?
Thanks in advance.
darthpinguim
 
Old 08-04-2011, 12:04 AM   #2
FredGSanford
Senior Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia Cauldron - Debian Testing - Salix OS
Posts: 1,004
Blog Entries: 5

Rep: Reputation: 121Reputation: 121
Yes you can use the same swap partition for different distros...
 
Old 08-04-2011, 03:48 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
With some caveats:
- don't use hibernate (to swap); that will get ugly real quick.
- installing a later distro will probably issue mkswap. Which will change the UUID. Which will break distros that use UUID in fstab (for swap).

Certainly do-able, but (sometimes) you just need to be a bit careful.
 
1 members found this post helpful.
Old 08-04-2011, 11:31 AM   #4
darthpinguim
Member
 
Registered: Feb 2011
Location: Belo Horizonte - MG - Brasil
Distribution: Ubuntu 12.04 / Debian 6
Posts: 32

Original Poster
Rep: Reputation: 0
Hi there. Thanks for the replies!
Concerning the last post (from syg00) what could I do then?
I'm considering installing Slackware, Debian and maybe Ubuntu. Is there any kind of conflict between the UUID from each distro mentioned before?
Thanks again.
darthpinguim
 
Old 08-04-2011, 04:00 PM   #5
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Quote:
Originally Posted by darthpinguim View Post
Hi. I'm considering formatting my PC and installing more than one distro. Is it possible to use the same swap partition for all the distros, no matter how many they are?
Thanks in advance.
darthpinguim
Another interesting point is that if you have enough ram, you may never actually use swap
(depends on what software you use and how you use it though!)
 
Old 08-04-2011, 06:29 PM   #6
darthpinguim
Member
 
Registered: Feb 2011
Location: Belo Horizonte - MG - Brasil
Distribution: Ubuntu 12.04 / Debian 6
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by qlue View Post
Another interesting point is that if you have enough ram, you may never actually use swap
(depends on what software you use and how you use it though!)
How much RAM would be enough to do so, and in this case when proceding in the installation I would only install the system on the '/' partition (or any other partitioning configuration)?
Best regards
darthpinquim
 
Old 08-04-2011, 06:50 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Quote:
Originally Posted by darthpinguim View Post
I'm considering installing Slackware, Debian and maybe Ubuntu. Is there any kind of conflict between the UUID from each distro mentioned before?
Distros don't have UUIDs, but partitions have. While Slackware by default doesn't use them Debian and Ubuntu do. That means that if you install Debian it normally will format the swap-partition, which gives the partition a new UUID. This UUID will be used by Debian to identify the partition that is used as swap. When you install Ubuntu later it also formats the swap partition normally, so that the UUID is changing again. Debian will not find its swap partition because of that, but you can simply correct that by substituting the old UUID with the new one in Debian's /etc/fstab.

There are two other ways to avoid that situation:
1. Don't use swap-partitions, use swap-files.
2. Don't use swap. I would not recommend that, for two reasons: Even if you have plenty of free RAM swap may be used to increase performance, and you may run into a situation where all your physical RAM is used, this will have nasty side-effects.
 
Old 08-04-2011, 06:51 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
Re syg00's post: as he indicated,
1.ensure you use a std mt point and not uuid in fstab.
2. you can't be sure to never use swap, so assume it will get used at some pt, even it's just a little bit.
 
Old 08-04-2011, 10:51 PM   #9
FredGSanford
Senior Member
 
Registered: Nov 2005
Location: USA
Distribution: Mageia Cauldron - Debian Testing - Salix OS
Posts: 1,004
Blog Entries: 5

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by chrism01 View Post
Re syg00's post: as he indicated,
1.ensure you use a std mt point and not uuid in fstab.
2. you can't be sure to never use swap, so assume it will get used at some pt, even it's just a little bit.
I never really noticed if one distro doesn't use swap if another one changes the UUID. I have only been using two distros at the most now days and in the old days, before using UUIDs, they all used standard mount points.
 
Old 08-05-2011, 12:19 PM   #10
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Smile

Quote:
Originally Posted by chrism01 View Post
Re syg00's post: as he indicated,
1.ensure you use a std mt point and not uuid in fstab.
2. you can't be sure to never use swap, so assume it will get used at some pt, even it's just a little bit.
My experience with an Acer Aspire One netbook that had a slow ssd is that using swap freezes a netbook! The problem became a little less extreme when I replaced the ssd with a proper hard drive but still the netbook would freeze on occasion! When I upgraded the ram to 1.5G (maximum for the AAO) I haven't used swap since!
The swap partition is still there, I just don't end up running short of ram anymore!
Here is an interesting article that highlights the issue of different uses and ram memory management!
 
Old 08-05-2011, 01:56 PM   #11
wagscat123
Member
 
Registered: Jan 2009
Location: Maryland-Pennsylvania border, USA
Distribution: openSUSE 13.2, 42.1, and 42.2, OS X 10.10, Ubuntu 16.04, and Linux Mint 17.3
Posts: 545
Blog Entries: 9

Rep: Reputation: 58
Quote:
Originally Posted by qlue View Post
My experience with an Acer Aspire One netbook that had a slow ssd is that using swap freezes a netbook! The problem became a little less extreme when I replaced the ssd with a proper hard drive but still the netbook would freeze on occasion! When I upgraded the ram to 1.5G (maximum for the AAO) I haven't used swap since!
The swap partition is still there, I just don't end up running short of ram anymore!
Here is an interesting article that highlights the issue of different uses and ram memory management!
I haven't used swap since bumping my RAM up to just 1 GB.
 
Old 08-06-2011, 01:06 PM   #12
darthpinguim
Member
 
Registered: Feb 2011
Location: Belo Horizonte - MG - Brasil
Distribution: Ubuntu 12.04 / Debian 6
Posts: 32

Original Poster
Rep: Reputation: 0
I'll study a little bit more the options I have already.
Thank you all for the help.
Thank you qlue for the article.
Best regards
darthpinguim
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to swap out (to swap area) page frames a process use? entertainyou Linux - Kernel 3 03-23-2011 10:52 PM
Gparted says swap has 5 Gb, grep SwapTotal /proc/meminfo says swap has 800 Mb rickrandall Red Hat 3 02-24-2010 01:09 PM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 01:57 PM
New distro, same swap? lacerto Linux - Newbie 2 01-26-2005 10:04 AM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 02:23 AM


All times are GMT -5. The time now is 12:58 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration