With a triple boot system on BIOS/Legacy disk, I tested a solution to avoid the Windows Boot Manager menu triggered by the Linux GRUB (see here) and make the Windows systems start directly from the GRUB without passing by WBM. I discovered that "a priori" the Windows systems needs the WBM and can not be started without (source). So I search a solution to make each system have its own WBM but I do not know how to achieve this. I searched from the web but I did not find some relevant informations.
Remind : I have a perfectly working virtual triple boot (in my case : Windows 10 Home 21H1/Windows 7 Pro/Debian 11) and I want to make GRUB run directly all the Windows systems without group them in one entry which run the Windows Boot Manager.
The workaround solution which worked for me (thanks to Tom Yan ; see bellow) was to reboot on the Linux system, change the partition's type of the first Windows partition to prevent the second Windows partition to see it (see how bellow), reboot, to fully reinstall the second Windows system (I reinstall because I did not find a solution to add a WBM on an installed system), power off, boot on a Live session (in my case, I used the Clonezilla tool) since the Linux system is unreachable from the WBM freshed installed, finalize in undoing the type modification on the first partition (see how bellow) and in a Linux chrooted environment, install and update grub to replace the bootloader of the MBR (see too how bellow).
Nota : I prepend on some commands with the assigning of LC_ALL=C (environment variable) because I am french and some return's outputs too, and I found this trick practical and elegant :)
To change the partition's type :
root@host:~# LC_ALL=C fdisk -l
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf1e6f539
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 42008575 42006528 20G 7 HPFS/NTFS/exFAT
/dev/sda2 * 42008576 71710719 29702144 14.2G 7 HPFS/NTFS/exFAT
/dev/sda3 71710720 83884031 12173312 5.8G 83 Linux
Disk /dev/sdb: 1 GiB, 1073741824 bytes, 2097152 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcdb5e72f
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2 2097119 2097118 1024M c W95 FAT32 (LBA)
root@host:~# LC_ALL=C fdisk /dev/sda
Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): t
Partition number (1-3, default 3): 1
Hex code or alias (type L to list all): L
00 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
01 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
02 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
03 XENIX usr 3c PartitionMagic 84 OS/2 hidden or c6 DRDOS/sec (FAT-
04 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
05 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
06 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
07 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
...
Hex code or alias (type L to list all): 83
Changed type of partition 'HPFS/NTFS/exFAT' to 'Linux'.
Command (m for help): p
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf1e6f539
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 42008575 42006528 20G 83 Linux
/dev/sda2 * 42008576 71710719 29702144 14.2G 7 HPFS/NTFS/exFAT
/dev/sda3 71710720 83884031 12173312 5.8G 83 Linux
Command (m for help): w
The partition table has been altered.
Syncing disks.
To undo type's modification from a Live session :
root@CZ-LIVE:~# LC_ALL=C fdisk /dev/sda
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): t
Partition number (1-3, default 3): 1
Hex code or alias (type L to list all): L
00 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
01 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
02 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
03 XENIX usr 3c PartitionMagic 84 OS/2 hidden or c6 DRDOS/sec (FAT-
04 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
05 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
06 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
07 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
...
Hex code or alias (type L to list all): 07
Changed type of partition 'Linux' to 'HPFS/NTFS/exFAT'.
Command (m for help): p
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf1e6f539
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 42008575 42006528 20G 7 HPFS/NTFS/exFAT
/dev/sda2 * 42008576 71710719 29702144 14,2G 7 HPFS/NTFS/exFAT
/dev/sda3 71710720 83884031 12173312 5,8G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
To install GRUB from a Linux chrooted environment of a Live session :
root@CZ-LIVE:~# lsblk -lo NAME,FSTYPE,LABEL,UUID
NAME FSTYPE LABEL UUID
sda
sda1 ntfs W10H 7A42F6E942F6A8D1
sda2 ntfs W7P 964843B148438EC5
sda3 ext4 a696a4ab-3120-4028-bd87-c2aaa40499bd
...
root@CZ-LIVE:~# mount /dev/sda3 /mnt/
root@CZ-LIVE:~# for f in /dev /proc /sys /run ; do mount -B $f /mnt$f ; done
root@CZ-LIVE:~# chroot /mnt/
root@CZ-LIVE:/# grub-install /dev/sda
Installation pour la plate-forme i386-pc.
Installation terminée, sans erreur.
root@CZ-LIVE:/# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.10.0-19-amd64
Found initrd image: /boot/initrd.img-5.10.0-19-amd64
Found linux image: /boot/vmlinuz-5.10.0-16-amd64
Found initrd image: /boot/initrd.img-5.10.0-16-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and
create new boot entries.
Found Windows on /dev/sda1
Found Windows on /dev/sda2
done
root@CZ-LIVE:/#
exit
root@CZ-LIVE:~# for f in /run /sys /proc /dev ; do umount -l /mnt$f ; done
Nota : we can see that update-grub found two Windows partitions.
From this point, we can see all the Windows system entries from the GRUB menu :
root@host:~# gawk '/^(menuentry|submenu)/ { printf '\
' gensub( /[^\x27]+\x27([^\x27]+)\x27.+/ , "\\1" , "g" ) ; '\
' uuid = gensub( '\
' /.+([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).*/ '\
' , "\\1" , "g" ) ; '\
' if ( uuid != $0 ) { printf " [" uuid "]" } printf "\n" }' \
/boot/grub/grub.cfg
Debian GNU/Linux [a696a4ab-3120-4028-bd87-c2aaa40499bd]
Advanced options for Debian GNU/Linux [a696a4ab-3120-4028-bd87-c2aaa40499bd]
Windows 7 Pro (on /dev/sda2)
Windows 10 Home (on /dev/sda1)
Nota : in this config I manually modified /boot/grub/grub.cfg to customize the title entries, because GRUB "a priori" has no solution to see the inner system editions ; furthermore it is not advised to modify here because is will be overwritten by the next update-grub, but rather we must modify from the /etc/grub.d/30_os-prober file
That's all the folks :D
For me this a big workaround solution as I suppose it is possible to add a WBM without affecting the data on a Windows partition and especially to not have to reinstall it. If I find a simpler way to achieve this or more automate it, I will complete this post. Maybe have you a better approach ?