HOW Adding Menu windows or linux on Grub2 - E-Learning With Blog
Headlines News :
Home » » HOW Adding Menu windows or linux on Grub2

HOW Adding Menu windows or linux on Grub2

Written By Unknown on Selasa, 12 Februari 2013 | 21.05

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.

#!/bin/sh -e
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 

Or for Windows

#!/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
Share this article :

0 comments:

Speak up your mind

Tell us what you're thinking... !

SubScriber

Masukan alamat Email kamu disini untuk mendapatkan artikel terbaru..!

Add to Google Reader or Homepage

Join Member

 
Support : Creating Website | Johny Template | Mas Template
Proudly powered by Blogger
Copyright © 2011. E-Learning With Blog - All Rights Reserved
Template Design by Creating Website Published by Mas Template