Thursday, July 23, 2020

Dual boot menu windows 10 & CentOS 7 linux

 infile :-write a file "windows10"
as follows :-

     #!/bin/sh -e
    echo "Adding Windows" >&2
    cat << EOF

    menuentry "Windows 10"
    {
      set root=(hd0,1)
      chainloader +1
    }

    EOF

change permission and copy this file to : -

    # chmod +x windows10

    # cp window10 /etc/grub.d/.


then give command   :-                                  

    # grub2-mkconfig  --output=/boot/grub2/grug.cfg

there will errors. Don't warry. this  will generate file :-

    /boot/grub2/grub.cfg.new


and having folowing entry :-

in grub.cfg.new :-
--------------

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows 10 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-2CFA4829FA47EE20' {
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 --hint='hd0,msdos1'  2CFA4829FA47EE20
        else
          search --no-floppy --fs-uuid --set=root 2CFA4829FA47EE20
        fi
        parttool ${root} hidden-
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###


rename file

     # mv  gurb.cfg grub.cfg.original.backup
     #mv grub.cfg.new grub.cfg


if you want to change timeout setting  search "TIMEOUT=5" . This will be two times. On both  set timeout as you want  , i set it 30 seconds.
save and exit.
--------------------------------------
in grubenv file for default selection as "window" in grub menu :-
------------------

    # GRUB Environment Block
    #saved_entry=CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
    saved_entry=Windows 10 (loader) (on /dev/sdb1)



No comments:

Post a Comment