How to add an item for windows into the grub menu?  [Solved]

When you run into problems installing MX Linux XFCE
Message
Author
hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

How to add an item for windows into the grub menu?

#1 Post by hako »

Well, I tried to install MX-21.1 alongside of Windows 10. Before a Ubuntu 18.04 was installed in separate (ext4) partitions boot, / and home, the disk had an MSDOS partition table with sda1(efi), sda2(Windows) ntfs formatted.
After installation of mx sda1 is fat32, home got erased, and mx can run, but there is no way to boot into Windows.
How to add an item for windows into the grub menu?

Huckleberry Finn

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#2 Post by Huckleberry Finn »

@hako welcome to the Forum and to MX.

Just, it's always better to open a new thread and post "Quick System Info" from menu.

Shortly (till then): There are many ways (we can create a custom entry at worst case).. But generally this is the reason: Say, Win. was installed when it was Uefi, then you changed to Legacy...

For now, boot MX and in a terminal:

Code: Select all

sudo update-grub
(While you're at it: it may be helpful if you take a screenshot and attach into your post, when GParted is open and the window is maximized.)

hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#3 Post by hako »

Thank you for replying so fast!
Unfortunately, update-grub does not seem to find my Windows, see attached.

Quick system info:

Code: Select all

System:    Kernel: 5.16.0-5mx-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/vmlinuz-5.16.0-5mx-amd64 
           root=UUID=<filter> ro quiet splash 
           Desktop: Xfce 4.16.0 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.16.1 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.1_ahs_x64 Wildflower April 9  2022 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: ASUSTeK product: K45VD v: 1.0 serial: <filter> 
           Mobo: ASUSTeK model: K45VD v: 1.0 serial: <filter> UEFI: American Megatrends v: 230 
           date: 01/24/2013 
Battery:   ID-1: BAT1 charge: 40.5 Wh (100.0%) condition: 40.5/52.2 Wh (77.7%) volts: 12.2 
           min: 11.1 model: COMPAL PABAS0241231 type: Li-ion serial: <filter> status: Full 
CPU:       Info: Dual Core model: Intel Core i5-3210M bits: 64 type: MT MCP arch: Ivy Bridge 
           family: 6 model-id: 3A (58) stepping: 9 microcode: 21 cache: L2: 3 MiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19954 
           Speed: 1614 MHz min/max: 1200/3100 MHz Core speeds (MHz): 1: 1614 2: 1595 3: 1522 
           4: 1471 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 
           mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling 
           Type: srbds status: Vulnerable: No microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics vendor: ASUSTeK driver: i915 
           v: kernel bus-ID: 00:02.0 chip-ID: 8086:0166 class-ID: 0300 
           Device-2: NVIDIA GF119M [GeForce 610M] vendor: ASUSTeK driver: N/A alternate: nouveau 
           bus-ID: 01:00.0 chip-ID: 10de:1058 class-ID: 0300 
           Device-3: IMC Networks USB2.0 UVC HD Webcam type: USB driver: uvcvideo 
           bus-ID: 1-1.4:3 chip-ID: 13d3:5166 class-ID: 0e02 serial: <filter> 
           Display: x11 server: X.Org 1.20.13 compositor: xfwm4 v: 4.16.1 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") 
           s-diag: 414mm (16.3") 
           Monitor-1: LVDS-1 res: 1366x768 hz: 60 dpi: 112 size: 309x174mm (12.2x6.9") 
           diag: 355mm (14") 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 21.2.5 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: ASUSTeK 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20 class-ID: 0403 
           Sound Server-1: ALSA v: k5.16.0-5mx-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK 
           driver: r8169 v: kernel port: d000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Qualcomm Atheros AR9485 Wireless Network Adapter vendor: Lite-On 
           driver: ath9k v: kernel modules: wl port: d000 bus-ID: 03:00.0 chip-ID: 168c:0032 
           class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Drives:    Local Storage: total: 931.51 GiB used: 64.44 GiB (6.9%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10JPVX-22JC3T0 
           size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
           type: HDD rpm: 5400 serial: <filter> rev: 1A01 temp: 35 C scheme: MBR 
Partition: ID-1: / raw-size: 59.28 GiB size: 58.05 GiB (97.92%) used: 5.69 GiB (9.8%) fs: ext4 
           dev: /dev/sda6 maj-min: 8:6 
           ID-2: /boot raw-size: 3.72 GiB size: 3.59 GiB (96.36%) used: 106.1 MiB (2.9%) 
           fs: ext4 dev: /dev/sda5 maj-min: 8:5 
           ID-3: /boot/efi raw-size: 100 MiB size: 98.4 MiB (98.42%) used: 266 KiB (0.3%) 
           fs: vfat dev: /dev/sda1 maj-min: 8:1 
           ID-4: /home raw-size: 93.13 GiB size: 91.17 GiB (97.89%) used: 58.65 GiB (64.3%) 
           fs: ext4 dev: /dev/sda7 maj-min: 8:7 
Swap:      Alert: No swap data was found. 
Sensors:   System Temperatures: cpu: 6280.4 C mobo: 56.0 C 
           Fan Speeds (RPM): N/A 
Repos:     Packages: note: see --pkg apt: 1988 lib: 988 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://ftp.halifax.rwth-aachen.de/mxlinux/packages/mx/repo/ bullseye main non-free
           2: deb http://ftp.halifax.rwth-aachen.de/mxlinux/packages/mx/repo/ bullseye ahs
Info:      Processes: 239 Uptime: 3h 33m wakeups: 2 Memory: 7.65 GiB used: 1.68 GiB (21.9%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: 10.2.1 
           alt: 10 Shell: Bash v: 5.1.4 running-in: quick-system-info-mx 
           inxi: 3.3.06 
Boot Mode: UEFI
You do not have the required permissions to view the files attached to this post.

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

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#4 Post by fehlix »

hako wrote: Sat Oct 15, 2022 8:13 am Thank you for replying so fast!
Unfortunately, update-grub does not seem to find my Windows, see attached.

Quick system info:

Code: Select all

System:    Kernel: 5.16.0-5mx-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/vmlinuz-5.16.0-5mx-amd64 
           root=UUID=<filter> ro quiet splash 
           Desktop: Xfce 4.16.0 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.16.1 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.1_ahs_x64 Wildflower April 9  2022 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: ASUSTeK product: K45VD v: 1.0 serial: <filter> 
           Mobo: ASUSTeK model: K45VD v: 1.0 serial: <filter> UEFI: American Megatrends v: 230 
           date: 01/24/2013 
Battery:   ID-1: BAT1 charge: 40.5 Wh (100.0%) condition: 40.5/52.2 Wh (77.7%) volts: 12.2 
           min: 11.1 model: COMPAL PABAS0241231 type: Li-ion serial: <filter> status: Full 
CPU:       Info: Dual Core model: Intel Core i5-3210M bits: 64 type: MT MCP arch: Ivy Bridge 
           family: 6 model-id: 3A (58) stepping: 9 microcode: 21 cache: L2: 3 MiB 
           flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19954 
           Speed: 1614 MHz min/max: 1200/3100 MHz Core speeds (MHz): 1: 1614 2: 1595 3: 1522 
           4: 1471 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 
           mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: conditional, RSB filling 
           Type: srbds status: Vulnerable: No microcode 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel 3rd Gen Core processor Graphics vendor: ASUSTeK driver: i915 
           v: kernel bus-ID: 00:02.0 chip-ID: 8086:0166 class-ID: 0300 
           Device-2: NVIDIA GF119M [GeForce 610M] vendor: ASUSTeK driver: N/A alternate: nouveau 
           bus-ID: 01:00.0 chip-ID: 10de:1058 class-ID: 0300 
           Device-3: IMC Networks USB2.0 UVC HD Webcam type: USB driver: uvcvideo 
           bus-ID: 1-1.4:3 chip-ID: 13d3:5166 class-ID: 0e02 serial: <filter> 
           Display: x11 server: X.Org 1.20.13 compositor: xfwm4 v: 4.16.1 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.2x8.0") 
           s-diag: 414mm (16.3") 
           Monitor-1: LVDS-1 res: 1366x768 hz: 60 dpi: 112 size: 309x174mm (12.2x6.9") 
           diag: 355mm (14") 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4000 (IVB GT2) v: 4.2 Mesa 21.2.5 
           compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: ASUSTeK 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20 class-ID: 0403 
           Sound Server-1: ALSA v: k5.16.0-5mx-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK 
           driver: r8169 v: kernel port: d000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Qualcomm Atheros AR9485 Wireless Network Adapter vendor: Lite-On 
           driver: ath9k v: kernel modules: wl port: d000 bus-ID: 03:00.0 chip-ID: 168c:0032 
           class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Drives:    Local Storage: total: 931.51 GiB used: 64.44 GiB (6.9%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD10JPVX-22JC3T0 
           size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
           type: HDD rpm: 5400 serial: <filter> rev: 1A01 temp: 35 C scheme: MBR 
Partition: ID-1: / raw-size: 59.28 GiB size: 58.05 GiB (97.92%) used: 5.69 GiB (9.8%) fs: ext4 
           dev: /dev/sda6 maj-min: 8:6 
           ID-2: /boot raw-size: 3.72 GiB size: 3.59 GiB (96.36%) used: 106.1 MiB (2.9%) 
           fs: ext4 dev: /dev/sda5 maj-min: 8:5 
           ID-3: /boot/efi raw-size: 100 MiB size: 98.4 MiB (98.42%) used: 266 KiB (0.3%) 
           fs: vfat dev: /dev/sda1 maj-min: 8:1 
           ID-4: /home raw-size: 93.13 GiB size: 91.17 GiB (97.89%) used: 58.65 GiB (64.3%) 
           fs: ext4 dev: /dev/sda7 maj-min: 8:7 
Swap:      Alert: No swap data was found. 
Sensors:   System Temperatures: cpu: 6280.4 C mobo: 56.0 C 
           Fan Speeds (RPM): N/A 
Repos:     Packages: note: see --pkg apt: 1988 lib: 988 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://ftp.halifax.rwth-aachen.de/mxlinux/packages/mx/repo/ bullseye main non-free
           2: deb http://ftp.halifax.rwth-aachen.de/mxlinux/packages/mx/repo/ bullseye ahs
Info:      Processes: 239 Uptime: 3h 33m wakeups: 2 Memory: 7.65 GiB used: 1.68 GiB (21.9%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: 10.2.1 
           alt: 10 Shell: Bash v: 5.1.4 running-in: quick-system-info-mx 
           inxi: 3.3.06 
Boot Mode: UEFI
The QSI report and the shown Gparted image, indicates the drive is partioned on a MBR/dos/ partition table.
And "as we all" know, MS-WinOS would normally only install on MBR/dos drive with BIOS-boot mode - not UEFI-boot mode. Getting Win installed in UEFI boot-mode requires a GPT-partition table not MBR - that's a Windows requirement/restriction - MX Linux can be installed on MBR or GPT within either or both BIOS- and UEFI- boot mode..
Now, somehow ESP "EFI System Partition" was later created on MBR-drive
and you installed MX Linux within UEFI-boot mode. Fine.
What you need to do in order to get Windows listed with GRUB menu is this:

In terminal as normal user run:

Code: Select all

sudo grub-install --target=i386-pc --recheck /dev/sda
which will install the BIOS/MBR GRUB boot loader.
You need now reboot and within BIOS/UEFI System Setup (Press F2-key or some other Fn -key)
and disabled UEFI and keep only BIOS/legacy/CSM boot mode.
Now reboot in MX Linux,
and run agian

Code: Select all

sudo update-grub
which should now find the BIOS-booting Windows installation.

+++EDIT+++

The place where you have created the ESP /dev/sda1, was probably originally occupied
by a Wndows own system partition, which may be needed by WIndows to get booted,
So if you reformated the Windows own System partition to a new ESP,
you may now get in trouble to get windows booting.

+++EDIT2+++
One way to figure out, whther Windows is still capable of bootin would be this:
* Boot from MX Live USB in BIOS/MBR boot mode ( you get Live Boot Menu with Fn-key panel)
* Select "Switch to GRUB Bootloader"
* Select "Boot Rescue Menus"
* Select to find "Windows bootloader"
Now if and only if windows own bootmgr would be available on the existing NTFS drive,
you may have luck. B/c you can place/move windows bootmgr onto C: drive
instead using the one Windows normally is using on it's System partition (which is now reformatted as an ESP)
* But even if you can now boot to Windows, it would now probably have issues when updating windows,
b/c it is missing it's own system partition.

hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#5 Post by hako »

Code: Select all

sudo grub-install --target=i386-pc --recheck /dev/sda
leads to:
error: /usr/lib/grub/i186-pc/modinfo.sh doesn't exist. Please specify --target or --directory
btw., the change to uefi was done by mx installation. I tried mint before, but it got stuck (without changing the ability to boot into windows.

hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#6 Post by hako »

looks like a typo, sorry!

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

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#7 Post by fehlix »

hako wrote: Sat Oct 15, 2022 8:56 am

Code: Select all

sudo grub-install --target=i386-pc --recheck /dev/sda
leads to:
error: /usr/lib/grub/i186-pc/modinfo.sh doesn't exist. Please specify --target or --directory
btw., the change to uefi was done by mx installation. I tried mint before, but it got stuck (without changing the ability to boot into windows.
Seems somewhere a typo it "i386-pc" not "i186-pc".

And yes, modern PC's can boot in either UEFI or BIOS boot mode,
but Windows can only be installed in either BIOS or UEFI.
So you have a BIOS-installed WIndows
but booted MX Linux installer in UEFI-boot mode,
and you may have chosen the WIndows sytem partition to re-formatted as ESP,
now Windows would have trouble to get booted - see my EDIT additons in my previous post.

hako
Posts: 26
Joined: Sat Oct 15, 2022 7:19 am

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#8 Post by hako »

difficulties to get into "Boot from MX Live USB in BIOS/MBR boot mode ( you get Live Boot Menu with Fn-key panel)". Does it also work with a CD?
I'll try later...

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

Re: Installing Linux MX next to Windows 11. How not to harm another system?

#9 Post by fehlix »

hako wrote: Sat Oct 15, 2022 9:45 am difficulties to get into "Boot from MX Live USB in BIOS/MBR boot mode ( you get Live Boot Menu with Fn-key panel)". Does it also work with a CD?
I'll try later...
Booting from DVD is supported by MX Linux.
You may need to select from a UEFI boot options list, which you get when pressing a fn-key,
sometimes F12 but also sometimes F9 or F10 - depending on the UEFI system in use.
If both UEFI and legacy BIOS/CSM are enabled, you would get something
e.g for Live USB two entries - one marked as "legacy/CSM" or similar.

User avatar
Eadwine Rose
Administrator
Posts: 15174
Joined: Wed Jul 12, 2006 2:10 am

Re: How to add an item for windows into the grub menu?

#10 Post by Eadwine Rose »

@hako your topic has been split off to make a new one.

Next time please start your own, and do not tack on to someone else's, thanks.
MX-23.6_x64 July 31 2023 * 6.1.0-38amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030

Post Reply

Return to “Installation”