When I installed SuSE 9.3, I created a swap partition /dev/sda7. When I installed Fedora Core 4, I created a swap partition /dev/sda12. Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap? (Currently IIRC SuSE uses only /dev/sda7 and FC4 uses only /dev/sda12.) The contents of a swap partition are emptied at shutdown, right? So when I startup another OS which can use the same partition for swap it will not cause any problems, right? If the contents of a swap partition are emptied at bootup instead, then even if the previous shutdown was faulty (power off without unmount or something like that) then the swap partition can still be accessed. Please advise. -- Shriramana Sharma http://samvit.org (o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
On Tuesday 16 August 2005 14:12, Shriramana Sharma wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. When I installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap? (Currently IIRC SuSE uses only /dev/sda7 and FC4 uses only /dev/sda12.)
The contents of a swap partition are emptied at shutdown, right? So when I startup another OS which can use the same partition for swap it will not cause any problems, right?
If the contents of a swap partition are emptied at bootup instead, then even if the previous shutdown was faulty (power off without unmount or something like that) then the swap partition can still be accessed.
Please advise.
All will be OK. I use two swap partitions without any trouble.
On Tuesday 16 August 2005 3:12 pm, Shriramana Sharma wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. When I installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap? (Currently IIRC SuSE uses only /dev/sda7 and FC4 uses only /dev/sda12.)
The contents of a swap partition are emptied at shutdown, right? So when I startup another OS which can use the same partition for swap it will not cause any problems, right?
If the contents of a swap partition are emptied at bootup instead, then even if the previous shutdown was faulty (power off without unmount or something like that) then the swap partition can still be accessed.
You should have no problems using both swap partitions in your dual boot
scenario.
The contents of the swap file are essentially cleared during the initial
boot into multi-user mode. Any leftover garbage from a previous session is
ignored. Essentially, swap space is used for virtual memory pages that have
been evicted from physical memory.
--
Jerry Feldman
At 03:58 PM 8/16/2005 -0400, Jerry Feldman wrote:
Content-Disposition: inline
On Tuesday 16 August 2005 3:12 pm, Shriramana Sharma wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. When I installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap? (Currently IIRC SuSE uses only /dev/sda7 and FC4 uses only /dev/sda12.)
The contents of a swap partition are emptied at shutdown, right? So when I startup another OS which can use the same partition for swap it will not cause any problems, right?
If the contents of a swap partition are emptied at bootup instead, then even if the previous shutdown was faulty (power off without unmount or something like that) then the swap partition can still be accessed.
You should have no problems using both swap partitions in your dual boot scenario. The contents of the swap file are essentially cleared during the initial boot into multi-user mode. Any leftover garbage from a previous session is ignored. Essentially, swap space is used for virtual memory pages that have been evicted from physical memory. --
I have a feeling that the question being answered is not the question that might have been intended, to wit: "How can I use _one_ swap partition for two OS's? Particularly when each OS uses a different designation for the partition." --doug -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 8/15/2005
* Doug McGarrett
I have a feeling that the question being answered is not the question that might have been intended, to wit: "How can I use _one_ swap partition for two OS's? Particularly when each OS uses a different designation for the partition."
If this is the case, just use the same hardware address in both /etc/fstab files, ie: /dev/hdc7 the remainder should stay as the particular OS designates. fact: the same swap partition can be used for *all* your linux/*nix OS'es as long as only one is active at a time. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery
Patrick Shanahan wrote:
fact: the same swap partition can be used for *all* your linux/*nix OS'es as long as only one is active at a time.
"Only one is active" means only one OS or one swap? I assume it's the former, since others have said that two swaps is not a problem. Now then: does even the *possibility* exist that two OSs are active at a time? (Does this thing called XEN have something to do with running multiple OSs at the same time or just on the same machine?) -- Shriramana Sharma http://samvit.org (o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
On Tuesday, August 16, 2005, Shriramana Sharma wrote:
Patrick Shanahan wrote:
fact: the same swap partition can be used for *all* your linux/*nix OS'es as long as only one is active at a time.
"Only one is active" means only one OS or one swap? I assume it's the former, since others have said that two swaps is not a problem. Now then: does even the *possibility* exist that two OSs are active at a time? (Does this thing called XEN have something to do with running multiple OSs at the same time or just on the same machine?)
--
Shriramana Sharma http://samvit.org
(o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
Wouldn't you have only 1 swap defined to each OS, meaning even if they ran at the same time, they'd be hitting different partitions? Greg Wallace
Greg Wallace wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap?
Are you saying you're wanting to have the same swap(s) active in two os's simultaneously? I wouldn't think you'd want to try that. Anyone else out there doing that?
Two OSs cannot run simultaneously, AFAIK. Maybe this is possible with Xen. Wikipedia says: %--- Xen is an open source virtual machine monitor, or hypervisor, ... It has a design goal of being able to run 100 full featured OS instances on a single typical computer. %--- So possibly this XEN would enable one run many OSs at the same time on a single computer. But if I do that (which I will probably never need to) I understand that it's not a good idea to use the same swap partition for two OSs. The potentiality for conflict is high. And my question was (please re-read the original post included above): I have two partitions on my harddisk which are formatted as Linux-swap. I do not run two OSs simultaneously (which means "at the same instant of time") though I have them installed on my machine. I boot into SuSE, I logout from SuSE, I reboot into Fedora, I logout from Fedora and so on. That's it. Now I wondered if the two swap partitions can both be used by both my installations. If I'm still not clear, I don't know how I can phrase it better. Others have apparently understood my meaning.
Wouldn't you have only 1 swap defined to each OS, meaning even if they ran at the same time, they'd be hitting different partitions?
Right. If I ever used XEN to run my two Linuxes at the same time, I would point SuSE to /dev/sda7 and FC4 to /dev/sda12. -- Shriramana Sharma http://samvit.org (o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
Shriramana Sharma wrote: <snip> I'm not sure what all the confusion is. My fstab: <snip> /dev/hda3 swap swap pri=42 0 0 /dev/hdb3 swap swap pri=42 0 0 <snip> And yes, both are active at all times. I know of no upper limit on the number, you can probably have as many swap partitions as you can put on your hard drives. Now, if you did happen to have two versions of Linux running on the same machine at the same time, then of course you could not use both partitions in both versions. That would be like two different programs trying to write different things into a common memory area. It just won't work, one program will just corrupt what the other has written. Like everyone has been saying, a swap partition is just an extension of RAM -- something in RAM that isn't being used at the current time can be written to swap if there is not enough RAM to keep it there. Linux needs exclusive use of the swap partition(s) it uses to keep this from being corrupted. So a second Linux running on the same machine could not possibly use the same swap partition(s). Finally, when you turn off your computer, whatever is in RAM is lost. Linux treats a swap partition in the same way -- it is just an extension of system memory, and when it is initialized at boot time, it is assumed to be invalid, just as RAM is assumed to be empty at boot time. So you certainly can use the same swap partition for two (or more) different Linux versions, you just cannot have them using it at the same time (as stated above).
On Wednesday 17 August 2005 4:26 am, Shriramana Sharma wrote:
Two OSs cannot run simultaneously, VMWare, Xen and other virtualization solutions make it possible for multiple OS's to run simultaneously, but that is not the way you have your system set up. In a multi-boot situation where you boot up separately, you can share the swap areas between the OS's.
--
Jerry Feldman
On Wednesday 17 August 2005 04:26 am, Shriramana Sharma wrote: [stuff cut] You can have (within reason) as many swap partitions as you like. -- May we never confuse honest dissent with disloyal subversion. Dwight D. Eisenhower (1890-1969), U.S. general, Republican politician, president. Speech, May 31, 1954, New York City.
On Wed, 2005-08-17 at 13:56 +0530, Shriramana Sharma wrote:
Greg Wallace wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap?
Are you saying you're wanting to have the same swap(s) active in two os's simultaneously? I wouldn't think you'd want to try that. Anyone else out there doing that?
Two OSs cannot run simultaneously, AFAIK. Maybe this is possible with Xen. Wikipedia says:
What is VM then? Is it only a paging system which puts the others to sleep? -- o o o o o oo o o o o _______________________________ o _____ | CWSIV@PCMAGIC.NET | .][__n_n_|DD[ ====_____ | M A R K L I N T R A I N S | > (________|__|_[_________]_|___________________________| _/oo OOOOO oo` ooo ooo 'o!o!o o!o!o` Steaming over the bodys of liberals, democrats and mental midgets.
On Saturday, August 20, 2005 @ 6:03 AM, Carl William Spitzer wrote:
On Wed, 2005-08-17 at 13:56 +0530, Shriramana Sharma wrote:
Greg Wallace wrote:
> When I installed SuSE 9.3, I created a swap partition > /dev/sda7. > installed Fedora Core 4, I created a swap partition > /dev/sda12. > > Is it okay if I edit fstab in both SuSE and FC4 to load both > these partitions as swap?
Are you saying you're wanting to have the same swap(s) active in two os's simultaneously? I wouldn't think you'd want to try that. Anyone else out there doing that?
Two OSs cannot run simultaneously, AFAIK. Maybe this is possible with Xen. Wikipedia says:
What is VM then? Is it only a paging system which puts the others to sleep?
I believe VM runs underneath the multi-os's. So, if Linux 1 asks for memory, it goes through VM to get it. VM would then manage farming out space to the various os's. Not sure what happens to swap in this case, but I suspect you wouldn't be using it if you are letting VM manage your VIO. Greg Wallace
On Saturday, August 20, 2005 @ 10:11 PM, Shriramana Sharma wrote:
On 8/21/05, Greg Wallace
wrote:
I suspect you wouldn't be using it if you are letting VM manage your VIO.
May I know what VIO means, please?
V(irtual) M(achine) uses V(irtual) I(nput) O(utput) to manage memory. VM runs underneath your other operating systems. When an OS needs memory, VM handles acquiring it, which is transparent to the OS. Now it's been 15 years since I worked under VM, so I'm really reaching back into some old gray matter here. I suppose that if Linux wanted to grab swap, that would still work the same as in a stand-alone Linux setup, although the I/O would funnel through VM. Greg Wallace
Greg Wallace wrote:
Wouldn't you have only 1 swap defined to each OS, meaning even if they ran at the same time, they'd be hitting different partitions?
Why bother? Also, how do you get two OSs to run at the same time (other than virtual machines)?
Thanks to all who replied. Doug McGarrett wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. When I installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap?
I have a feeling that the question being answered is not the question that might have been intended, to wit: "How can I use _one_ swap partition for two OS's? Particularly when each OS uses a different designation for the partition."
No, the question was answered correctly. Please see my original question above. I said that I have two swap partitions on my sda and wish to use both these for both my Linuxes. Thanks to you and Patrick for the related thought, anyway... :) -- Shriramana Sharma http://samvit.org (o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
On Tuesday, August 16, 2005 @ 6:21 PM, Shriramana Sharma wrote:
Thanks to all who replied.
Doug McGarrett wrote:
When I installed SuSE 9.3, I created a swap partition /dev/sda7. When I installed Fedora Core 4, I created a swap partition /dev/sda12.
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap?
I have a feeling that the question being answered is not the question that might have been intended, to wit: "How can I use _one_ swap partition for two OS's? Particularly when each OS uses a different designation for the partition."
No, the question was answered correctly. Please see my original question above. I said that I have two swap partitions on my sda and wish to use both these for both my Linuxes.
Thanks to you and Patrick for the related thought, anyway... :)
--
Shriramana Sharma http://samvit.org
(o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
Are you saying you're wanting to have the same swap(s) active in two os's simultaneously? I wouldn't think you'd want to try that. Anyone else out there doing that? Greg Wallace
Are you saying you're wanting to have the same swap(s) active in two os's simultaneously? I wouldn't think you'd want to try that. Anyone else out there doing that? That is OS suicide unless the subject OS's are operating under a virtual machine and there is code in the OS's that allow this, and I am pretty sure
On Wednesday 17 August 2005 1:29 am, Greg Wallace wrote:
that Linux does not do this (yet).
(Historically(green eyeshade on), I worked on IBM's VM370 using OS/VS1 as
the production batch OS. IBM had code in both the firmware, VM370, and
OS/VS1 that allowed some compatibilities. (green eyeshade off).
--
Jerry Feldman
Jerry Feldman wrote:
The contents of the swap file are essentially cleared during the initial boot into multi-user mode. Any leftover garbage from a previous session is ignored.
You mean, the OS doesn't care if any garbage is left-over from a previous session but clears (without warning) the contents of the swap file, right? -- Shriramana Sharma http://samvit.org (o- Penguin #395953 //\ running on ancient Indian wisdom V_/_ and modern computing efficiency
Shriramana Sharma wrote:
Jerry Feldman wrote:
The contents of the swap file are essentially cleared during the initial boot into multi-user mode. Any leftover garbage from a previous session is ignored.
You mean, the OS doesn't care if any garbage is left-over from a previous session but clears (without warning) the contents of the swap file, right?
Consider it as an extension of memory. What would Linux expect to find in the memory on reboot? It would consider the memory contents to be garbage and therefore it should also consider the swap contents to be garbage.
On Tuesday 16 August 2005 10:22 pm, Shriramana Sharma wrote:
Jerry Feldman wrote:
The contents of the swap file are essentially cleared during the initial boot into multi-user mode. Any leftover garbage from a previous session is ignored.
You mean, the OS doesn't care if any garbage is left-over from a previous session but clears (without warning) the contents of the swap file, right? Yes. It actually does not clear the contents. The OS (via hardware/software) keeps track of memory pages. When it needs to evict a page to swap, it writes that out to the swap area. So, the OS always knows the status of every page that is stored in swap.
--
Jerry Feldman
On Wednesday 17 August 2005 7:07 am, Jerry Feldman wrote:
On Tuesday 16 August 2005 10:22 pm, Shriramana Sharma wrote:
Jerry Feldman wrote:
The contents of the swap file are essentially cleared during the initial boot into multi-user mode. Any leftover garbage from a previous session is ignored.
You mean, the OS doesn't care if any garbage is left-over from a previous session but clears (without warning) the contents of the swap file, right?
Yes. It actually does not clear the contents. The OS (via hardware/software) keeps track of memory pages. When it needs to evict a page to swap, it writes that out to the swap area. So, the OS always knows the status of every page that is stored in swap.
-- Jerry Feldman
From a security standpoint the content of swap is a security risk. Swap space can be read and analyzed. Google for methods of reducing this exposure if you need that level of security. Stan
On Wed, 2005-08-17 at 00:42 +0530, Shriramana Sharma wrote:
Is it okay if I edit fstab in both SuSE and FC4 to load both these partitions as swap? (Currently IIRC SuSE uses only /dev/sda7 and FC4 uses only /dev/sda12.)
Yes, you can use > 1 swap partition for any Linux distro, here are my /etc/fstab entries for SuSE and FC4 on the same system. For further details refer man mount. /dev/hda7 swap swap pri=0 0 0 /dev/sda2 swap swap pri=0 0 0 HTH, -- Arun Khan (knura at yahoo dot com) Paul's Law: In America, it's not how much an item costs, it's how much you save.
participants (12)
-
Arun K. Khan
-
Carl William Spitzer IV
-
Darryl Gregorash
-
Doug McGarrett
-
Greg Wallace
-
James Knott
-
Jerry Feldman
-
Mike Grello
-
Patrick Shanahan
-
Robert Paulsen
-
Shriramana Sharma
-
Stan Glasoe