LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-31-2017, 03:48 PM   #1
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Rep: Reputation: Disabled
Help with Dual Boot Linux Arch and Win10


Hi guys, I'm pretty new to Linux in general. Can you help me to setup the dual boot? I tried but when I installed grub I couldn't enter in my Windows partition anymore, I had to remove the Linux partition and from windows cd console run /FixBoot (without deleting the linux partition it wasn't fixing it). I'm pretty sure there was a better way to handle this and I hope you can help me to avoid this the next time

I have a gigabyte motherboard that have some problem with linux, basically USB Port, LAN e PCI-E wifi cards are not recognized unless you enable in the bios the IOMMU Controller and the SVM. I followed this guide (https://www.youtube.com/watch?v=_ky20Ywo3Eo) and everything works fine.

My Windows partition boots in BIOS-MBR mode (run -> msinfo32 -> BIOS Mode = Legacy). In my first try I created one partition of about 100GB ext4 with fdisk (I read it supports MBR)

Those are the disks and partitions
https://s26.postimg.org/d58dc7om1/partitions.png
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Disk 2 (C Is a SSD with Windows 10 inside
Disk 1 (D Its a data disk where I store stuff
Disk 0 Its little weird because I have a partition "System Reserved" of 500MB that should be of Windows boot? when I installed Windows 10 it created thatg 500MB partition there instead than the Disk 2 (the SSD)
Disk 0 (A its a data disk like Disk1, right now its empty
Disk 0 Unallocated its where I want to install Linux Arch

If you think the partitions are messed up I can reinstall everything from the start, I have everything backuped so its not a big deal

So now I want to reinstall linux in Disk0 Partition 3 (97.66GB), I dont need a swap partition as I have 8gb of RAM, my installation goes generally like this:
check internet works
make partition with fdisk
$ mkfs.ex4 /dev/sda3
$ mount /dev/sda3 /mnt

$ pacstrap -i /mnt base base-devel
$ genfstab -U -p /mnt >> /mnt/etc/fstab

$ arch-chroot /mnt /bin/bash

$ rm /etc/localtime
$ ln -s /usr/share/zoneinfo/Europe/Rome /etc/localtime
$ hwclock --systohc --utc

$ nano /etc/locale.gen
Remove comment en_US.UTF-8 and it_IT.UTF-8
$ locale-gen
$ nano /etc/locale.conf
Write this content:
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=it_IT.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=it_IT.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=it_IT.UTF-8
LC_TELEPHONE=it_IT.UTF-8
LC_MEASUREMENT=it_IT.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

$ export LANG=en_US.UTF-8
$ nano /etc/vconsole.conf
Write
KEYMAP=it

$ echo NameComputer > /etc/hostname

$ systemctl enable dhcpcd

$ passwd

$ nano /etc/mkinitcpio.conf
$ mkinitcpio -p linux

--------------------------------------------
HERE I INSTALLED THE GRUB
-------------------------------------------->
$ pacman -S grub-bios
$ grub-install --target=i386-pc /dev/sda3 (The partition where I installed linux)
$ grub-mkconfig -o /boot/grub/grub.cfg
<--------------------------------------------

$ useradd -m -G wheel-s /bin/bash name_account
$ passwd name_account

$ nano /etc/sudoers
Remove comment %wheel

$ pacman -S openssh
$ systemctl enable sshd.service

$ exit
$ umount -R /mnt
$ reboot

After this I can see grub with only Arch Linux. If I try to start Windows "manually" through F12 and the selection of the ssd with windows inside it doesnt work, it shows grub with the arch linux option


Sorry for this long post and for the many english errors, I tried to be clear as possible
 
Old 08-31-2017, 05:49 PM   #2
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2
Posts: 414

Rep: Reputation: 88
First identify where your BIOS boots now, and where you want it to boot with GRUB.
If the BIOS goes to the MBR of the SSD to boot Windows10, and your GRUB is installed on the MBR of Disk0, then that is a complication that GRUB needs to know about.

You need to mention if there are any other Boot loaders on your system to contend with.
Does the BIOS have boot selection, or you could have Windows Boot selection ?
I would assume that if you are installing GRUB that you either do not have any of these
or have chosen to not use them. If your installing GRUB bypasses a boot selection that
you were using before, that would affect the setup. GRUB can handle these special cases but you first need to discover if you have any.

MBR = Master Boot Record
Which drive is GRUB being installed upon (otherwise we assume it is in the Drive0 MBR).
Was the default boot using the SSD MBR ?
Are you moving the BIOS boot to Disk0 MBR ?

GRUB needs to be setup to see the Windows10 installation on the SSD.
The default setup of GRUB will not include that (as far as I know) unless you specify all the information to locate the Windows10, and you must be specific that it is on a different drive than the GRUB boot.

It is possible to install GRUB over the existing MBR, which will clobber the ability of any OTHER boot selection program to boot using that MBR.

If GRUB is installed to a different drive MBR, then the existing boot selection will still work. However, to boot using GRUB would then require changing the BIOS to boot using the MBR of the drive where GRUB was installed. I have no idea what that might do to your F12 booting.

It is usual to have only ONE boot selection program. Other boot selection programs then can be chained to it. Having two different events trigger two different kinds of boot selections programs leading to two different OS will require careful setup, by someone who knows more about that F12.

I refer you to the GRUB installation manual for details, as that covers all this.

Last edited by selfprogrammed; 08-31-2017 at 06:00 PM.
 
Old 08-31-2017, 06:34 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,695

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
It should be as simple as installing the os-prober package in Arch - grub by itself doesn't go looking for other installs, but if os-prober is present grub will use it. So before the mkconfig, install os-prober, then you should have a (valid) entry to boot Win10.

I'm surprised a fresh install of Win10 will install to a MBR disk - I have a couple, but they were upgrades from Win7.
 
1 members found this post helpful.
Old 09-01-2017, 11:10 AM   #4
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
@selfprogrammed
Hi thanks for your answer, I installed grub in the same hard disk where I installed linux (Disk 0, partition 3)
I just need grub for the OS selection, in the other post I was mentioning the manual booting through F12 because I didn't understand why I couldn't access windows anymore after I installed grub, even "manually" selecting on boot the ssd with windows it still would display grub (that was installed in another hard disk), basically I couldn't enter in window, I had to remove linux and fix the boot of windows with usb, if I tried without removing linux the command /FixBoot would give some error

@syg00
Thank you im gonna try it tomorrow. The installation was fresh, I think its because of my (default) bios settings:
Boot Mode Selection = UEFI and Legacy
Storage Boot Option Control = Legacy First
Other PCI Devices ROM Priority = UEFI OpROM (this one disturb me, I mean everything is legacy except it, go figure..)

I kind of wanted to reinstalled everything on UEFI but for what its worth..
 
Old 09-01-2017, 05:57 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,695

Rep: Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548Reputation: 3548
In this day and age, you should use UEFI when-ever you can. That basically means always. Format your disks as gpt as well - same reason; less trouble going forward.
 
Old 09-01-2017, 10:02 PM   #6
fkiss
LQ Newbie
 
Registered: May 2012
Posts: 16

Rep: Reputation: Disabled
Lightbulb Dual Booting Systems

I am a hardware guy and the way I dual boot a system is to interchange the hard drive with another drive.
First, let me describe my systems. I have a LARGE, ALL MY DATA, hard drive on my router which is accessible from all computers via the LAN. My main computer is a tower with front plug-in drive slots. If I want to try another operating system, I merely pull the old hard drive and plug in a new drive. Small drives are cheap now and Linux doesn't take much space. If I like the new operating system, I plug my old drive into a USB port and copy the files to the new drive.
I recently had a need for Windoz 10 so I purchased a Small Form Factor (SFF) computer with Windoz 10 on it for less than $100. I did my work with Windoz then replaced the hard drive. I now have a dual boot computer with Windoz 10 and Linux Mint for under $150.
For you software guys - don't be afraid to open a computer. Here is a tip from an old hardware guy - if you are concerned about static electricity (AND YOU SHOULD BE) take off your shoes and socks.
Another tip - take the time document the loading process. It will save time the next time you want to do a load.
Have fun and get back to using your computer as quickly as possible.
KISS Keep It Simple S----d
 
Old 09-02-2017, 02:32 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,235
Blog Entries: 10

Rep: Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160Reputation: 5160
Quote:
Originally Posted by syg00 View Post
In this day and age, you should use UEFI when-ever you can. That basically means always. Format your disks as gpt as well - same reason; less trouble going forward.
so the reason everybody should be using both gpt and uefi is "less trouble going forward"?
can you elaborate on that?
thanks.
 
Old 09-02-2017, 07:58 AM   #8
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224

Rep: Reputation: 69
You should check the motherboard firmware settings to see how it is booting up. Normally windows 8 (probably 10 as well. I am less familiar with 10) wants to set up in UEFI/GPT mode. However, if you boot the install medium in legacy mode, windows will set itself up in legacy mode with an MSDOS-labeled disk and an MBR. The same holds for the Arch linux medium.

On UEFI boards, there is an F-key you have to press to bring up the firmware boot manager. If the ISO medium is hybrid (Arch definitely is), it should appear twice, if CSM is enabled. One entry has a UEFI prefix, the other is legacy. You can select whichever boot mode you want.

IMHOP a UEFI/GPT install is easier to maintain in the long run, especially for multi boot. The GPT label supports a large number of partitions. All are primary, so there is no logical partition contained in an extended partition as in a MSDOS labeled disk. Then there is the 2 TB limit. UEFI/GPT has no primary (MBR) and secondary (VBR) boot loaders. All are on the same footing, contained in the ESP in separate directories. You can register each boot loader in the NVRAM using efibootmgr, or delete the ones you don't need. In Arch, you mount the ESP at /boot, as per their instructions. I mount mine at /boot/efi, in keeping with all the other distros.

If it is a new board, you have to spend some time tinkering with the firmware settings, including flashing a new version. Some UEFI are more unfriendly than others. InSyde is especially nasty.
 
Old 09-02-2017, 02:17 PM   #9
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2
Posts: 414

Rep: Reputation: 88
Installing GRUB in many systems is not guaranteed to find every OS.
That is why there are programs like os-finder, which automate the second step of adding all the other OS to the initial GRUB boot menu.

There is usually some manual editing afterwards of the GRUB setup, to add other boots or to adjust boots it found.
This would add the Windows10 to the boot menu.

The GRUB manual tells you how to bring up the GRUB menus, and how to add boots and edit them.

To deal with all kinds strange setups, GRUB has extensive capabilities, which the manual mentions. It is possible to set it up in strange ways that do not work.
While it is possible to install GRUB to a partition, I hope you meant GRUB
is in (Disk0, MBR). In a partition, another boot program (like a BIOS firmware boot)
would start, and then it would boot the main partition which has GRUB, and then GRUB
would boot other partitions. This is a complication for when it a BIOS makes it difficult
to change the drive MBR (such as root kit protection) or an OS that keeps checking that
the MBR has not been changed.


Your F12 key may be tied to using UEFI.
I do not know what the installation of GRUB may do to your firmware boot on F12 and the
UEFI tables. It may have cooperated with the install to an MBR and updated its UEFI somewhat appropriately to support its F12. That would make Windows10 inaccessible.

It may also be that GRUB did not get installed where you thought. It may have gone to the SSD MBR. It would boot just fine from there and you may not even know the difference.
Be careful reading your drive identification for these things, pay attention to those long ID numbers. When you add a drive, the other drive designations may (and usually do) move on you.
 
Old 09-05-2017, 12:19 AM   #10
WFV
Member
 
Registered: Apr 2012
Location: somehow, somewhere
Distribution: Arch
Posts: 193

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
so the reason everybody should be using both gpt and uefi is "less trouble going forward"?
can you elaborate on that?
thanks.
For the OPs install (imo) it would be much simpler being the machine is new and uefi and both OS installs are new. uefi intent is to phase out bios.
here is an informative article on uefi that might help OPs achieve dual boot via uefi:
https://www.happyassassin.net/2014/0...lly-work-then/
 
Old 09-05-2017, 01:13 AM   #11
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora,Xubuntu, others
Posts: 5,447

Rep: Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056Reputation: 1056
try installing grub to disk 1 mbr, it may work even if it is a dirty fix.
 
Old 09-05-2017, 03:39 PM   #12
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2
Posts: 414

Rep: Reputation: 88
Some additional information, which may impact the original question, or other readers seeking information here.

I answered the original question about booting with GRUB using MBR.
I have other computers using MBR and have the tools and expertise for dealing with the drive sizes and BIOS I have to deal with, so far. So I answered the original question.

If I actually had a motherboard and BIOS that supported UEFI, and had no conflicting requirements, I would probably try to use that instead.

Using GPT for the partition tables simplifies them considerably. I already have 14 partitions on a drive and GPT supports that kind of thing more simply than the MSDOS partition table scheme. A large drive is also going to require GPT because the MSDOS partition table scheme is patched up beyond reason now and it is not going to get any more fixes to support those things.

One restriction with using GPT on a drive is you will not be able to move it to any other computer (for fixes, copy, or other maintenance) unless it also supports GPT partition tables. Once you have one computer using GPT, you will likely want to have two computers that use GPT. If you got only one computer, this is less of an issue, but it does not entirely go away, especially when situations arise where you need to do drive maintenance on a machine that will not boot.

There is one point that I am not clear on, but I assume (probably without good reason) that
having booting drives using UEFI and GPT still allows you to mount a drive that uses a MBR and MSDOS partitions. The BIOS setting for UEFI+Legacy is probably to support that issue as the BIOS has to read the partition tables of all hard drives. Setting the BIOS as UEFI only may prevent installing any Legacy drives to that machine. This may be an issue if you have multiple computers, or backup drives setting on a shelf, that you may want to install and read/write on a temporary basis.

I do not know the exact answer on that question, but if you do not have such requirements then using UEFI and GPT avoids some obsolescence issues that the MBR and MSDOS partitions have.
 
1 members found this post helpful.
Old 09-07-2017, 11:56 AM   #13
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hi guys, so I tried again but still no luck, but I think Im closer.
My setup is now changed.
I reinstalled Win10 with EFI, the bootloader is now in the same disk (the SSD) and I think its much more better now because even if grub is not seeing Win10 I can boot manually through F12 -> select SSD with Win10 (something I couldn't do before)

My new disks configuration here:
https://s26.postimg.org/yk8nqyt5j/disk.png
Disk 0 = linux arch
Disk 1 = its just data
Disk 2 = Win10

I reinstalled Arch and I made 3 partitions with gdisk:
sda1 = 500mb ef00
sda2 = 500mb 8300
sda3 = 100gb 8300

mkfs.fat -F 32 -n EFI /dev/sda1
mkfs.ext4 -L fs_boot -O ‘^64bit’ /dev/sda2
mkfs.ext4 -L fs_root /dev/sda3
(Are those commands ok? I saved them a while ago and I dont remember much about them to be fair, I know they serve to format the partitions, but I wonder whats that ‘^64bit’)

mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda2 /mnt/boot
mkdir /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi

then I installed grub:
pacman -S grub
pacman -S efibootmgr
grub-install --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

After this I tried but couldn't see Win10, so I installed os-prober, run it and run again the command:
grub-mkconfig -o /boot/grub/grub.cfg

I still can't see win10. I think I made a mistake with the path "--efi-directory=/boot/efi" maybe it was "--efi-directory=/boot" ? or maybe I have to save grub.cfg in another path

What do you think?
This is what its inside my /boot directory
https://s26.postimg.org/ophikqp7d/IM...907_183359.jpg

Greetings
 
Old 09-07-2017, 01:10 PM   #14
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224

Rep: Reputation: 69
I am surprised that it didn't work. I wrote a bash script to install Arch. Here are some excerpts from that script that might be relevant
Code:
mount /dev/sda1 /mnt/boot/efi
Keep in mind that their web site recommends /mnt/boot. If you want support, you will have to follow their rules. However, since I am primarily a Fedora and Gentoo user, I wanted to be consistent. So far, there has not been a problem upgrading Arch linux using pacman -Syu.
For UEFI/GPT install
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id="archlinux" --recheck
grub-mkconfig -o /boot/grub/grub.cfg
If you are installing on a MSDOS labeled disk or on a GPT disk with a 100MiB EF02 bios_grub layer
Code:
grub-install --target=i386-pc --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
The boot loader looks for grub.cfg based on the
Code:
--boot-directory
switch.
AFIK, windows does not allow direct boot by non-windows boot loaders. Consequently. os-prober may not work. I boot windows by adding the following stanza to /etc/grub.d/40_custom
Code:
menuentry "Windows 10" {
	insmod part_gpt
	insmod chain
	set root='(hd0,gpt2)'
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
All you have to do is replace hd0 with the disk number that contains windows, and gpt2 with the partition number of the ESP that contains the windows boot loader.
 
1 members found this post helpful.
Old 09-08-2017, 08:25 AM   #15
yod
LQ Newbie
 
Registered: Aug 2017
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by plasmonics View Post
I am surprised that it didn't work. I wrote a bash script to install Arch. Here are some excerpts from that script that might be relevant
Code:
mount /dev/sda1 /mnt/boot/efi
Keep in mind that their web site recommends /mnt/boot. If you want support, you will have to follow their rules. However, since I am primarily a Fedora and Gentoo user, I wanted to be consistent. So far, there has not been a problem upgrading Arch linux using pacman -Syu.
For UEFI/GPT install
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id="archlinux" --recheck
grub-mkconfig -o /boot/grub/grub.cfg
If you are installing on a MSDOS labeled disk or on a GPT disk with a 100MiB EF02 bios_grub layer
Code:
grub-install --target=i386-pc --recheck /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
The boot loader looks for grub.cfg based on the
Code:
--boot-directory
switch.
AFIK, windows does not allow direct boot by non-windows boot loaders. Consequently. os-prober may not work. I boot windows by adding the following stanza to /etc/grub.d/40_custom
Code:
menuentry "Windows 10" {
	insmod part_gpt
	insmod chain
	set root='(hd0,gpt2)'
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
All you have to do is replace hd0 with the disk number that contains windows, and gpt2 with the partition number of the ESP that contains the windows boot loader.

Thank you very much, I fixed it adding it manually as you suggested
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dual-system boot broken by Win10 Update noiett Slackware 20 07-13-2017 06:39 PM
Partitioning Advice - Dual boot Win10 + Linux + KVM for additional distros scottinsydney Linux - Newbie 5 01-13-2017 06:15 AM
update Win7 to Win10 on existing Ubuntu15.10 dual-boot sebu11 Linux - Laptop and Netbook 13 09-17-2016 04:53 PM
Installed Win10 next to linux, dual boot fails (EasyBCD) ivy2011 Linux - Software 6 03-22-2016 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration