Would it cause any problems to use a shared swap partition?
Example:
sda1 = swap partition 50 meg
sda2 = / of OpenSuse installation 200 meg
sda3 = / of Fedora installation 200 meg
sda4 = / of Slackware installation 200 meg
How about:
sdb1 = / of Gentoo installation with swap pointed at sda1
sdb2 = / of Ubuntu installation with swap pointed at sda1
Obviously, only one system will be running at any particular time.
Is the swap file re-created each time a system is started?
Is it written to only when needed?
Is swap information “remembered” during shut down and accessed at startup?
The bootloader won’t let you do that anyway, it doesn’t give you a chance to choose the OS, it resumes whatever was suspended. However with sufficient ingenuity, I suppose this safety measure could be circumvented, but what would be the point?
Problems: Well, even having a small swap file is probably better than not having a swap file, but have you considered whether you might allocate a bit more than 50 meg?
If you have a whole load of ram and you don’t use suspend to disk, maybe you don’t actually need swap for day-to-day usage.
And 200 meg, what do you want to install in that?
You’ll be doing this because you have a cheap 0.65 G disk drive, of course
>
> Problems: Well, even having a small swap file is probably better than
> not having a swap file, but have you considered whether you might
> allocate a bit more than 50 meg?
With todays disk sizes, I rarely allocate less than 1G. For systems
with lots of memory, often 4G or more.
>
> The bootloader won’t let you do that anyway, it doesn’t give you a
> chance to choose the OS, it resumes whatever was suspended. However
> with sufficient ingenuity, I suppose this safety measure could be
> circumvented, but what would be the point?
Yes, it can be done. I did that to leave linux momentarily and boot to
windows, do whatever I needed, and return to my desktop.
This is relatively safe as the partitions involved are “closed” on
hibernation. Doing the same with linux systems is like playing with
nitroglycerin.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))
That’s probably because you were using a different bootloader. The standard GRUB setup detects that a Linux OS was hibernated and doesn’t go to the menu in that case.
>
> Would it cause any problems to use a shared swap partition?
> Example:
> sda1 = swap partition 50 meg
> sda2 = / of OpenSuse installation 200 meg
> sda3 = / of Fedora installation 200 meg
> sda4 = / of Slackware installation 200 meg
Two hundred megabytes for root? Is that correct?
Fifty megabytes of swap?
Sure, you can share it. But linux will laugh at those ridiculous amounts
of disk space. It may refuse to format that…
> Is the swap file re-created each time a system is started?
No, it is reused. Marked clean and used.
> Is it written to only when needed?
After it is marked, yes.
> Is swap information “remembered” during shut down and accessed at
> startup?
Remembered? The configuration is writen to disk, as for any other
partition, in /etc/fstab.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))
> That’s probably because you were using a different bootloader. The
> standard GRUB setup detects that a Linux OS was hibernated and doesn’t
> go to the menu in that case.
No, it is not grub. I mean, yes, I use the standard grub that suse
supplies, but it does no magic.
It is the script “/usr/lib/pm-utils/sleep.d/99Zgrub”, which does some
magic and then runs “grubonce” with the appropriate parameters, which
does what you say, deactivating the menu to boot one of the entries
directly . When it comes back, it
uses /var/run/suspend.grubonce.default to restore the original settings.
There is no automatic detection.
You only have to deactivate or remove that 99Zgrub in order to get back
the menu during hibernation.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))
Thanks all for the replies. I did make a mistake using megs as an example. Having been properly spanked, I won’t do that again! However, I got the answer I wanted. I understand that one swap partition may be shared by all Linux systems, one at a time.
>
> Thanks all for the replies. I did make a mistake using megs as an
> example. Having been properly spanked, I won’t do that again!
> However, I got the answer I wanted. I understand that one swap
> partition may be shared by all Linux systems, one at a time.
Exactly
By the way, as you have several disks, you can define one on each disk,
with the same priority, and the kernel will swap faster.
And, if you intend to hibernate, then (at least the one declared in
grub) must be as big as your ram or larger.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))
On 07/10/2010 08:27 AM, Carlos E. R. wrote:
>
> And, if you intend to hibernate, then (at least the one declared in
> grub) must be as big as your ram or larger.
Not quite true. The hibernation image is compressed and will likely be on
the order of 1/2 the size of ram; however, the recommendation of swap
equaling ram is a good one.
> On 07/10/2010 08:27 AM, Carlos E. R. wrote:
> >
> > And, if you intend to hibernate, then (at least the one declared in
> > grub) must be as big as your ram or larger.
>
> Not quite true. The hibernation image is compressed and will likely
> be on the order of 1/2 the size of ram; however, the recommendation
> of swap equaling ram is a good one.
can be compressed. Not everybody does.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))