MX Linux and Windows 10 / dual boot from two drives  [Solved]

Message
Author
User avatar
Gerhard S.
Posts: 104
Joined: Sun Dec 29, 2019 11:15 am

Re: MX Linux and Windows 10 / dual boot from two drives

#11 Post by Gerhard S. »

Hi,
Subjekt: Boot MX without Grub(not in any MBR, nor any PBR).
Above, fehlix wrote it: Install Grub into Floppydisk.

Now I remember, I have had over years a folder on windos-ntfs hdd with simple, automated CD-image creation. An editable batchfile produces ISO (~500 kB) with win32-application mkisofs.exe
This ISO can be chainloaded by windos bootmanager.
This ISO contains Grub, and the instruction, which partition set to root fs and to load.
Example: Load Linux on hda10 (= sda9)

I'm at work, so I can't explain more details.
This method ist not fragile, also you can't edit anything with standard tools in running Linux. (Exept, create Grub-ISO-file in running Linux, put it in right place on hdd, ntfs-defragment it)

Only in 1 case I had to correct (build new) this Grub-ISO:
If added partition(s) on hdd. And the number of Linux-sda* changes.
Was very safe over years, Mint.

Question: Is it possible to boot MX with Grub legacy (the old one)?
MX-19.3-KDE-UEFI-Start, auf Lenovo Y50-70, Intel 4-Core i7-4710HQ, 16 GB, Graphics 4k/UHD, HD Audio, Wlan Intel driver: iwlwifi, Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet, SSD 1 TB, sda4 ntfs 940GB - sda6 ext4 26GB - sda7 swap 4GB

User avatar
fehlix
Developer
Posts: 12704
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Linux and Windows 10 / dual boot from two drives

#12 Post by fehlix »

Gerhard S. wrote: Mon Jan 20, 2020 2:18 am Above, fehlix wrote it: Install Grub into Floppydisk.
You might get confused: I wrote about two disk/hdd A and B, not floppy disk A.
Gerhard S. wrote: Mon Jan 20, 2020 2:18 am ISO can be chainloaded by windos bootmanager.
This method ist not fragile,
Yes, you can boot from ISO by chainloading. That's nothing todo with booting from PBR (Partition Boot Record), which is regarded by grub to be fragile.
Gerhard S. wrote: Mon Jan 20, 2020 2:18 am Question: Is it possible to boot MX with Grub legacy (the old one)?
Not really clear what you're asking. If you install in legacy BIOS-boot mode, you always boot in legacy boot from GRUB.
If you talking about "legacy GRUB" (Grub1) to boot instead of GRUB2 (the current GRUB), the question is also not clear,
as GRUB1 is still full functional, but have not used it for a while. GRUB4DOS is based on GRUB1 and can also be used for chainloading from WinOS boot menu in legacy mode ( That's actually what EasyBCD is doing! They use GRUB1-Grub4Dos to chainload into Linux or into ISO)
:puppy:

User avatar
Gerhard S.
Posts: 104
Joined: Sun Dec 29, 2019 11:15 am

Re: MX Linux and Windows 10 / dual boot from two drives

#13 Post by Gerhard S. »

@fehlix
In a few days, back at home again, I will check my archieves. The gole is clear: A non-fragile solution.
And how many parts of actual MX-Grub can be ported to Grub4Dos. (pre-configured Grub2-ISO?)
I have here several unused harddisks laying around - maybe I (newbie) do some tests with them: uefi.
If system/hw lets me....
MX-19.3-KDE-UEFI-Start, auf Lenovo Y50-70, Intel 4-Core i7-4710HQ, 16 GB, Graphics 4k/UHD, HD Audio, Wlan Intel driver: iwlwifi, Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet, SSD 1 TB, sda4 ntfs 940GB - sda6 ext4 26GB - sda7 swap 4GB

User avatar
fehlix
Developer
Posts: 12704
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Linux and Windows 10 / dual boot from two drives

#14 Post by fehlix »

Gerhard S. wrote: Mon Jan 20, 2020 9:28 am The gole is clear: A non-fragile solution.
You might better clearly define the goal. IIUC, and if that is about how to get a menu entry into the WinOS boot menu,
than I see a more "modern" solution provided by GRUB2, which is also available as a Windows port GRUB2WIN.
It provides a windows-menu entry to load a GRUB menu on windows C: drive, which can be adjusted to chainload
into any Linux GRUB menu of the installed Linux systems. This works for BIOS and UEFI booting. The alternative method by either using EasyBCD type (grub1/grub4dos chainlaoding or ISO chainloading) or EFI-chainloading works in UEFI or in BIOS only, respectively.
:puppy:

User avatar
Mauser
Posts: 1455
Joined: Mon Jun 27, 2016 7:32 pm

Re: MX Linux and Windows 10 / dual boot from two drives

#15 Post by Mauser »

The best way to do this is to install both drives in the case but leave one unplugged. Install Windows 10 then unplug that drive and plug the other one in. Install MX Linux on that drive. Now connect both drives but only enable the drive in the BIOS that you want to boot from. To switch the O.S. just boot into the BIOS and switch which one you want to boot from and enable it, disable the other. Then boot. Both drives can be UEFI this way. This way it is impossible for Windows to mess anything up and vice a versa.
I am command line illiterate. :confused: I copy & paste to the terminal. Liars, Wiseguys, Trolls, and those without manners will be added to my ignore list. :mad:

User avatar
Gerhard S.
Posts: 104
Joined: Sun Dec 29, 2019 11:15 am

Re: MX Linux and Windows 10 / dual boot from two drives

#16 Post by Gerhard S. »

hi folks,
3-2-1-start.
Here I write down my steps, experiences, and so on. I will edit them step by step; certainly delete some or all of them.

1) Have had a look into my laptop's bios: No UEFI. https://www.fujitsu.com/de/products/index.html
current BIOS V. 1.19: BIOS Date: 08/15/11 UEFI BIOS: Not Capable
UEFI-Alternative Linuxboot also starts for the first time Windows. A minimal Linux-System simulates UEFI-BIOS. With it you can boot Windows on GPT-formatted hdd's. Currently, the EFI support of LinuxBoot is limited to a few servers:
Dell R630
Open Compute Project Winferfell and Tioga Pass
Intel S2600WF



2) The mothers and fathers of MX19 ship it with a Grub-Installer. For testing, I will install Grub into Windos10-MBR_main_hdd;
But: First I backup all sectors, files; and prepare M$-service-CDs for the very unlikely case, system(s) would not boot after that.
I assume, if one deinstalls Grub with the given MX-tool, backed up win10-sectors/start-sequence will be also written back.

Windos10_MBR: --> MX Boot Repair(thx @fehlix) --> gHex

Code: Select all

33 c0 8e d0 bc 00 7c 8e c0 8e d8 be 00 7c bf 00 06 b9 00 02 fc f3 a4 50 68 1c 06 cb fb b9
04 00 bd be 07 80 7e 00 00 7c 0b 0f 85 0e 01 83 c5 10 e2 f1 cd 18 88 56 00 55 c6 46 11 05
c6 46 10 00 b4 41 bb aa 55 cd 13 5d 72 0f 81 fb 55 aa 75 09 f7 c1 01 00 74 03 fe 46 10 66
60 80 7e 10 00 74 26 66 68 00 00 00 00 66 ff 76 08 68 00 00 68 00 7c 68 01 00 68 10 00 b4
42 8a 56 00 8b f4 cd 13 9f 83 c4 10 9e eb 14 b8 01 02 bb 00 7c 8a 56 00 8a 76 01 8a 4e 02
8a 6e 03 cd 13 66 61 73 1c fe 4e 11 75 0c 80 7e 00 80 0f 84 8a 00 b2 80 eb 84 55 32 e4 8a
56 00 cd 13 5d eb 9e 81 3e fe 7d 55 aa 75 6e ff 76 00 e8 8d 00 75 17 fa b0 d1 e6 64 e8 83
00 b0 df e6 60 e8 7c 00 b0 ff e6 64 e8 75 00 fb b8 00 bb cd 1a 66 23 c0 75 3b 66 81 fb 54
43 50 41 75 32 81 f9 02 01 72 2c 66 68 07 bb 00 00 66 68 00 02 00 00 66 68 08 00 00 00 66
53 66 53 66 55 66 68 00 00 00 00 66 68 00 7c 00 00 66 61 68 00 00 07 cd 1a 5a 32 f6 ea 00
7c 00 00 cd 18 a0 b7 07 eb 08 a0 b6 07 eb 03 a0 b5 07 32 e4 05 00 07 8b f0 ac 3c 00 74 09
bb 07 00 b4 0e cd 10 eb f2 f4 eb fd 2b c9 e4 64 eb 00 24 02 e0 f8 24 02 c3 49 6e 76 61 6c
69 64 20 70 61 72 74 69 74 69 6f 6e 20 74 61 62 6c 65 00 45 72 72 6f 72 20 6c 6f 61 64 69
6e 67 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d 00 4d 69 73 73 69 6e 67 20 6f 70
65 72 61 74 69 6e 67 20 73 79 73 74 65 6d 00 00 00 63 7b 9a 21 a0 fd da 00 00
minds...

Grub2 supports GPT-harddisk without EFI:
Um GRUB 2 mit einer GUID-Partitionstabelle ohne EFI nutzen zu können, muss eine gesonderte Bootloader-Partition eingerichtet sein. Dieses kann in der GUI des Installers einer Desktop-CD/DVD bei der Auswahl und Einstellung der Partitionen vorgenommen werden.
Partitionnumber: First free space on datastorage
Label: ef02
Markierung: bios_grub (bei GParted)
Name: BIOS Boot-Partition (bei gdisk)
Filesystem: none - RAW-mode
GUID: 21686148-6449-6E6F-744E-656564454649
Size: 1024 KiB (1 MiB)
No Mountpoint


Grub2 needs hidden sectors after Bios-MBR and 1. PBR... size about 1 MB. I have to backup more... "dd it"

Grub2 can be installed in a not-formatted partition (around 200 MB) anywhere on hd. Later, after installlattion, there are advantages... boot x86 & x64 systems, maybe? mixed gpt- & mbr-based hdd's... (?)

Problem: If the hdd has a win-recovery-partition. And you don't want to loose that
-----------------------------------------------------------------------------
Typical Disc-Layout of a Boot-Partition after a fresh new Win10-installation: [source: Praxistipps zum Erstellen einer Recovery-Partition für Windows 10]
MBR/Basic
|450 MB Recovery Partition, invisible, no drive letter|
|100 MB EFI System Partition, invisible, no drive letter|
|500 GB Win NTFS, Boot, Pagefile, Crash Dump, Primary Partition|
| unused, leaves about 10 percent of the capacity free. This is a common way to speed up modern SSD's. |

GPT
| 450 MB Recovery NTFS Partition, invisible, no drive letter |
| 100 MB FAT32 UEFI Partition, invisible, no drive letter |
| 16MB Partition, Type: other, This partition takes care of bootstrapping, while the firmware is loading |
| 500 GB Win NTFS |
| unused, leaves about 10 percent of the capacity free. This is a common way to speed up modern SSD's. |

Steps for adding win recovery menu entry:
Make Recovery partition visible, assign drive letter, add new menu entry with path to WinRE.wim with easybcd.
Then test recovery menu entry, and if all right, delete drive letter of recovery partition, and again make it invisible.

--> conclusion: Leave recovery partition untouched. If it has to be, change size without data loss. Back up boot files, GUID/MBR partition table



---------------------------------------------------------------------------------------------------------------------
Begin of changes on existing 2TB hard disk, no (U)EFI, Win10_64 + MX19_64 installed, actual first boot manager is win10 (BCD), 1 of 6 menu entrys starts MX19 partition directly:
---------------------------------------------------------------------------------------------------------------------

Before, Grub manually installed in PBR on sda9
Which version do I have? -> Synaptic Package Manager, search "grub" on 'installed packages' --> 2.04-3-mx19+3
Change boot-parameters:
--> Menu/MX Tools -> MX Boot Options: Boot MX 19 patito feo, kernel-parameters 'quiet splash' deleted. Leave input-row empty.
--> Apply, wait 10 seconds, reboot. Everything fine, as it should be, Grub2 on sda9 has been updated correctly.
....[But now the messages appear far too quickly; so I can't read anything. Especially the fs-check passage. 'quiet splash' added again.]
..../var/log/boot.log

Code: Select all

Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... Scanning for Btrfs filesystems
done.
Begin: Will now check root file system ... fsck from util-linux 2.33.1
[/sbin/fsck.ext4 (1) -- /dev/sda9] fsck.ext4 -a -C0 /dev/sda9 
MX-Linux: clean, 414322/1556480 files, 4697004/6215168 blocks
done.
--> gParted:
sda1 ntfs, 391 GiB, boot, primary
sda2 extended, 1.44 TiB
sda5 ntfs 195 GiB
sda6 ntfs 97 GiB
sda7 ntfs 427 GiB
sda8 ntfs 721 GiB
sda9 ext4 24 GiB
sda10 linux-swap 6.7 GiB

Prepare win10-recovery-partition, win10-recovery-CD(, Super-Grub-CD) : MX19 on USB-stick is available.
Problem: If I add a partition after mbr and before sda1, possibly the linux partition designations will change also. Same for Win10. Unless I leave the new partitions hidden+offline... (?)
Win10 reports: (1) Unable to create a recovery drive on this PC. (2) Installation-media is required to create a recovery CD. --> downloading DVD-image 4 GiB...
--> win10_Pro_x64_v1909 system repair disk ready, and reading tested: size 505 MiB...
Reduce partition sda1 by 505+150 MiB at the beginning:
->check ntfs by win10, size adjust without data loss (?) maybe by win10 standard tool...
Sidenote: Win10 has not one problem with ext4- & linux-swap partitions. Of course, win10 is able to delete this volumes with 1 mouse click :p
Even though in the win10 disk management stood, partition sda1 is error-free, a forced scan resulted in a few minor errors (FF-cache). -> Repaired.
Gparted or macrorit_diskmanager-free-portable -> New partition layout:
MBR/Basic

Code: Select all

NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0   1,8T  0 disk 
├─sda1    8:1    0   577M  0 part 
├─free space 177 MiB
├─sda2    8:2    0 390,4G  0 part /media/hgw/Win10Pro_250GB
├─sda3    8:3    0     1K  0 part 
├─sda5    8:5    0 195,3G  0 part 
├─sda6    8:6    0  97,7G  0 part 
├─sda7    8:7    0 427,7G  0 part 
├─sda8    8:8    0 721,2G  0 part 
├─sda9    8:9    0  23,7G  0 part /
└─sda10   8:10   0   6,3G  0 part 
--> 577 MiB Recovery Partition has no system files, nor installation files, nor system recovery points. It only starts (tested) the win10 preinstalled environment:
....With it I can repair boot problems, install a new win10 system, restore system snapshots, mount DVD-setup-images, other disks, partitions, vhd's, ...

-->I ran one repair attempt, even though I knew there were no problems: everything all right.

Grub2 in MBR of sda installed. - all ok.

Code: Select all

MX 19 patito feo
Advanced options for MX 19 patito feo
Memory test (memtest86+)
Windows 10 (on /dev/sda1)
Windows 7 (on /dev/sda5)
Menu entry "Windows 10 (on /dev/sda1)" == Win10, with all previous BCD entries
Menu entry "Windows 7 (on /dev/sda5)" == dead, does nothing; at least it is correct that win 7 is on sda5
--> os-prober again installed/checked

Code: Select all

$ sudo update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/linen/theme.txt
Found linux image: /boot/vmlinuz-4.19.0-6-amd647
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found Windows Recovery Environment on /dev/sda1
Found Windows 10 on /dev/sda2
Found Windows 7 on /dev/sda5
done
Win7
--> /dev/sda5 is logical partition. Therefore sda5 is not win7 bootable. Needs a upstream primary partition(+win bootmanager on it). So the Grub2-menu-entry "Windows 7 on /dev/sda5" is useless and can be deleted. Win7-start is included in the Grub2-menu-entry "Windows 10 on /dev/sda2".
WinRE
--> Grub2-menu-entry "Windows Recovery Environment on /dev/sda1" should load wim-file(->extracted system in RAM). I don't have a solution for this topic yet. Also, "Windows Recovery Environment" is inluded in the Grub2-menu-entry "Windows 10 on /dev/sda2". I do not currently need this entry in the Grub2-menu.

----

I don't expect any support for the whole win stuff ;-)
Contrary to my original intention to only install Grub as a test, I make friends with the "new" boot manager.
And, I plan tests with second GPT harddisk.
Butters wrote: Sat Jan 18, 2020 4:54 am...
My goal is to be able to boot, and have the BIOS (or grub, etc) default to one or the other OS (and be able to choose which is the default, and also be able to manually pick either one at
But I have heard that Windows will sometimes perform an update that will screw up the boot loader. Is this a legitimate issue? And if yes, then what commands/tools, etc should I have ready on a repair-flash-drive
...
I have to think about this^^. There is probably no one-size-fits-all solution. At the moment I have the two systems on 1 disk.
[In case you have BIOS (no UEFI) computer]
I can only say so much at the moment: I don't need a USB stick. It's just 1 single sector that needs to be backed up and restored. And therefore the tools are already on board - on both systems.
Because Grub sits also in PBR of MX-partition, the start of MX is guaranteed at all times, even if a win update overwrites the MBR(-Grub bootloader).
Last edited by Gerhard S. on Tue Jan 28, 2020 11:19 pm, edited 63 times in total.
MX-19.3-KDE-UEFI-Start, auf Lenovo Y50-70, Intel 4-Core i7-4710HQ, 16 GB, Graphics 4k/UHD, HD Audio, Wlan Intel driver: iwlwifi, Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet, SSD 1 TB, sda4 ntfs 940GB - sda6 ext4 26GB - sda7 swap 4GB

User avatar
fehlix
Developer
Posts: 12704
Joined: Wed Apr 11, 2018 5:09 pm

Re: MX Linux and Windows 10 / dual boot from two drives

#17 Post by fehlix »

Gerhard S. wrote: Thu Jan 23, 2020 11:56 am I assume, if one deinstalls Grub with the given MX-tool, backed up win10-sectors/start-sequence will be also written back.
Grub de-installation will not write back a Win10 MBR. You can use MX Boot Repair, to create a backup of the MBR sector.

Post Reply

Return to “Software / Configuration”