Grub won't detect second MX Linux installation

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
DR77
Posts: 103
Joined: Wed Oct 07, 2020 9:04 am

Grub won't detect second MX Linux installation

#1 Post by DR77 »

On my laptop i have two disks. On the first disk i have MX Linux XFCE installed and on the second i installed MX Linux KDE. But if i run 'sudo update-grub' on any of the installations it won't detect the other MX Linux install.


System info:

Code: Select all

System:
  Kernel: 6.1.0-20-amd64 [6.1.85-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/vmlinuz-6.1.0-20-amd64 root=UUID=<filter> ro quiet splash
    init=/lib/systemd/systemd
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23.2_x64 Libretto January 21  2024 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Laptop System: Hewlett-Packard product: HP EliteBook 8560w v: A0001D02
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: Hewlett-Packard model: 1631 v: KBC Version 01.39 serial: <superuser required>
    BIOS: Hewlett-Packard v: 68SVD Ver. F.22 date: 01/05/2012
Battery:
  ID-1: BAT0 charge: 0% condition: 26.4/26.4 Wh (100.0%) volts: 5.0 min: 14.8
    model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: not charging
CPU:
  Info: model: Intel Core i7-2820QM bits: 64 type: MT MCP arch: Sandy Bridge gen: core 2 level: v2
    built: 2010-12 process: Intel 32nm family: 6 model-id: 0x2A (42) stepping: 7 microcode: 0x2F
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 256 KiB
    desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 799 high: 800 min/max: 800/3400 scaling: driver: intel_cpufreq
    governor: conservative cores: 1: 798 2: 798 3: 798 4: 800 5: 800 6: 798 7: 800 8: 800
    bogomips: 36716
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  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: mmio_stale_data status: Unknown: No mitigations
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  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; PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GF108GLM [Quadro 1000M] vendor: Hewlett-Packard driver: nvidia v: 390.157
    non-free: series: 390.xx+ status: legacy-active (EOL~late 2022) arch: Fermi code: GF1xx
    process: 40/28nm built: 2010-16 pcie: gen: 2 speed: 5 GT/s lanes: 16 bus-ID: 01:00.0
    chip-ID: 10de:0dfa class-ID: 0300
  Device-2: IMC Networks USB2.0-Camera type: USB driver: uvcvideo bus-ID: 3-1.4:5
    chip-ID: 13d3:5125 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X: loaded: nvidia
    unloaded: fbdev,modesetting,nouveau,vesa alternate: nv gpu: nvidia display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.00x11.26") s-diag: 583mm (22.95")
  Monitor-1: LVDS-0 res: 1920x1080 hz: 60 dpi: 142 size: 344x193mm (13.54x7.6")
    diag: 394mm (15.53") modes: N/A
  API: OpenGL v: 4.6.0 NVIDIA 390.157 renderer: Quadro 1000M/PCIe/SSE2 direct-render: Yes
Audio:
  Device-1: Intel 6 Series/C200 Series Family High Definition Audio vendor: Hewlett-Packard 6
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1c20 class-ID: 0403
  Device-2: NVIDIA GF108 High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel
    v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0bea class-ID: 0403
  API: ALSA v: k6.1.0-20-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel 82579LM Gigabit Network vendor: Hewlett-Packard driver: e1000e v: kernel
    port: 5020 bus-ID: 00:19.0 chip-ID: 8086:1502 class-ID: 0200
  IF: eth0 state: down mac: <filter>
  Device-2: Intel Centrino Advanced-N 6205 [Taylor Peak] driver: iwlwifi v: kernel modules: wl
    pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 25:00.0 chip-ID: 8086:0085 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: HP Broadcom 2070 Bluetooth Combo type: USB driver: btusb v: 0.8 bus-ID: 3-1.6:6
    chip-ID: 03f0:231d class-ID: fe01
  Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 1.2 lmp-v: 2.1
    sub-v: 4203 hci-v: 2.1 rev: 132
  Info: acl-mtu: 1021:8 sco-mtu: 64:1 link-policy: rswitch hold sniff park
    link-mode: peripheral accept service-classes: rendering, capturing, audio, telephony
Drives:
  Local Storage: total: 1.16 TiB used: 582.04 GiB (48.8%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: Kingston model: SA400S37120G size: 111.79 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: B1D1 scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: HGST (Hitachi) model: HTS541010B7E610 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 scheme: MBR
  ID-3: /dev/sdc maj-min: 8:32 type: USB model: TO Exter nal USB 3.0 size: 149.05 GiB block-size:
    physical: 4096 B logical: 512 B type: N/A serial: <filter> rev: 0204 scheme: MBR
Partition:
  ID-1: / raw-size: 111.29 GiB size: 108.98 GiB (97.93%) used: 41.98 GiB (38.5%) fs: ext4
    dev: /dev/dm-0 maj-min: 253:0 mapped: luks-<filter>
  ID-2: /boot raw-size: 500 MiB size: 458.3 MiB (91.67%) used: 190.1 MiB (41.5%) fs: ext4
    dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 2.02 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 44.0 C mobo: N/A gpu: nvidia temp: 42 C
  Fan Speeds (RPM): N/A
Repos:
  Packages: 2752 pm: dpkg pkgs: 2743 libs: 1563 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 9
  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 bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb https://mirrors.netix.net/mx/MX-Packages/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/winehq-bookworm.sources
    1: deb [arch=amd64 i386] https://dl.winehq.org/wine-builds/debian bookworm main
Info:
  Processes: 282 Uptime: 8m wakeups: 1 Memory: 7.71 GiB used: 2.8 GiB (36.4%) Init: systemd v: 252
  target: graphical (5) default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: BIOS (legacy, CSM, MBR)

User avatar
dolphin_oracle
Developer
Posts: 22262
Joined: Sun Dec 16, 2007 12:17 pm

Re: Grub won't detect second MX Linux installation

#2 Post by dolphin_oracle »

if they are encrypted, you'll need to make sure they are unlocked before update-grub can see them.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

DR77
Posts: 103
Joined: Wed Oct 07, 2020 9:04 am

Re: Grub won't detect second MX Linux installation

#3 Post by DR77 »

I unlocked the partition with the root file system, but grup still won't detect it:

Code: Select all

$ sudo update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-20-amd64
Found initrd image: /boot/initrd.img-6.1.0-20-amd64
Found linux image: /boot/vmlinuz-6.1.0-17-amd64
Found initrd image: /boot/initrd.img-6.1.0-17-amd64
Found Windows 7 on /dev/sda1

Also, if the boot partition is not encrypted isn't that enough for grub to detect the installed OS?

Charlie Brown

Re: Grub won't detect second MX Linux installation

#4 Post by Charlie Brown »

What about the vice versa ?

If you do the same when booted to the other MX (after unlocking this one) does it detect this ?

And/or does "Chroot Rescue Scan" detect each other (again, when the other one is unlocked first) .. Just out of curiosity.

User avatar
dolphin_oracle
Developer
Posts: 22262
Joined: Sun Dec 16, 2007 12:17 pm

Re: Grub won't detect second MX Linux installation

#5 Post by dolphin_oracle »

DR77 wrote: Fri May 03, 2024 11:54 am I unlocked the partition with the root file system, but grup still won't detect it:

Code: Select all

$ sudo update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-20-amd64
Found initrd image: /boot/initrd.img-6.1.0-20-amd64
Found linux image: /boot/vmlinuz-6.1.0-17-amd64
Found initrd image: /boot/initrd.img-6.1.0-17-amd64
Found Windows 7 on /dev/sda1

Also, if the boot partition is not encrypted isn't that enough for grub to detect the installed OS?
oops, yes, probably. unless the boot partition wasn't separate, but an mx one would need to be.

dumb question...do you have 2 separate boot partitions?
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

DR77
Posts: 103
Joined: Wed Oct 07, 2020 9:04 am

Re: Grub won't detect second MX Linux installation

#6 Post by DR77 »

Yes, i have two separate boot partitions:

Code: Select all

$ lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                                             8:0    0 111.8G  0 disk  
├─sda1                                          8:1    0   500M  0 part  /boot
└─sda2                                          8:2    0 111.3G  0 part  
  └─luks-48c30bdc-1a0d-4e9a-a07d-463bbda238c3 253:0    0 111.3G  0 crypt /
sdb                                             8:16   0 931.5G  0 disk  
├─sdb1                                          8:17   0  79.1G  0 part  
├─sdb2                                          8:18   0     1K  0 part  
├─sdb3                                          8:19   0   600G  0 part  
│ └─data1                                     253:2    0   600G  0 crypt /media/data1
├─sdb5                                          8:21   0 232.7G  0 part  
│ └─data2                                     253:1    0 232.7G  0 crypt /media/data2
├─sdb6                                          8:22   0   500M  0 part  
└─sdb7                                          8:23   0  19.3G  0 part  
sda1 is the boot partition for MX Linux XFCE (sda2). sdb6 is the boot partition for MX Linux KDE (sdb7).

Chroot Rescue Scan detect each other if sda2 and sdb7 are unlocked and mounted, but grub won't detect them from either side even if they are unlocked and mounted.

DR77
Posts: 103
Joined: Wed Oct 07, 2020 9:04 am

Re: Grub won't detect second MX Linux installation

#7 Post by DR77 »

Could the issue be that both MX Linux installs have the same menu entry name?

Charlie Brown

Re: Grub won't detect second MX Linux installation

#8 Post by Charlie Brown »

Nope. At least the grub.cfg would show them with same entries but with different (their) uuids ...

Probably it's due to being on different disks and in fact that's not the first time bug about os-prober when distros are on different disks (not MX-specific).

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

Re: Grub won't detect second MX Linux installation

#9 Post by fehlix »

DR77 wrote: Sun May 05, 2024 2:42 am Could the issue be that both MX Linux installs have the same menu entry name?
The issues is related to os-prober, which is run by update-grub to detect grub's from other install.
The debug line below:

Code: Select all

os-prober: debug: running /usr/lib/os-probes/50mounted-tests on /dev/vdc5
50mounted-tests: debug: /dev/vdc5 is a LUKS partition; skipping
indicates os-prober will ignore checking other install on luks encrypted partition.
DR77 wrote: Fri May 03, 2024 11:54 am Also, if the boot partition is not encrypted isn't that enough for grub to detect the installed OS?
That is a legitimate question. But, the way os-prober works, it will first detect the linux install (on /-root)
and if found will next analyze /boot even on a another (not-encrypted) partition.
So, you are right, os-prober will ignore /boot partition if it cannot find/use a linux partition.

Now, we may "help" os-prober a bit, by manually adding a missing grub entry.
E.g. by running below script:

Code: Select all

sudo ./bootme /boot/grub/grub.cfg | tee bootme.cfg
It will generate a grub-menu stanca (bootme.cfg), which you can copy/append into/at a (new) file (/boot)/grub/custom.cfg
on the other boot-partition of the other installations.
The generated grub menuentry is done in a way that it should work on either UEFI or BIOS boot mode.

Here the script:

Code: Select all

#!/bin/sed -nrf
#
# bootme - create a custom menu entry to chainload this menu
#
# Usage:
#
# 		bootme /boot/grub/grub.cfg 
#
# copy/append the generated menuentry stanca
# to /boot/grub/custom.cfg 
#
# fehlix - May 2024
# mxlinux.org forum:
# https://forum.mxlinux.org/viewtopic.php?p=774865#p774865
#----------------------------------------------------------------------

\:### BEGIN /etc/grub.d/10_linux:,\:### END /etc/grub.d/10_linux: ! d

/^menuentry/,/^}/{
/^}/{p;q}
/echo/d
/gzio/d
/initrd/d
/load_video/d
/savedefault/d
/xxen/d
/menuentry/s/simple/grub-menu/
s/menuentry '/menuentry 'GRUB-Menu: /
/menuentry/{
s/^[[:space:]]+//
a	if [ "$grub_platform" == "efi" ]; then
a\
   insmod chain
a	else
a\
   insmod multiboot
a	fi
a	insmod configfile
}
s/^[[:space:]]+//
/^linux/{
h
	s/linux/if [ "${grub_platform}" == "efi" -a "${grub_cpu}" == "x86_64" -a -f /
	s:/vmlinuz.*:/grub/x86_64-efi/core.efi ]; then:
	p
x
h
	s/linux/    chainloader/
	s:/vmlinuz.*:/grub/x86_64-efi/core.efi:
	p
x
h
	s/linux/elif [ "${grub_platform}" == "efi" -a "${grub_cpu}" == "i386" -a -f /
	s:/vmlinuz.*:/grub/i386-efi/core.efi ]; then:
	p
x
h
	s/linux/   chainloader/
	s:/vmlinuz.*:/grub/i386-efi/core.efi:
	p
x
h
	s/linux/elif [ "${grub_platform}" == "pc" -a -f /
	s:/vmlinuz.*:/grub/i386-pc/core.img ]; then:
	p
x
h
	s/linux/   multiboot/
	s:/vmlinuz.*:/grub/i386-pc/core.img:
	p
i	else
x
h
	s/linux/   configfile/
	s:/vmlinuz.*:/grub/grub.cfg:
a	fi
}
p
	}
Also attached as bootme.zip:
You do not have the required permissions to view the files attached to this post.

Charlie Brown

Re: Grub won't detect second MX Linux installation

#10 Post by Charlie Brown »

Though this may not be related to this directly, I wonder if adding

Code: Select all

GRUB_ENABLE_CRYPTODISK=y
into

Code: Select all

/etc/default/grub
(and then updating grub) makes it possible ...

Post Reply

Return to “MX Help”