How to fix up the missing ubuntu boot loader in your dual-boot computer(windows&ubuntu)

When I install ubuntu 16.04 on my computer, I made a mistake.
I select /dev/sda7 as the device for boot loader installation.
it caused that there was no ubuntu boot option after you completed
the installation.
The correct selection should be /dev/sda like below.


And one day you update your windows to a new version, the ubuntu boot loader
will overwrite and leads to the same problem.

anyway, we have to fix up the problem.
let't follow the same step when we try to install dual boot system.
here is the link.
but this time we just to install the boot loader for ubuntu, not real install the ubuntu system.
so please remember to click quit once you go to here.


















What we need to do is just open a terminal and type below command.

get root permission
$sudo -i 
find your mount point of your ubuntu system. mine is /dev/sda7
mount your ubuntu system
#mount /dev/sda7 /mnt
if you have a /boot partition of your ubuntun system, please remember mount it too
install boot loader
#grub-install --root-directory=/mnt /dev/sda
/dev/sda is the disk device where your windows loader placed.

ok. restart your computer and you will find your ubuntu boot loader come back.
the last command. open your terminal again.
$sudo update-grub

Comments

Popular posts from this blog

How to fix error : no module named sendgrid when try to use sendgrid python lib in PHP.

react-native run-android : sun.security.provider.cert path.SunCertPathBuilderException : unable to find valid certification path to req uested target

react-native run-android : do not build/update modified code(App.js)