Stupid Grub2 Trick

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
kwatson512
Level 4
Level 4
Posts: 203
Joined: Sun Apr 20, 2008 7:16 pm

Stupid Grub2 Trick

Post by kwatson512 » Wed Jul 28, 2010 9:09 pm

I did a stupid thing. I dual boot Linux Mint 9 and Windows XP. Using Startup Manager, I set GRUB_DEFAULT="Microsoft WIndows XP Professional" and GRUB_TIMEOUT=0, and now can't boot into Mint. GRUB_TIMEOUT isn't the same as GRUB_HIDDEN_TIMEOUT, and I only discovered that hitting any key, ESC, or holding SHIFT during boot don't work. I used a Live CD and edited /etc/default/boot so that GRUB_TIMEOUT=5, but don't know how to run update-grub from the live CD.

Any pointers?
Mint 16 64-bit Cinnamon, Lenovo ThinkPad T430s, 8GB RAM

vincent
Level 8
Level 8
Posts: 2217
Joined: Tue Feb 09, 2010 4:10 am

Re: Stupid Grub2 Trick

Post by vincent » Wed Jul 28, 2010 9:12 pm

https://wiki.ubuntu.com/Grub2#Recover%2 ... a%20LiveCD

You'll need a Live CD...basically, what you have to do is to mount the partitions that has Mint installed, chroot into them, then edit /etc/default/grub and run update-grub. Even though the wiki article linked above was designed for re-installing Grub, you can safely follow it, but omit the "grub-install /dev/sda" step.
Debian Testing x64/LM9 Main x64/Windows 7 x64 - LG R580 laptop w/ Intel Core 2 Duo T6500 2.1 GHz, 4 GB DDR2 RAM, Nvidia Geforce G 105M, Ralink rt2860 802.11n, 300 GB WD HD 5400 rpm

kwatson512
Level 4
Level 4
Posts: 203
Joined: Sun Apr 20, 2008 7:16 pm

Re: Stupid Grub2 Trick

Post by kwatson512 » Thu Jul 29, 2010 7:58 am

@vincent,

Thanks! That worked perfectly. Is there a way to hide my Linux OS during boot, but have a keyboard shortcut to call it when I want?
Mint 16 64-bit Cinnamon, Lenovo ThinkPad T430s, 8GB RAM

vincent
Level 8
Level 8
Posts: 2217
Joined: Tue Feb 09, 2010 4:10 am

Re: Stupid Grub2 Trick

Post by vincent » Thu Jul 29, 2010 9:12 pm

Open up a terminal, and type:

Code: Select all

gksudo gedit /etc/default/grub
You're going to change the GRUB_HIDDEN_TIMEOUT by uncommenting it, and running "sudo update-grub" later on, but before you proceed, have a look at these two links first:
https://help.ubuntu.com/community/Grub2 ... b%20(file) (scroll down to "GRUB_HIDDEN_TIMEOUT=0") and http://ubuntuforums.org/showthread.php?t=1287602 (scroll down to "7. HIDING THE MENU ON MULTI-OS SYSTEMS").
Debian Testing x64/LM9 Main x64/Windows 7 x64 - LG R580 laptop w/ Intel Core 2 Duo T6500 2.1 GHz, 4 GB DDR2 RAM, Nvidia Geforce G 105M, Ralink rt2860 802.11n, 300 GB WD HD 5400 rpm

kwatson512
Level 4
Level 4
Posts: 203
Joined: Sun Apr 20, 2008 7:16 pm

Re: Stupid Grub2 Trick

Post by kwatson512 » Fri Jul 30, 2010 2:57 pm

@vincent,

Thanks again. If I had dug a little more deeply in the forums I should have been able to find that. So I did all that and ran update-grub, but when I tried to boot holding down the shift key I just got "Stuck Key, Press <F2> for Setup". I tried other keys, including ESC during boot, but never got the grub menu. So I used the Live CD and changed it all back. At least now I can dual boot.

Anything else I might try?
Mint 16 64-bit Cinnamon, Lenovo ThinkPad T430s, 8GB RAM

vincent
Level 8
Level 8
Posts: 2217
Joined: Tue Feb 09, 2010 4:10 am

Re: Stupid Grub2 Trick

Post by vincent » Fri Jul 30, 2010 8:39 pm

Did you even try the script offered in that Ubuntu Forums thread? Hmmm...if that doesn't work, then I'm rather stumped.
Debian Testing x64/LM9 Main x64/Windows 7 x64 - LG R580 laptop w/ Intel Core 2 Duo T6500 2.1 GHz, 4 GB DDR2 RAM, Nvidia Geforce G 105M, Ralink rt2860 802.11n, 300 GB WD HD 5400 rpm

kwatson512
Level 4
Level 4
Posts: 203
Joined: Sun Apr 20, 2008 7:16 pm

Re: Stupid Grub2 Trick

Post by kwatson512 » Fri Jul 30, 2010 10:02 pm

Yes, I followed the scripts precisely. I should have specified that.

I've been experimenting again, but no luck. I commented out the adjust_timeout section of /etc/grub.d/30_os-prober, and un-commented the GRUB_HIDDEN_TIMEOUT=0 line in /etc/default/grub (and, of course, then ran sudo update-grub). Holding <Shift> during boot only produces a "Stuck Key" error message. Escaping out of that returns to booting Windows (no grub menu).

Using LiveCD to go back and change GRUB_HIDDEN_TIMEOUT=5 in /etc/default/grub (and mounting the linux partitions and chrooting in to run update-grub) results in the grub menu displaying with each boot (regardless of whether the adjust_timeout section of /etc/grub.d/30_os-prober is commented out or not).

Must be a Thinkpad boot sequence issue. I'm running a Lenovo X200, and it must probe for stuck keys before accessing the boot sector. I'm stumped too. Now I have to go back and use the Live CD to set things back up to default.

Thanks anyway.
Mint 16 64-bit Cinnamon, Lenovo ThinkPad T430s, 8GB RAM

User avatar
dawgdoc
Level 9
Level 9
Posts: 2719
Joined: Mon Oct 05, 2009 12:53 am
Location: Formerly of Kentucky, the land of Mint Juleps

Re: Stupid Grub2 Trick

Post by dawgdoc » Fri Jul 30, 2010 10:32 pm

kwatson512 wrote:Must be a Thinkpad boot sequence issue. I'm running a Lenovo X200, and it must probe for stuck keys before accessing the boot sector. I'm stumped too. Now I have to go back and use the Live CD to set things back up to default.
This part brings something to mind which I have seen in seen in some BIOSs. Look and see if there is an option to stop the boot sequence on keyboard error. Possibly if you can disable this you will be able to boot while holding the shift key.
Image

SYSTEM: Compaq Presario CQ62 -- Mint 17 Cinnamon
READING: Little Brother by Cory Doctorow

kwatson512
Level 4
Level 4
Posts: 203
Joined: Sun Apr 20, 2008 7:16 pm

Re: Stupid Grub2 Trick

Post by kwatson512 » Sat Jul 31, 2010 7:10 am

I went through the entire BIOS menu and there was no option like that. Thanks for suggesting. I'm fine with showing the menu.
Mint 16 64-bit Cinnamon, Lenovo ThinkPad T430s, 8GB RAM

Post Reply

Return to “Installation & Boot”