Adding Menu windows or linuxDi Grub 2. Sometimes after we install windows or inux we often see no option in the grub os here we are using GRUB 2 I also experienced this after I found her Browsing this I will share to my friend all.
Let's check the file ...
It is a shell script, as stated in the first line.
echo "Some string" is a string that you will see when running update-grub. If you do not want to see printed echo commands, you can redirect the standard error or / dev / null:
echo "Some String"> & 2
Example: echo "Adding openSUSE 11.2"
cat << EOF start defining the actual boot entry.
menuentry "Something" is the name that will appear on the menu. Example: Linux.
set root = (HDX, Y) - we go back to the old school, setting the root device.
Critical! GRUB 2 uses PARTITION notation that starts with 1 and 0 do not like GRUB legacy! It is very important to remember!
In other words, the device is numbered 0, but partitions start with 1. For example, this means that the current sda1 (hd0, 1) and NO (hd0, 0) as before!
- Parameter boot - will actually change from one OS to another. In Linux, you might want to use something like:
- Parameter boot - will actually change from one OS to another. In Linux, you might want to use something like:
linux / boot / vmlinuz
initrd / boot / initrd.img
But in Windows, you would use:
chainloader (HDX, Y) +1
Therefore, a complete script example would look like:
Custom Linux
Or for Windows
#!/bin/sh -e
echo "Some string"
cat << EOF
menuentry "Something" {
set root=(hdX,Y)
-- boot parameters --
}
EOF
echo "Some string"
cat << EOF
menuentry "Something" {
set root=(hdX,Y)
-- boot parameters --
}
EOF
Let's check the file ...
It is a shell script, as stated in the first line.
echo "Some string" is a string that you will see when running update-grub. If you do not want to see printed echo commands, you can redirect the standard error or / dev / null:
echo "Some String"> & 2
Example: echo "Adding openSUSE 11.2"
cat << EOF start defining the actual boot entry.
menuentry "Something" is the name that will appear on the menu. Example: Linux.
set root = (HDX, Y) - we go back to the old school, setting the root device.
Critical! GRUB 2 uses PARTITION notation that starts with 1 and 0 do not like GRUB legacy! It is very important to remember!
In other words, the device is numbered 0, but partitions start with 1. For example, this means that the current sda1 (hd0, 1) and NO (hd0, 0) as before!
- Parameter boot - will actually change from one OS to another. In Linux, you might want to use something like:
- Parameter boot - will actually change from one OS to another. In Linux, you might want to use something like:
linux / boot / vmlinuz
initrd / boot / initrd.img
But in Windows, you would use:
chainloader (HDX, Y) +1
Therefore, a complete script example would look like:
Custom Linux
#!/bin/sh -e
echo "Adding my custom Linux to GRUB 2"
cat << EOF
menuentry "My custom Linux" {
set root=(hd0,5)
linux /boot/vmlinuz
initrd /boot/initrd.img
}
EOF
echo "Adding my custom Linux to GRUB 2"
cat << EOF
menuentry "My custom Linux" {
set root=(hd0,5)
linux /boot/vmlinuz
initrd /boot/initrd.img
}
EOF
#!/bin/sh -e
echo "Adding Windows 8 to GRUB 2 menu"
cat << EOF
menuentry "Windows 8" {
set root=(hd0,1)
chainloader (hd0,1)+1
}
EOF
echo "Adding Windows 8 to GRUB 2 menu"
cat << EOF
menuentry "Windows 8" {
set root=(hd0,1)
chainloader (hd0,1)+1
}
EOF
0 comments:
Speak up your mind
Tell us what you're thinking... !