Jump to content

Hibernate disables grub...


hanes
 Share

Recommended Posts

When my laptop hibernates it disables grub, so next time i cant decide if i want to go windows or linux, it goes straight into linux... anyway to fix this? I like hibernating because it makes boot up real quick, but i ALWAYS want to see grub...

 

 

There must be some config file for this... anyone know it?

Link to comment
Share on other sites

I think you are thinking of suspend to ram, I mean hibernate as in suspend to DISK. So the os takes an image and stores it on its own partition, then when the os loads next time, it takes that image and loads it. You can have two OS's each hibernating at the same time, as long as each OS stores there image seperately.

 

Windows works like this on the laptop in question, if I hibernate from windows, next time I can choose to load linux, but the next time I chose windows, it loads the image.

 

I think what is happening is that the mandriva hibernate script is sending a command to grub to autoselect (I see grub load, it just doesnt let me choose). I guess no one knows of a fix?

Link to comment
Share on other sites

  • 1 month later...

with hibernate or Suspend to disk, the OS writes an image of its actual memory to the swap partition (in the case of linux, so if you want suspend to disk to work you need a swap partition at least 30 % bigger than your physical memory) or to a file called hiberfil.sys, which is located in the system partition (in the case of win).

 

theoretically it would be possible to hibernate more than one linux at a time, you would need more than one swap partition, but I would NOT do this, the problem is, if the running os would overwrite the image than you're lost, say you accidentally delete the hiberfil.sys of your hibernated windows, then good bye hibernated os.

Link to comment
Share on other sites

I won't do this, because as scarecrow already said, hibernation is NOT meant to be used in such a way, and yes what you mentioned is exactly the problem, in windows you would just need to delete the hiberfil.sys, and ciao hibernated windows !!!

Link to comment
Share on other sites

  • 11 months later...
Guest arvindkb

Does location of grub on disk (i mean MBR or linux patition) has got anything to do with Hibernate disabling grub ?

 

Because when hiberantion is performed using WindowsXP (Dual boot with Mandriva and Grub on MBR) Grub appears and allows booting of Mandriva.

 

May be my question is silly, I am new to Mandriva and I like it.

Link to comment
Share on other sites

OK, I think you got enough warning. Beware, this is REAL warning, REAL danger! And although you have the opposite feeling, Windows actually behaves the same with its own bootloader, but you can't see it because you use Grub and Grub is absolutely unknown to Windows.

 

Now on topic. Back in the days of swsusp, there was a config that enabled/disabled auto-select in lilo/grub. So there must be something equivalent in current implementation of hibernate. If not, you still have the option to use swsusp, I think. Just be sure not to mount an hibernated Windows' or hibernated Linux' partition from a running Linux. I don't think there is the same risk with Windows as it rarely is able to read Linux partitions anyway.

 

Yves.

Link to comment
Share on other sites

I used to do this, and contrary to common opinion, this can work fine.

I dual booted multiple linux installations, hibernating one and then going to another, etc.

Just make sure you never ever write to a partition that was mounted on the hibernated system. Not actually mounting any of them helps, but if you must read data, mount them read-only.

Otherwise, no problem as far as I can see.

 

Make sure you have two hibernate swap partitions if you want to do this with two Linux installs. Hibernating Linux then booting to Windows should not have any similar conflict.

 

The current grub has an option to immediately boot if in hibernation / suspend to disk.

 

There is an option, forgot which file - can check if you want - to switch back to the default behaviour.

If you have 2 different Linux installations, you can set up the regular grub in the mbr to boot:

linux 1

windows

chainloader to linux 2 partition boot sector

 

and in the second linux installation boot sector, you can again have all kinds of entries.

Now if you hibernate the second Linux, the grub in the boot sector of that root partition gets updated to autoresume, but the grub from the other Linux in the mbr doesn't, so from that one you can still boot windows.

 

To be able to do it with only windows and one linux install, you need to find the config file. I'll post it if I find it...

 

 

Edit:

got it - I couldn't find it on the web, so I figured it should be something the code for the suspend stuff must include - so I opened mcc and went into the software installer, and checked which files get installed with pm-utils

one of those is

/usr/lib64/pm-utils/sleep.d/01bootloader

where on a i586 system lib64 is likely just lib

it refers to a file /usr/sbin/rebootin which is a perl script for a single one time system boot bypassing the menu.

never mind that /usr/lib64/pm-utils/sleep.d/01bootloader gives error messages for Lilo, this is for grub too.

 

all you have to do is remove 01bootloader from /usr/lib64/pm-utils/sleep.d/

and you should be set.

 

Again: do not mount any partitions from a hibernated system in rw mode! They have not been cleanly unmounted, and the hibernated system will expect them not to have changed - Linux partitions keep track of mount-count and such!

Edited by aRTee
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...