First, you'll need to check the config. Its in theee... thee... /etc/grub.d/
? /etc/grub/
?.. somewhere there. Config file names look like this: 00xy, 10linux, 20other ... these are just examples, but the real thing is almost the same. Check them, where is the windows one. Back it up (copy it somewhere). You'll need something like this into the file:
menuentry "Windows" {
set root=(hd0,3)
chainloader +1
}
If you haven't got any config file like this, just create one. Grub2's config reading is easy-to-understand. It goes incrementally. Like: 00* , 10*, 20*, etc. So your new file should be named 95-windowsfix if you want it to be the last entry, or give it a smaller number (to make it the first entry) than Linux configs have if you want it to be the first.)
in the 'other' config file. Modify the set root value of course. Determine the hdd by typing: sudo fdisk -l
. For example, /dev/sda1
is (hd0,0)
if its on the second HDD: /dev/sdb1 >> (hd1,0)
..and so on. You can understand the syntax from this I guess. After you made the modifications, do an update-grub
and you can try to boot it.
I'm aware that this looks like a huge mess. Sorry for that. I don't have any Ubuntu machine near to me with Grub2 so thats why I wrote this much "i guess". If you won't be able to get it work, just ask.
Best Answer
Debian 8 (jessie) stores Grub 2 password parameters within the directory
/etc/grub.d/
. Inside this directory there are only scripts used to generate the configuration file.So you can create a new script (e.g.
/etc/grub.d/01_users
) with the following content:All the above lines are part of the file, because it is a script whose output will go in the final configuration file. Since it is a script, it will only be processed if it is executable (
chmod a+x ...
).As an alternative, you may put just the lines you need in one of the existing files that are tweaked to output their own contents. Here you can see how
/etc/grub.d/40_custom
substitutes the shell with a tail command returning script contents starting from the third line:In some Ubuntu derivatives (e.g. Mint 19) the format of the password changed as follows:
You may want to add "--unrestricted" to the menu entries you want to boot without a password. For example within the file
10_linux
:Finally launch
update-grub2
to generate the final configuration file/boot/grub/grub.cfg
.