RSS

How to add entry Grub 2 on CentOS 7 for Dual Boot Loader

19 Sep

How to add entry Grub 2 on CentOS 7 for Dual Boot Loader

1. To check fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000080

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 137091071 68442112 7 HPFS/NTFS/exFAT
/dev/sda3 137091072 556929023 209918976 7 HPFS/NTFS/exFAT
/dev/sda4 556929024 976771071 209921024 f W95 Ext’d (LBA)
/dev/sda5 556931072 768124927 105596928 7 HPFS/NTFS/exFAT
/dev/sda6 768126976 768946175 409600 83 Linux
/dev/sda7 768948224 976771071 103911424 8e Linux LVM

Disk /dev/mapper/vg_dilli-LogVol01: 102.2 GB, 102206799872 bytes, 199622656 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/vg_dilli-LogVol00: 4194 MB, 4194304000 bytes, 8192000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

2. To add boot loader for Windows 7

root@ dilli]# cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the ‘exec tail’ line above.

menuentry “Windows 7” {
set root=(hd0,1)
chainloader +1
}

3. To run the following command for updating to boot loader

[root@ dilli]#  grub2-mkconfig –output=/boot/grub2/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-c833c6b0eb7b44bc9cc074241dd98ed7
Found initrd image: /boot/initramfs-0-rescue-c833c6b0eb7b44bc9cc074241dd98ed7.img
done

4. Finally Reboot it, That’s it.

 
Leave a comment

Posted by on September 19, 2017 in Documents, Linux, Windows

 

Leave a comment