OS - Dual boot Oracle Linux / Windows 10

EnglishVersion

Por vezes e interessante ter dois sistemas operativos numa maquina. Isso consegue-se particionando o disco, e instalar o sistema operativo noutra partição.Este post não e sobre essa instalação, mas sim sobre pós configuração.
Apos instalar Linux, quando inicio o portátil e espectável aparecer um menu para selecionar o sistema operativo, Linux ou Windows 10 ...
No meu caso o portátil carrega diretamente o Linux .. upss o Windows 10 "desapareceu" !!!
Este post partilho a investigação sobre isso .



Verificação rápida das configurações
No código abaixo podemos ver alguma informação sobre Sistema Operativo e sobre particionamento do disco
Podemos confirmar a existência da partição Windows -
Fixe, Não instalei o Linux na partição errada :)



[root@mylaptop ~]# cat /etc/oracle-release
Oracle Linux Server release 7.3

[root@mylaptop ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)

[root@mylaptop ~]# uname -a
Linux mylaptop.rogerioantonio.com 4.1.12-61.1.18.el7uek.x86_64 #2 SMP Fri Nov 4 15:48:30 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@mylaptop ~]# fdisk -l

Disk /dev/sda: 180.0 GB, 180045766656 bytes, 351651888 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: 0xc0ff46d8

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 139920590 69959271+ 7 HPFS/NTFS/exFAT/dev/sda2 139921408 140914687 496640 27 Hidden NTFS WinRE
/dev/sda3 140914688 142866431 975872 83 Linux
/dev/sda4 142866432 351651839 104392704 5 Extended
/dev/sda5 142868480 146784255 1957888 8e Linux LVM
/dev/sda6 146786304 351467519 102340608 83 Linux

Disk /dev/mapper/ol-swap: 2000 MB, 2000683008 bytes, 3907584 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


Configurar dual boot Oracle Linux / Windows 10
Parece que e necessário (re)configurar o dual boot manualmente, Isso consegue se em dois passos :

1 - adicionar as linhas abaixo ao ficheiro /etc/grub.d/40_custom

menuentry "Windows 10" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)' chainloader +1
}

2 - recompilar o ficheiros grub : grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)"



[root@mylaptop ~]# cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +5 $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 10" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
chainloader +1
}

[root@mylaptop ~]# grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)"

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.1.12-61.1.18.el7uek.x86_64
Found initrd image: /boot/initramfs-4.1.12-61.1.18.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-514.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-cde31ac14a2b4b86b98701797bbb530f
Found initrd image: /boot/initramfs-0-rescue-cde31ac14a2b4b86b98701797bbb530f.img
done

[root@mylaptop ~]# reboot


Mais info sobre este tema : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sec-customizing_the_grub_2_configuration_file
Obrigado pela leitura, espero que este post o tenha ajudado.
Rogerio

Comments