LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-01-2009, 10:20 AM   #1
Fenchurch
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
Could another distro mess an hibernated linux?


Hello, I have a simple linux question. I think I could test it on a virtual machine if I weren't too lazy to procrastinate, but I'll ask it here.

Ok, so you have two different distributions installed on the same disk sharing a swap partition. You start one and hibernate it. Then you would have important information stored on the swap, right?

If you start the other distribution, it could cause some problems on the swap partition, making it harder for the fist one to restart. Or would it work fine? Is it safe to do that?

And how dangerous would be to mount an hibernated windows partition on linux?
 
Old 11-01-2009, 11:08 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
I am not certain of this, but I am fairly sure that the swap partition won't be mountable by the second distribution as the resource will already be considered in use by the first, I suspect you'd also see the same with the hibernated windows partition, as the device is already in use by something else the distribution would be unable to mount it. However if it is possible it could cause multiple issues... as you could effectively change some of the enviromental settings or overwrite some enviromental settings that could really cause anything to happen.
 
Old 11-01-2009, 11:23 AM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
I will leave it to someone else to address the Windows angle, as required, but for the Linux situation:

Two distros sharing a swap space, is no problem, provided it is ONLY a swap space, and not THE swap space that will be used for hibernation.
To ensure there are no problems with multiple distros messing with each others HIBERNATION SWAP space, make sure that:

1) swap-only swap space(s) should be marked "auto" in the fstab file.
2) hibernation swap spaces should be marked "noauto" in fstab.
3) If multiple distros will be wanting to hibernate to a swap space, be sure to define each respective distro's hibernation swap space in the LILO or GRUB configuration, using the "resume=/dev/XXX" appendage to the respective kernel boot line for that distros kernel, where XXX is the swap partition you want to be used.

Each distro, AFAIK, has no idea that a given swap space is occupied by a hibernated distro, so mounting it with another distro is asking for trouble, because if it gets used as a regular swap space by any means, it will probably screw up the hibernated image, making it not only harder but probably impossible to resume successfully. NOTE: Maybe one can mount a swap space RO (read-only) but I'm not sure? I don't know why you might want to do this, but check the man page for 'mount' or 'fstab' to see if you could mount a swap space read-only.

A Windows related guess: I think Win uses a swap "file" rather than a partition. Besides this (if correct) much of the same above Linux stuff, probably applies to Windows too. But, if let's say two Win OS's are on one machine, and you suspend one of them, if it suspends to a FILE, there's probably nothing to worry about when booting and suspending the other OS's, and subsequently suspending THAT one, as it would suspend to its OWN file, on its OWN partition. Again, this is just speculation-- I don't use Windows.

Hope this helps!

Sasha
 
Old 11-01-2009, 11:27 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
I have always assumed that the running OS assumes to have a swap for itself. So after a hibernate, another OS can do whatever it wants with the swap (if it's shared).

Windows does not have a swap partition (at least not the last time I looked which is before XP) but a swap file. So I don't think it's dangerous to mount. And to read. Writing to a file that was open might be another issue.

Please post your experiences. Your question so you can take the risk

Last edited by Wim Sturkenboom; 11-01-2009 at 11:28 AM.
 
Old 11-01-2009, 12:06 PM   #5
Fenchurch
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl View Post
Two distros sharing a swap space, is no problem, provided it is ONLY a swap space, and not THE swap space that will be used for hibernation.
So the only way to be safe would be to have a swap partition for each distribution?
I have Linux Mint and was planning to add a slackware, but it looks like I'll need to repartition again.
I also have two ntfs partitions, one has windows vista installed and the other one is just data. If I leave windows hibernated and try to mount the data on linux it brings me an alert, I could force mount but don't want to risk.
BTW thanx for the help
 
Old 11-01-2009, 12:16 PM   #6
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,252

Rep: Reputation: 205Reputation: 205Reputation: 205
On short: you could hibernate as many distributions as you like and run in the meantime other distributions assuming that each your distribution uses the separate swap partition. If your machine has 1 GB of RAM or more use swap partitions of the same size as your memory.
 
Old 11-01-2009, 01:02 PM   #7
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by Fenchurch View Post
So the only way to be safe would be to have a swap partition for each distribution?
You can use the same swap space for any number of distros, as log as it's only a SWAP space, for swapping ONLY. On top of that swap-only space (I mean, in addition to it) you would want to have a "noauto" swap space for hibernation of that distro.
So: If you have 3 Linuxes, and you will want to hibernate all 3 of them safely, but share a swap space for swapping, you would want a total of 4 swap spaces; one for swapping, and one EACH to hibernate each Linux.
Quote:
...

I also have two ntfs partitions, one has windows vista installed and the other one is just data. If I leave windows hibernated and try to mount the data on linux it brings me an alert, I could force mount but don't want to risk.
BTW thanx for the help
As for the bold section above, you'd have to give exact text of the warning or message(s) for me or someone else to make a determination of what the alert means, and what implications might be there if you were to force a mount. Maybe Linux is just clever enough to be warning you that what you're trying to mount, IS a hibernated image, and advising against it. However, even in this case, you *should* be able to mount it read-only, and be safe.
Then again, *why* would you want to mount a Windows hibernation image, from Linux?

Also, as noted above by me and other(s) members, Windows should be suspending to a file, not a partition, so is it a file or a partition that you are trying to read or mount? I just want to be sure we're talking about the same thing here.


Sasha

Last edited by GrapefruiTgirl; 11-01-2009 at 01:04 PM.
 
  


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
Fat32 partition changes not reflecting when Windows is hibernated. dtheorem Linux - General 1 02-15-2009 04:07 PM
installing a second Distro will this mess up Grub Shadowmeph Linux - Newbie 12 09-16-2008 01:36 PM
I've installed Linux, but what a mess... Umanga Linux - Newbie 3 08-06-2004 01:29 AM
Linux & Windows 98SE dual boot... will defrag mess up linux partition? herrtool Linux - General 5 10-31-2003 03:43 PM
Linux Mess kajensen Linux - Newbie 2 08-27-2003 08:29 PM


All times are GMT -5. The time now is 08:42 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