Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Generic User Avatar
- - - - -

How to Set Up Grub in a Dual Boot System


  • Please log in to reply
15 replies to this topic

#1 Naught McNoone

Naught McNoone

  •  Avatar image
  • Members
  • 804 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Great White North
  • Local time:12:02 AM

Posted 19 February 2021 - 05:36 PM

How to Set Up Grub in a Dual Boot System


Guide Overview

The purpose of this guide is to teach you how to set up Grub in a dual boot system.

When running Windows Updates in a dual system, sometimes you need to have an unattended restart of Windows.

If Linux is the default system in Grub, then you have to wait, and select Windows manually.

This modification will instruct Grub to always boot to the last OS used, thereby allowing unattended updates of Windows.

Tools Needed

  •     A working Grub Boot Loader
  •     A Dual Boot System
  •     A Terminal Text Editor


Instructions

Step 1 - Modify the /etc/default/grub file

Open a terminal, by either selecting one from your menu, or pressing the ctl+alt+t at the same time.

The default terminal text editor in Unbuntu is Nano. 

 

Type the following command and press enter:


sudo cp /etc/default/grub /etc/default/grub.bak


Enter your password.  No characters will appear on the screen as you type your password.
You have just made a backup copy of your grub file.

Now enter the following command:

 

sudo nano /etc/default/grub

 

Your grub file will be opened in the Nano text editor.

We are interested in this section of the file:

 

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

 

We are going to change on line, and add one line.

Change the line "GRUB_DEFAULT=0" to "GRUB_DEFAULT=saved".

Press enter to place a carriage return and start a new line.

Add the following line:

 

GRUB_SAVEDEFAULT=true

 

Your grub file should now look like this:
 

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

 

 

Press ctl+x to exit Nano and save the changes by entering Y.  (Either upper or lower case will work.)

Now enter this command:

 

sudo update-grub

 

Now, grub will automatically select the last OS boot you used.

If you select Windows from the menu, then Windows becomes default.

The next time you select Linux, it will be set back to default.

You can test by rebooting you computer, and selecting a different OS.

Step 2 - There is no Step 2.  :busy:


Cheers!

Naught

 



BC AdBot (Login to Remove)

 


#2 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 11:38 AM

@Naught McNoone

So where (which) thread would I find help for an installed grub system that choked on Windows 10, but still smoothly runs 2(two) Linux Ubuntu boot systems? That has been my problem since an Microsoft Update before Thanksgiving

:smash:

 

I signed up @Help Ubuntu, but the topic of Dual Boot Linux/Windows systems, was closed. Which I thought was kinda odd.

I then asked for help in their General Thread, but it seems that they are not to enthusiastic about my particular problems ... I got the feeling I was being shunned after posting my situation.

 

This forum has being quite friendly and last greeted me with open arms. I feel like family :thumbup2:


Edited by CAHJR74dot1, 21 January 2022 - 12:13 PM.


#3 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 33,826 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:05:02 AM

Posted 21 January 2022 - 04:11 PM

You should run "sudo update-grub" from the Linux distro that controls your grub. That should fix it.

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#4 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 08:41 PM

@cryptodan hope your up for a challenge ....

 

Thanks for the help, much appreciated ....

 

There must be something that is "hidden" in my HDD's or my memory or something more nefarious ...

Or there must be something that I dont quite understand possibly because I thought I knew alot tech ...

 

I successfully implemented  sudo update-grub, and then rebooted then I was greeted with this on my screen

 

error:no such device: e737fcbc-c80b-d301-a024-f8bcc80bd301.

Entering rescue mode...

grub rescue> (flashing curser here) black screen behind 



#5 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 33,826 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:05:02 AM

Posted 21 January 2022 - 08:48 PM

You used that command in the linux that doesn't control grub.

This is an issue seen often with multi booted Linux users.

https://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd - boot into the Linux with the correct grub and follow that

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#6 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 09:10 PM

So I can still blame Microsoft ? LOL

Was wanting some sort of excuse to channel my frustration ...  :smash:

 

The other issue which I needed to mention was the fact that I access my Windows 10 partition, I view it, scroll thru the files, it seems to be intact, while browsing the partition with linux file manager.

 

But it seems that when I typed update-grub it "ignored" Windows 10. because I did not see the output register anything pertaining to Windows at all, but I did not that it found my Ubuntu partitions. I was able to boot too one of my Ubuntu partitions and it seemed normal until I attempted to boot to the "other" ubuntu partition. I have 2 installed just to be clear.

 

Again I must also stress that the grub menu was still missing a Windows 10 line which disappeared after that pre-Thanksgiving day windows update.

 

Before that stupid update of Microsoft's ALL my boot partitions Windows AND Linuxes performed without issues ...

That is what really perturbs me about those idiotic upgrades .... I didn't need them to begin with, and I didn't ask for them ...

 

Sorry for venting on you crytptodan my bad ...



#7 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 09:29 PM

ok I mounted my linux partition that is located on the same HDD that the Windows partition resides.

 

Now the next step is more complicated the "bind".

 

I dont want to pretend that I would know the exact code for my partition, EFUI, hard drives, I have three in this machine and it is a Dell Alienware Aurora R-4 just if there are considerations to take into account .. I also uploaded the last and latest firmware to this machine, so it sound like that issue is out of the picture ... let me know if I am missing any details please ....



#8 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 09:45 PM

OK my screen now looks like this after I installed the first command line

ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev &&

> sudo mount --bind /dev/pts /mnt/dev/pts &&

typed in the last two lines of the "bind" commands 

everything is good so far ....

 

uhgggg ...  :crazy:

mount /mnt/dev:mount point does not exist.



#9 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 33,826 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:05:02 AM

Posted 21 January 2022 - 09:47 PM

Separate the /dev and /mnt/dev

Take a screenshot and upload picture

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#10 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 10:03 PM

Ubuntu Screenshot Upload .....

 

 

Whats the address for the file host? The "image" command just seems that its not wanting to post my screenshot for whatever reason ...

Maybe my ATT UVerse ADSL is firewalling this?



#11 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 10:14 PM

Ubuntu Screenshot Upload ... had to use my Imgur.com file host ...

 

https://i.imgur.com/Ph4Y5vd.png



#12 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 33,826 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:05:02 AM

Posted 21 January 2022 - 10:17 PM

You missed this step

sudo mount -t ext4 /dev/sdXY /mnt

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#13 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 10:22 PM

I mounted with "disk" app ... that woun't cut it?

do I have to start all over?

reboot?

Do I need to start from scratch?



#14 cryptodan

cryptodan

    Bleepin Madman


  •  Avatar image
  • Members
  • 33,826 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:USA
  • Local time:05:02 AM

Posted 21 January 2022 - 10:31 PM

Yes reboot and follow the guide

US Navy Veteran from 2002 to 2006

Masters in Computer and Digital Forensics Expert - Stevenson University Alumni 2015

Arch Desktop - https://termbin.com/epij

Arch Laptop - https://www.termbin.com/dnwk

Ubuntu Server - https://termbin.com/zvra


#15 CAHJR74dot1

CAHJR74dot1

  •  Avatar image
  • Members
  • 28 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Planet Mercury
  • Local time:12:02 AM

Posted 21 January 2022 - 11:08 PM

Ok 

I followed the guide line for-line-just like you said, I rebooted and the default grub menu has both my Ubuntu partitions installed but It ignored installing the Windows 10 line.

 

I did notice that when I ran the "install" "check" and "update" code lines, that I noticed that the output screen  did list Windows 10 TWICE in the output generation window of text ...

 

I have however no proof, unless you have a way to make copies of that output for your convenance and analysis ... that you could see for yourself.

 

Other than the that ignoring of Windows, the software accomplished what it was suppose to do ...

 

I'll give you a break from my system and if you have a solution in mind just give me a holler sometime in the future ...

 

Otherwise thanks for all your help, man your the best ...

 

 






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users