Rhel grub loader not showing when dual boot

After successful installation of red-hat
you have notice that we couldn't installed grub loader at the end of Linux installation
the actual reason was servers will not come with grub by default

first we need to find which portion of window is boo-table
to find the portion number
[root@localhost ~]# fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes, 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x81fa8093

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      718847      358400    7  HPFS/NTFS/exFAT
/dev/sda2          718848   146800639    73040896    7  HPFS/NTFS/exFAT
/dev/sda3       146802686   293601279    73399297    f  W95 Ext'd (LBA)
Partition 3 does not start on physical sector boundary.
/dev/sda4       293601280   625139711   165769216    7  HPFS/NTFS/exFAT
/dev/sda5       146802688   209717247    31457280    7  HPFS/NTFS/exFAT
/dev/sda6       209719296   210767871      524288   83  Linux
/dev/sda7       210769920   289404927    39317504   83  Linux
/dev/sda8       289406976   293601279     2097152   82  Linux swap / Solaris

//here sda1 was the bootable drive, then we need to find the uuid of that drive

[root@localhost ~]# blkid
/dev/sda1: LABEL="System Reserved" UUID="2A340D89340D5969" TYPE="ntfs"
/dev/sda2: LABEL="Windows" UUID="A86E6BC56E6B8AC0" TYPE="ntfs"
/dev/sda4: LABEL="Boobi" UUID="C28040BA8040B6A7" TYPE="ntfs"
/dev/sda5: UUID="0C9474B39474A0BE" TYPE="ntfs"
/dev/sda6: UUID="6dc3410a-d9a7-412b-a773-44ef0bef67f5" TYPE="ext4"
/dev/sda7: UUID="30752018-b856-4555-91cb-1b62db4c12f6" TYPE="ext4"
/dev/sda8: UUID="2db5a4fd-0c57-4a37-a2ad-69e8ced20ce6" TYPE="swap"

//copy the uuid of sda1 and put them in to grub config file

[root@localhost ~]# vi /etc/grub.d/41_custom

#!/bin/sh
cat <<EOF
if [ -f  \${config_directory}/custom.cfg ]; then
  source \${config_directory}/custom.cfg
elif [ -z "\${config_directory}" -a -f  \$prefix/custom.cfg ]; then
  source \$prefix/custom.cfg;
fi
EOF

cat <<EOF
menuentry "Windows 10" {
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos1'
        search --no-floppy --fs-uuid --set=root 2A340D89340D5969
        chainloader +1
}
EOF


//edit and save like that,
//then regenerate the grub configurations

[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg

[root@localhost ~]# tail /boot/grub2/grub.cfg
  source $prefix/custom.cfg;
fi
menuentry "Windows 10" {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    search --no-floppy --fs-uuid --set=root 2A340D89340D5969
    chainloader +1
}
### END /etc/grub.d/41_custom ###

//now reboot your server, you will get your grub loader!!!

Post a Comment

0 Comments