Posts: 87
Threads: 18
Joined: Jun 2016
Reputation:
0
08-27-2016, 04:18 PM
(This post was last modified: 08-29-2016, 08:12 AM by thoughtinstinct.)
Hi again,
I come with one more request for help. I edited the grub and now the pc won't show the grub loader where i could chose the OS. Here are the lines i remember editing ....
Code: GRUB_HIDDEN_TIMEOUT=0.0
GRUB_TIMEOUT=0.0
I have a dual boot of windows 10 and LL3 and would like to hide the grub loader until i activate it myself (otherwise boot straight to windows) since im not the only one using this pc. Holding down shift key doesn't seem to help, what am i doing wrong? http://askubuntu.com/questions/117525/hi...his-happen
Posts: 1,599
Threads: 86
Joined: Jun 2015
Reputation:
0
It seems to me that changing the GRUB timeout values to zero would prevent GRUB from showing up.
Want to thank me? Click my [Thank] link.
Posts: 1,511
Threads: 140
Joined: Mar 2016
Reputation:
0
This particular setup (hack) does not work on all machines, and I'm not sure it works at all in xenial, given it was reported as bug when it was only an old unix hack in the first place. Try editing the timeout values from 0.0 to simply = 0. This sometimes re-allows the hidden default of 10 seconds to reset on some systems. Bluetooth, and usb keyboards can all have problems with this setup, depending on the BIOS post sequence. Finally depending on your BIOS you may have to hit the shift key at a precise time in some cases and you may have to hit escape or F1 during boot to get the chance to do it if you are under quick boot. It's a dated wasted hack in the first place, and not reliable except with a ps2 keyboard, and legacy only board, running posted boot. Better ways to accomplish what you are trying to do. If you make Windows the first entry in grub the computer will boot into Windows first doing nothing, and almost immediately just by hitting >enter as soon as grub appears without having to scroll and select it from the grub menu, so why hide the grub menu and mess with the timeouts? I can't see any sensible purpose for this, as it was only invented in Ubuntu kludge to solve some old BIOS issues with grub that don't exist anymore.
TC
All opinions expressed and all advice given by Trinidad Cruz on this forum are his responsibility alone and do not necessarily reflect the views or methods of the developers of Linux Lite. He is a citizen of the United States where it is acceptable to occasionally be uninformed and inept as long as you pay your taxes.
Posts: 1,094
Threads: 19
Joined: Feb 2014
Reputation:
0
08-27-2016, 08:11 PM
(This post was last modified: 08-27-2016, 08:22 PM by gold_finger.)
Tested out solution suggested by 5th poster down on that askubuntu link you referenced and that seemed to do the trick. Going to post steps for you below to duplicate what I did, but note that I did this on a Mint system (not LL), so line for GRUB_DISTRIBUTOR= in my /etc/default/grub file will probably look different than yours. Don't touch that line in yours -- only make changes to yours where I've highlighted in RED.
IMPORTANT NOTE: For initial testing purposes, change the GRUB_DEFAULT= line on yours to have LL be the default boot instead of Windows. Reason for that is because you are going to want to test out whether pressing left <SHIFT> key during startup actually does work to bring up the hidden grub menu. If it doesn't, then you'll be stuck only being able to boot into Windows and will make correcting situation more difficult. (You'll end up having to use a live LL dvd/usb to fix the problem.) Once you confirm that left <SHIFT> does work, then you can change value back to boot Windows as default.
Here we go.
Open a terminal and use this command to make a backup copy of the current /etc/default/grub file.
Code: sudo cp /etc/default/grub /etc/default/grub.bak
Use next command to make a new file that will be used by grub telling it to hide the menu.
Code: sudo tee /etc/grub.d/50_hidemenu
Make that file executable.
Code: sudo chmod +x /etc/grub.d/50_hidemenu
Now use this command to open the file with your text editor -- you'll need to enter your password again and the file will be blank.
gksu leafpad /etc/grub.d/50_hidemenu
Now copy/paste all of the following into the file, then hit "Save".
Code: #!/bin/sh
cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=0
fi
fi
fi
EOF
Now you'll want to make some changes to the /etc/default/grub file. Remember, change the GRUB_DEFAULT= line to make LL the default boot for now. (You can change it back to Windows default after testing that you can show grub menu on startup with the left <SHIFT> key.) Other than that, just change the lines I have highlighted in RED.
Open the file in text editor with this command, then edit lines in red.
Code: gksu leafpad /etc/default/grub
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=hidden
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
NOTE: if there is a "#" at beginning of GRUB_HIDDEN_TIMEOUT line, delete the "#" so line appears as above.
Save the changes to the file and close the text editor.
Back in terminal run this command to update grub with the changes.
Reboot computer and see if grub menu is now hidden and computer just boots straight into LL.
Reboot again to test if hitting the left <SHIFT> key immediately after Bios screen displays brings up the grub menu. Timing can be a little tricky on this, so if you don't get it to work on first try do it another time or two. It took me two times to get it. What I did was push and hold down the left <SHIFT> key instead of just tapping on it.
If menu is still not being hidden on startup, run following command in terminal and copy/paste output back here for us to look at.
Code: cat /etc/default/grub
If all is working well, change default grub boot back to Windows. Open grub file with text editor again with this terminal command.
Code: gksu leafpad /etc/default/grub
Change the GRUB_DEFAULT= line to whatever the default value is for Windows, then save file and close editor.
Update grub again to set the change.
Now computer should boot into Windows unless you hit the left <SHIFT> key to bring up grub menu.
Posts: 1,511
Threads: 140
Joined: Mar 2016
Reputation:
0
Just a question Goldfinger. Won't this break something if another Linux system is installed from an ISO afterwards, say for instance he wanted to add Mint to the disk? I would guess that some installers would have to run default settings just to install in some cases. Not sure. Just a thought.
TC
All opinions expressed and all advice given by Trinidad Cruz on this forum are his responsibility alone and do not necessarily reflect the views or methods of the developers of Linux Lite. He is a citizen of the United States where it is acceptable to occasionally be uninformed and inept as long as you pay your taxes.
Posts: 1,094
Threads: 19
Joined: Feb 2014
Reputation:
0
(08-27-2016, 10:25 PM)trinidad link Wrote: Just a question Goldfinger. Won't this break something if another Linux system is installed from an ISO afterwards, say for instance he wanted to add Mint to the disk? I would guess that some installers would have to run default settings just to install in some cases. Not sure. Just a thought.
TC
No, the changes made in my post above will not affect ability to boot other added distros as long as LL remains in charge of booting. However, if another distro's grub got installed to the MBR (replacing LL's) then same problem would occur in that distro's grub and the modifications above would have to be duplicated there.
In addition, certain custom modifications to LL's grub (by the development team) will cause an error message when another distro's grub tries to boot LL.
Therefore, in all multi-boot setups involving LL, leaving LL in charge of booting is the best way to go -- regardless of the particular situation in this thread. Basically, a person should just direct any other distro's grub installation to its own root partition instead of the MBR of the hard drive. Then just run sudo update-grub from a terminal in LL to add the new distro(s) to the boot menu.
Posts: 87
Threads: 18
Joined: Jun 2016
Reputation:
0
Thanks all for taking the time to help me out, greatly appreciated. And sorry for late reply, family got in the way.
(08-27-2016, 06:12 PM)trinidad link Wrote: I can't see any sensible purpose for this, as it was only invented in Ubuntu kludge to solve some old BIOS issues with grub that don't exist anymore.
TC
I was hoping to completely avoid someone booting into LL and blaming me later for messing up the pc but now i will leave it as its once i get it running again.
(08-27-2016, 08:11 PM)gold_finger link Wrote: If it doesn't, then you'll be stuck only being able to boot into Windows and will make correcting situation more difficult. (You'll end up having to use a live LL dvd/usb to fix the problem.)
I forgot to mention that i made windows the Grub_Default, so please tell me how i can use a live usb to fix my mess. Maybe worth mentioning also that i have a single hard disk, with only windows and LL. I tried installing LL again but i couldn't figure out how to replace the existing LL installation instead of alongside it, so if that is an easier solution i will also appreciate your help on that.
Thanks very much once again.
Posts: 1,511
Threads: 140
Joined: Mar 2016
Reputation:
0
"No, the changes made in my post above will not affect ability to boot other added distros as long as LL remains in charge of booting. However, if another distro's grub got installed to the MBR (replacing LL's) then same problem would occur in that distro's grub and the modifications above would have to be duplicated there."
"In addition, certain custom modifications to LL's grub (by the development team) will cause an error message when another distro's grub tries to boot LL."
"Therefore, in all multi-boot setups involving LL, leaving LL in charge of booting is the best way to go -- regardless of the particular situation in this thread. Basically, a person should just direct any other distro's grub installation to its own root partition instead of the MBR of the hard drive."
Thank you for that clarification. Most new users (windows converts, especially dual booters) need to know these things. Modifications are wonderful, and your solution works here, but not without possible complications down the road. It is worth noting that it's possible that shift key binding in this way could effect the use of Windows rescue media depending on the boot device ordering. Probably best to keep cd/dvd as the first boot device if possible. Shift is often linked to function keys on laptops, so again for pre-boot situations like widows rescue media, or live CD's the effect could be critical, if grub is in control when Windows opts to default to the media channel for rescue media. Some boxes with faulty OEM firmware actually run Windows on the media channel by default, locking device boot order to HDD first, and in such cases especially with laptop keyboards rescue media might not work at all if grub is in control with shift key binding when Windows boot fails, probably simply bringing up the grub menu again. Some laptops do not offer a pause key for boot device selection, some not even the option to order boot devices. Finally if the shift key is bound in grub, I wonder if edit character functions in the grub menu screen itself would work properly, or would it keep reproducing a new grub menu screen every time you shifted for character selection?
TC
All opinions expressed and all advice given by Trinidad Cruz on this forum are his responsibility alone and do not necessarily reflect the views or methods of the developers of Linux Lite. He is a citizen of the United States where it is acceptable to occasionally be uninformed and inept as long as you pay your taxes.
Posts: 1,094
Threads: 19
Joined: Feb 2014
Reputation:
0
(08-28-2016, 08:47 AM)thoughtinstinct link Wrote: I forgot to mention that i made windows the Grub_Default, so please tell me how i can use a live usb to fix my mess. That's what I had assumed you did, which is why I suggested you temporarily change the default back to LL. To change it back to LL default, when you edit the grub file again with gksu leafpad /etc/default/grub command in my prior post, make sure the GRUB_DEFAULT= line equals 0. It probably equals "4", or "Windows" right now.
I was just pointing out that it was possible to fix from live dvd/usb if you accidentally got stuck only being able to boot into Windows (if you forgot to change the default back to LL). It's actually not that hard, but would need some further info from you to provide accurate step-by-step instructions. If you really want those instructions before you proceed with steps above, boot into LL, open a terminal and enter these two commands:
Code: lsblk
sudo parted -l
Copy/Paste the full output of those back here and I'll be able to give instructions from that info.
(08-28-2016, 08:47 AM)thoughtinstinct link Wrote: Maybe worth mentioning also that i have a single hard disk, with only windows and LL. I tried installing LL again but i couldn't figure out how to replace the existing LL installation instead of alongside it, so if that is an easier solution i will also appreciate your help on that.
Thanks very much once again.
I've been operating on the assumption that as of right now your computer boots, shows the grub menu with Windows as the first option and LL second, and that you can boot into both of them without any problem. You've been trying unsuccessfully to hide the grub menu so computer boots straight to Windows for others in household and they don't get confused by seeing a "weird" grub menu. So, as I understand it, your only problem has been the lack of success in trying to hide the menu. Is that indeed where things stand? Or, is there some other problem?
You should not need to reinstall LL unless there is some other issue going on that I don't know about. If you follow instructions in my prior post that will solve the hiding of the grub menu problem and you'll be all set.
(08-27-2016, 05:03 PM)torreydale link Wrote: It seems to me that changing the GRUB timeout values to zero would prevent GRUB from showing up. Forgot to answer your question torrydale. Yes, you would think that would work, but apparently it doesn't because something in the 30_os-prober script (under /etc/grub.d) resets it back to showing the menu for 10 seconds. The solution I copied from one of the posters in OP's link basically runs a new custom script ( 50_hidemenu), which gets invoked after 30_os-prober, to set it back to hiding the menu.
The other solution is to edit the 30_os-prober script and change the offending code. Problem with that solution is that the change will disappear and problem reappear whenever there is an update to grub. So adding the custom script is the better solution in my mind.
Posts: 1,094
Threads: 19
Joined: Feb 2014
Reputation:
0
(08-28-2016, 02:13 PM)trinidad link Wrote: Thank you for that clarification. Most new users (windows converts, especially dual booters) need to know these things. Modifications are wonderful, and your solution works here, but not without possible complications down the road. It is worth noting that it's possible that shift key binding in this way could effect the use of Windows rescue media depending on the boot device ordering. Probably best to keep cd/dvd as the first boot device if possible. Shift is often linked to function keys on laptops, so again for pre-boot situations like widows rescue media, or live CD's the effect could be critical, if grub is in control when Windows opts to default to the media channel for rescue media. Some boxes with faulty OEM firmware actually run Windows on the media channel by default, locking device boot order to HDD first, and in such cases especially with laptop keyboards rescue media might not work at all if grub is in control with shift key binding when Windows boot fails, probably simply bringing up the grub menu again. Some laptops do not offer a pause key for boot device selection, some not even the option to order boot devices. Finally if the shift key is bound in grub, I wonder if edit character functions in the grub menu screen itself would work properly, or would it keep reproducing a new grub menu screen every time you shifted for character selection?
TC
Understand your concern, however none of that should be a problem. When computer first boots, Bios firmware is in control and when ready looks to first sector of hard drive (where 1st stage of grub boot loader is) for boot code to finish boot process into an operating system. Grub doesn't change anything in Bios and any key invocations set there will remain in effect.
Grub also has nothing to do with boot order set in Bios, so boot order can be set (or changed) to anything one wants and grub won't interfere or affect that in any way.
(08-28-2016, 02:13 PM)trinidad link Wrote: Finally if the shift key is bound in grub, I wonder if edit character functions in the grub menu screen itself would work properly, or would it keep reproducing a new grub menu screen every time you shifted for character selection?
TC No, that shouldn't happen. It's only looking for a <SHIFT> press during those initial first few seconds after Bios check has completed and grub boot process is initiated. Once past that point the various grub scripts have already run and are done with -- they won't come into play anymore.
|