Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 03/12/2020, à 16:39

Chanchris

(resolu)Impossible de démarrer sur Ubuntu

Bonjour,

Après plusieurs désagréments, j'ai du réinstaller ubuntu mate 20.04. J'ai du faire aussi un boot-repair en CD Live mais sans succès.
Le problème vient du Bios UEFI de mon PC. En effet, je modifie l'ordre de démarrage pour avoir Ubuntu en tête pour démarrer sur Grub. Mais cet ordre de démarrage n'est pas mémorisé malgré que je clique sur enregistrer et quitter. Dès que je sors du Bios, l'entrée Ubuntu est remise à sa position avant modification.
Le PC démarre alors sur la première entrée trouvée dans le Bios soit le CD soit Windows. Donc impossible de démarrer Ubuntu
A quoi celà est du ? Que faire ?

Merci de vos conseils.

Dernière modification par Chanchris (Le 19/12/2020, à 20:43)

Hors ligne

#2 Le 03/12/2020, à 17:52

lucmars

Re : (resolu)Impossible de démarrer sur Ubuntu

C'est un HP ton pc ?


Gaulois Matter !

Hors ligne

#3 Le 04/12/2020, à 18:46

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Oui c'est un HP PavilLion 500-365 NF

Hors ligne

#4 Le 04/12/2020, à 18:56

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Bonjour,

J'ai installé UBUNTU Mate 20.04.

Au démarrage du PC, si Ubuntu est bien en tête dans le Bios, j'ai un écran noir qui s'affiche avec une ligne "grub>" et du texte en anglais sur le haut qui donne les instructions pour entrer une commande.

Si je tape exit, au bout de quelques secondes, l'écran de boot GRUB s'affiche alors avec le choix du système à charger.

Malgré plusieurs "Boot repair" en session Live avec le CD, cet écran noir apparait toujours.
Si je fais un tour dans le bios au préalable, pas d'écran noir, le menu de boot s'affiche.
A quoi est-ce dû ? Comment supprimer cet écran noir ?

Mon PC est un HP Pavillions 500-365 NF avec bios UEFI et carte graphique Nvidia GeForce GT 705.
Ubuntu est installé avec pilotes NVIDIA.

Cordialement

Hors ligne

#5 Le 04/12/2020, à 19:10

lucmars

Re : (resolu)Impossible de démarrer sur Ubuntu

On se retrouve donc sur ton nouveau fil, c'est ça ?


Gaulois Matter !

Hors ligne

#6 Le 04/12/2020, à 19:16

lucmars

Re : (resolu)Impossible de démarrer sur Ubuntu

Depuis ton buntu installé fais-nous un boot-info (voir la doc).

Possible que ton disque ait un pète quelque part, on verra cela plus tard.


Gaulois Matter !

Hors ligne

#7 Le 05/12/2020, à 20:00

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Voici mon boot info :
https://paste.ubuntu.com/p/WfzXv7tz82/

A vous lire,

Hors ligne

#8 Le 05/12/2020, à 20:02

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Avec le problème du bios qui ne garde pas en mémoire la séquence de boot.

Hors ligne

#9 Le 05/12/2020, à 20:08

lucmars

Re : (resolu)Impossible de démarrer sur Ubuntu

Chanchris a écrit :

Avec le problème du bios qui ne garde pas en mémoire la séquence de boot.

Avec certain modèle HP c'est parfois le cas.


Gaulois Matter !

Hors ligne

#10 Le 05/12/2020, à 20:09

lucmars

Re : (resolu)Impossible de démarrer sur Ubuntu

le boot-info

boot-info-4ppa125                                              [20201205_1956]

============================== Boot Info Summary ===============================

 => No boot loader is installed in the MBR of /dev/sda.
 => No known boot loader is installed in the MBR of /dev/sdb.
 => Windows 7/8/2012 is installed in the MBR of /dev/sdc.
 => Syslinux MBR (5.00 and higher) is installed in the MBR of /dev/sdd.
 => Windows 7/8/2012 is installed in the MBR of /dev/sde.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda2: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Windows 8/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/Boot/bkpbootx64.efi /efi/Boot/bootx64.efi 
                       /efi/Boot/fbx64.efi /efi/Boot/grubx64.efi 
                       /efi/Boot/mmx64.efi /efi/ubuntu/grubx64.efi 
                       /efi/ubuntu/mmx64.efi /efi/ubuntu/shimx64.efi 
                       /efi/ubuntu/grub.cfg /efi/HP/BiosUpdate/CryptRSA.efi 
                       /efi/HP/BiosUpdate/HpBiosMgmt.efi 
                       /efi/HP/BiosUpdate/HpBiosUpdate.efi 
                       /efi/HP/SystemDiags/CryptRSA.efi 
                       /efi/HP/SystemDiags/HpSysDiags.efi 
                       /efi/HP/SystemDiags/SystemDiags.efi 
                       /efi/HP/SystemRecovery/bootmgfw.efi 
                       /efi/Microsoft/Boot/bootmgfw.efi 
                       /efi/Microsoft/Boot/bootmgr.efi 
                       /efi/Microsoft/Boot/memtest.efi

sda3: __________________________________________________________________________

    File system:       
    Boot sector type:  -
    Boot sector info: 

sda4: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  Windows 8 or 10
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda5: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda6: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda7: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sda8: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /boot/BCD

sdb1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdb2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdc1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdd1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sde1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sde2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 7/2008: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sde3: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /efi/BOOT/bkpbootx64.efi /efi/BOOT/bootx64.efi 
                       /efi/BOOT/fbx64.efi /efi/BOOT/grubx64.efi 
                       /efi/BOOT/mmx64.efi /efi/ubuntu/grubx64.efi 
                       /efi/ubuntu/mmx64.efi /efi/ubuntu/shimx64.efi 
                       /efi/ubuntu/grub.cfg

sde4: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Unknown
    Boot sector info: 

sde5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 20.04.1 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab /etc/default/grub


================================ 2 OS detected =================================

OS#1:   L'OS actuellement utilisé - Ubuntu 20.04.1 LTS CurrentSession on sde5
OS#2:   Windows 8 or 10 on sda4

============================ Architecture/Host Info ============================

CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.4.0-56-generic root=UUID=5ebca4e7-76dc-467c-84e0-c30018c305e9 ro quiet splash vt.handoff=7


===================================== UEFI =====================================

BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
SecureBoot disabled.

efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0002,0001,0004,0005
Boot0000* ubuntu	HD(2,GPT,08d37f28-6a60-4f72-a65c-a7f8b3566e98,0x200000,0xb4000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* USB Floppy/CD	VenMedia(b6fef66f-1495-4584-a836-3492d1984a8d,0500000001)..BO
Boot0002* USB Hard Drive	VenMedia(b6fef66f-1495-4584-a836-3492d1984a8d,0200000001)..BO
Boot0004* UEFI: IPv4 Realtek PCIe GBE Family Controller	PciRoot(0x0)/Pci(0x1c,0x6)/Pci(0x0,0x0)/MAC(2025647e4e11,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0005* UEFI: IPv6 Realtek PCIe GBE Family Controller	PciRoot(0x0)/Pci(0x1c,0x6)/Pci(0x0,0x0)/MAC(2025647e4e11,0)/IPv6([::]:<->[::]:,0,0)..BO

78415fb8fb9b909f8029858113f1335f   sda2/Boot/bkpbootx64.efi
78415fb8fb9b909f8029858113f1335f   sda2/Boot/bootx64.efi
2895d47544fd587b26c7e29be1295c27   sda2/Boot/fbx64.efi
e6b633dcac8b0c7cf5202f0198f852d8   sda2/Boot/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda2/Boot/mmx64.efi
8ed07d5ee4e5e1534bcf64037b7589ff   sda2/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sda2/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f   sda2/ubuntu/shimx64.efi
6488d391f74263c9da3c3d47dffa6212   sda2/HP/BiosUpdate/CryptRSA.efi
ae3a162786fc77b938d7745e4a869645   sda2/HP/BiosUpdate/HpBiosMgmt.efi
2343d8858faa0ade9385e4cb4dfaa72a   sda2/HP/BiosUpdate/HpBiosUpdate.efi
6488d391f74263c9da3c3d47dffa6212   sda2/HP/SystemDiags/CryptRSA.efi
3f500f5e1e620a24cb3b9593d637c56a   sda2/HP/SystemDiags/HpSysDiags.efi
96e954072e171b822af971b60902a1b5   sda2/HP/SystemDiags/SystemDiags.efi
bad97e7203aec2bd026403a7f70688b9   sda2/HP/SystemRecovery/bootmgfw.efi
8ee9a2af3728e3c77195e46920b6b329   sda2/Microsoft/Boot/bootmgfw.efi
ab7f511d143387e3f6d5b710fa567b08   sda2/Microsoft/Boot/bootmgr.efi
f7a57b08bc7c1c85417ae4cea582d1d4   sda8/ubuntu/shimx64.efi
7ac06cc534d41e22fdf5025a01a1bb8a   sda8/Boot/bootx64.efi
78415fb8fb9b909f8029858113f1335f   sde3/BOOT/bkpbootx64.efi
78415fb8fb9b909f8029858113f1335f   sde3/BOOT/bootx64.efi
2895d47544fd587b26c7e29be1295c27   sde3/BOOT/fbx64.efi
8ed07d5ee4e5e1534bcf64037b7589ff   sde3/BOOT/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sde3/BOOT/mmx64.efi
8ed07d5ee4e5e1534bcf64037b7589ff   sde3/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84   sde3/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f   sde3/ubuntu/shimx64.efi


============================= Drive/Partition Info =============================

Disks info: ____________________________________________________________________

sde	: notGPT,	no-BIOSboot,	has---ESP, 	not-usb,	not-mmc, has-os,	2048 sectors * 512 bytes
sda	: is-GPT,	no-BIOSboot,	has---ESP, 	not-usb,	not-mmc, has-os,	2048 sectors * 512 bytes
sdb	: notGPT,	no-BIOSboot,	has-noESP, 	not-usb,	not-mmc, no-os,	2048 sectors * 512 bytes
sdc	: notGPT,	no-BIOSboot,	has-noESP, 	not-usb,	not-mmc, no-os,	2048 sectors * 512 bytes
sdd	: notGPT,	no-BIOSboot,	has-noESP, 	usb-disk,	not-mmc, no-os,	2048 sectors * 512 bytes

Partitions info (1/3): _________________________________________________________

sde5	: is-os,	64, apt-get,	signed grub-efi ,	grub2,	grub-install,	grubenv-ok,	update-grub,	farbios
sda1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sda2	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sda4	: is-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sda5	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sda6	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sda7	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sda8	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sdb1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sdb2	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sdc1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sdd1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sde1	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far
sde2	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	farbios
sde3	: no-os,	32, nopakmgr,	no-docgrub,	nogrub,	nogrubinstall,	no-grubenv,	noupdategrub,	not-far

Partitions info (2/3): _________________________________________________________

sde5	: isnotESP,	fstab-has-goodEFI,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sda1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	recovery-or-hidden,	no-bmgr,	notwinboot
sda2	: is---ESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sda4	: isnotESP,	part-has-no-fstab,	no-nt,	haswinload,	no-recov-nor-hid,	bootmgr,	is-winboot
sda5	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	recovery-or-hidden,	no-bmgr,	notwinboot
sda6	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	recovery-or-hidden,	no-bmgr,	notwinboot
sda7	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sda8	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	recovery-or-hidden,	bootmgr,	is-winboot
sdb1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sdb2	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sdc1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sdd1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sde1	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sde2	: isnotESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot
sde3	: is---ESP,	part-has-no-fstab,	no-nt,	no-winload,	no-recov-nor-hid,	no-bmgr,	notwinboot

Partitions info (3/3): _________________________________________________________

sde5	: not-sepboot,	with-boot,	fstab-without-boot,	not-sep-usr,	with--usr,	fstab-without-usr,	customized,	sde
sda1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sda2	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sda4	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sda5	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sda6	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sda7	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sda8	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sda
sdb1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdb
sdb2	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdb
sdc1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdc
sdd1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sdd
sde1	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sde
sde2	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sde
sde3	: not-sepboot,	no-boot,	part-has-no-fstab,	not-sep-usr,	no---usr,	part-has-no-fstab,	std-grub.d,	sde

fdisk -l (filtered): ___________________________________________________________

Disk sda: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
Disk identifier: E46425B7-CA26-4F8D-8680-643A7AF7B547
           Start        End    Sectors   Size Type
sda1        2048    2097151    2095104  1023M Windows recovery environment
sda2     2097152    2834431     737280   360M EFI System
sda3     2834432    3096575     262144   128M Microsoft reserved
sda4     3096576 1932474919 1929378344   920G Microsoft basic data
sda5  1932476416 1933621247    1144832   559M Windows recovery environment
sda6  1933623296 1934544895     921600   450M Windows recovery environment
sda7  1934544896 3880144895 1945600000 927.8G Microsoft basic data
sda8  3880146944 3907018751   26871808  12.8G Microsoft basic data
Disk sdb: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk identifier: 0x24796452
      Boot  Start       End   Sectors   Size Id Type
sdb1         2048    321299    319252 155.9M  7 HPFS/NTFS/exFAT
sdb2       321754 625137879 624816126   298G  7 HPFS/NTFS/exFAT
Disk sdc: 1.84 TiB, 2000365289472 bytes, 3906963456 sectors
Disk identifier: 0x74a996e4
      Boot Start        End    Sectors  Size Id Type
sdc1        2048 3906959359 3906957312  1.8T  7 HPFS/NTFS/exFAT
Disk sdd: 931.53 GiB, 1000204883968 bytes, 1953525164 sectors
Disk identifier: 0x7917a222
      Boot Start        End    Sectors   Size Id Type
sdd1        2048 1953521663 1953519616 931.5G  7 HPFS/NTFS/exFAT
Disk sde: 298.9 GiB, 320072933376 bytes, 625142448 sectors
Disk identifier: 0x0dd788d5
      Boot     Start       End   Sectors   Size Id Type
sde1            2048 135601371 135599324  64.7G  7 HPFS/NTFS/exFAT
sde2       624087728 625138350   1050623   513M  7 HPFS/NTFS/exFAT
sde3  *    135602176 136652799   1050624   513M ef EFI (FAT-12/16/32)
sde4       136654846 624087039 487432194 232.4G  5 Extended
sde5       136654848 624087039 487432192 232.4G 83 Linux
Partition table entries are not in disk order.

parted -lm (filtered): _________________________________________________________

sda:2000GB:scsi:512:4096:gpt:ATA ST2000DM001-1ER1:;
1:1049kB:1074MB:1073MB:ntfs:Basic data partition:hidden, diag;
2:1074MB:1451MB:377MB:fat32:EFI system partition:boot, esp;
3:1451MB:1585MB:134MB::Microsoft reserved partition:msftres;
4:1585MB:989GB:988GB:ntfs:Basic data partition:msftdata;
5:989GB:990GB:586MB:ntfs::hidden, diag;
6:990GB:990GB:472MB:ntfs::hidden, diag;
7:990GB:1987GB:996GB:ntfs:Basic data partition:msftdata;
8:1987GB:2000GB:13.8GB:ntfs:Basic data partition:hidden, msftdata;
sdb:320GB:scsi:512:512:mac:Hitachi HTS543232L9A300:;
1:512B:1535B:1024B::partition map:;
2:154MB:165MB:10.5MB:hfs+:OneClick-Ready:;
sdc:2000GB:scsi:512:512:msdos:WD Elements 1078:;
1:1049kB:2000GB:2000GB:ntfs::;
sdd:1000GB:scsi:512:512:msdos:TOSHIBA External USB 3.0:;
1:1049kB:1000GB:1000GB:ntfs::;
sde:320GB:scsi:512:512:msdos:WD 3200BMV External:;
1:1049kB:69.4GB:69.4GB:ntfs::;
3:69.4GB:70.0GB:538MB:fat32::boot, esp;
4:70.0GB:320GB:250GB:::;
5:70.0GB:320GB:250GB:ext4::;
2:320GB:320GB:538MB:ntfs::;

blkid (filtered): ______________________________________________________________

NAME   FSTYPE   UUID                                 PARTUUID                             LABEL            PARTLABEL
sda                                                                                                        
├─sda1 ntfs     70F2A480F2A44C62                     e6aae55a-5f3c-4967-9491-db531e1adb4b Windows RE tools Basic data partition
├─sda2 vfat     62EC-7EFD                            08d37f28-6a60-4f72-a65c-a7f8b3566e98 SYSTEM           EFI system partition
├─sda3                                               2452efb4-b9b8-45d1-954c-a71b27c178b9                  Microsoft reserved partition
├─sda4 ntfs     3C88DA9288DA49D2                     120de5bf-303f-494a-bb69-42562f005699 Windows          Basic data partition
├─sda5 ntfs     5C58E9F658E9CF38                     d0d3b8b7-20a3-4b60-b04c-94da4f92c9e1                  
├─sda6 ntfs     54C42BFCC42BDF4C                     26366ccb-0bfc-4f9a-800a-8a7fce8922ae                  
├─sda7 ntfs     502ED4042ED3E0D0                     6c23c468-97e1-48eb-959b-8fb2311f64d2 Documents        Basic data partition
└─sda8 ntfs     32849D15849CDCA3                     b2f25b51-a705-4f78-9298-42ac76a8a952 Recovery Image   Basic data partition
sdb                                                                                                        
├─sdb1 ntfs     0E8E14ED0E8E14ED                     24796452-01                          i                
└─sdb2 ntfs     9842511F42510402                     24796452-02                          LaCie            
sdc                                                                                                        
└─sdc1 ntfs     E60CC40C0CC3D629                     74a996e4-01                                           
sdd                                                                                                        
└─sdd1 ntfs     0E9C0E220E9C0E22                     7917a222-01                                           
sde                                                                                                        
├─sde1 ntfs     0E2C166D0E2C166D                     0dd788d5-01                          j                
├─sde2 ntfs     0E8F1BAA0E8F1BAA                     0dd788d5-02                          L                
├─sde3 vfat     3DA0-B822                            0dd788d5-03                                           
├─sde4                                               0dd788d5-04                                           
└─sde5 ext4     5ebca4e7-76dc-467c-84e0-c30018c305e9 0dd788d5-05                                           

df (filtered): _________________________________________________________________

                    Avail Use% Mounted on
sda1               663.9M  35% /mnt/boot-sav/sda1
sda2               235.1M  34% /mnt/boot-sav/sda2
sda4               769.2G  16% /mnt/boot-sav/sda4
sda5                96.3M  83% /mnt/boot-sav/sda5
sda6               437.8M   3% /mnt/boot-sav/sda6
sda7               592.1G  36% /mnt/boot-sav/sda7
sda8                 1.6G  87% /mnt/boot-sav/sda8
sdb1                 145M   7% /media/christian/i
sdb2               216.4G  27% /media/christian/LaCie
sdc1              1022.8G  45% /media/christian/E60CC40C0CC3D629
sdd1               931.4G   0% /media/christian/0E9C0E220E9C0E22
sde1                64.6G   0% /media/christian/j
sde2               502.2M   2% /media/christian/L
sde3               501.3M   2% /mnt/boot-sav/sde3
sde5               205.1G   5% /

Mount options: __________________________________________________________________

sda1              ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda2              rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sda4              ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5              ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda6              ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda7              ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda8              ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sdb1              rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other
sdb2              rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other
sdc1              rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
sdd1              rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
sde1              rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
sde2              rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=1024
sde3              rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sde5              rw,relatime,errors=remount-ro

===================== sda2/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid 5ebca4e7-76dc-467c-84e0-c30018c305e9 root hd4,msdos5 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

===================== sde3/efi/ubuntu/grub.cfg (filtered) ======================

search.fs_uuid 5ebca4e7-76dc-467c-84e0-c30018c305e9 root hd4,msdos5 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

====================== sde5/boot/grub/grub.cfg (filtered) ======================

Windows Boot Manager (sur sda2)   osprober-efi-62EC-7EFD
### END /etc/grub.d/30_os-prober_proxy ###
Ubuntu   5ebca4e7-76dc-467c-84e0-c30018c305e9
Ubuntu, avec Linux 5.4.0-56-generic   5ebca4e7-76dc-467c-84e0-c30018c305e9
Ubuntu, avec Linux 5.4.0-26-generic   5ebca4e7-76dc-467c-84e0-c30018c305e9
UEFI Firmware Settings   uefi-firmware

========================== sde5/etc/fstab (filtered) ===========================

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sde5 during installation
UUID=5ebca4e7-76dc-467c-84e0-c30018c305e9 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
/swapfile                                 none            swap    sw              0       0
UUID=3DA0-B822  /boot/efi       vfat    defaults      0       1

======================= sde5/etc/default/grub (filtered) =======================

GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
export GRUB_COLOR_NORMAL="light-gray/black"
export GRUB_COLOR_HIGHLIGHT="black/black"
export GRUB_MENU_PICTURE="/boot/grub/fonts/50389332531_6af06d4c7a_k2.jpg"
GRUB_FONT="/boot/grub/unicode.pf2"
==================== sde5: Location of files loaded by Grub ====================

           GiB - GB             File                                 Fragment(s)
 217,346393585 = 233,373913088  boot/grub/grub.cfg                             2
  72,337051392 = 77,671317504   boot/vmlinuz                                   1
  69,063591003 = 74,156466176   boot/vmlinuz-5.4.0-26-generic                  1
  72,337051392 = 77,671317504   boot/vmlinuz-5.4.0-56-generic                  1
  69,063591003 = 74,156466176   boot/vmlinuz.old                               1
 100,021270752 = 107,397021696  boot/initrd.img                                1
  72,962608337 = 78,343004160   boot/initrd.img-5.4.0-26-generic               2
 100,021270752 = 107,397021696  boot/initrd.img-5.4.0-56-generic               1
  72,962608337 = 78,343004160   boot/initrd.img.old                            2

===================== sde5: ls -l /etc/grub.d/ (filtered) ======================

-rwxr-xr-x 1 root root   702 déc.   5 13:10 10_linux_proxy
-rwxr-xr-x 1 root root   198 déc.   5 13:10 30_os-prober_proxy
-rwxr-xr-x 1 root root   702 déc.   5 13:10 31_linux_proxy
-rwxr-xr-x 1 root root 42359 nov.  13 00:15 32_linux_zfs
-rwxr-xr-x 1 root root 12894 nov.  13 00:15 33_linux_xen
-rwxr-xr-x 1 root root   198 déc.   5 13:10 34_os-prober_proxy
-rwxr-xr-x 1 root root  1424 nov.  13 00:15 35_uefi-firmware
-rwxr-xr-x 1 root root   214 nov.  13 00:15 40_custom
-rwxr-xr-x 1 root root   216 nov.  13 00:15 41_custom
drwxr-xr-x 4 root root  4096 déc.   4 15:25 backup
drwxr-xr-x 2 root root  4096 déc.   4 15:25 bin
drwxr-xr-x 2 root root  4096 déc.   5 13:10 proxifiedScripts

======================== sde5/etc/grub.d/31_linux_proxy ========================

#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/linux' | /etc/grub.d/bin/grubcfg_proxy "+'Ubuntu'~af5321d8acaba351d099bc3788a12449~
-*
-#text
+'SUBMENU' as 'Options avancées pour Ubuntu'{+'Options avancées pour Ubuntu'/*, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.4.0-56-generic'~7fa99cb64cf0d02e6016a1c0a27c93b4~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.4.0-56-generic (recovery mode)'~954af5bd59d353d87f1365a382815786~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.4.0-26-generic'~c31f6d66077511bf379ee7ae0b726f2d~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.4.0-26-generic (recovery mode)'~b8dc5efecca0a6678f5f7029f96943ef~}
"

========================= sde5/etc/grub.d/32_linux_zfs =========================

#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2019 Canonical Ltd.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
datarootdir="/usr/share"
ubuntu_recovery="1"
quiet_boot="1"
quick_boot="1"
gfxpayload_dynamic="1"
vt_handoff="1"
. "${pkgdatadir}/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
set -u
## Skip early if zfs utils isn't installed (instead of failing on first zpool list)
if ! `which zfs >/dev/null 2>&1`; then
    exit 0
fi
imported_pools=""
MNTDIR="$(mktemp -d ${TMPDIR:-/tmp}/zfsmnt.XXXXXX)"
ZFSTMP="$(mktemp -d ${TMPDIR:-/tmp}/zfstmp.XXXXXX)"
machine="$(uname -m)"
case "${machine}" in
    i?86) GENKERNEL_ARCH="x86" ;;
    mips|mips64) GENKERNEL_ARCH="mips" ;;
    mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
    arm*) GENKERNEL_ARCH="arm" ;;
    *) GENKERNEL_ARCH="${machine}" ;;
esac
RC=0
on_exit() {
    # Restore initial zpool import state
    for pool in ${imported_pools}; do
        zpool export "${pool}"
    done
    mountpoint -q "${MNTDIR}"  && umount "${MNTDIR}" || true
    rmdir "${MNTDIR}"
    rm -rf "${ZFSTMP}"
    exit "${RC}"
}
trap on_exit EXIT INT QUIT ABRT PIPE TERM
# List ONLINE and DEGRADED pools
import_pools() {
    # We have to ignore zpool import output, as potentially multiple / will be available,
    # and we need to autodetect all zpools this way with their real mountpoints.
    local initial_pools="$(zpool list | awk '{if (NR>1) print $1}')"
    local all_pools=""
    local imported_pools=""
    local err=""
    set +e
    err="$(zpool import -f -a -o cachefile=none -o readonly=on -N 2>&1)"
    # Only print stderr if the command returned an error
    # (it can echo "No zpool to import" with success, which we don't want)
    if [ $? -ne 0 ]; then
        echo "Some pools couldn't be imported and will be ignored:\n${err}" >&2
    fi
    set -e
    all_pools="$(zpool list | awk '{if (NR>1) print $1}')"
    for pool in ${all_pools}; do
        if echo "${initial_pools}" | grep -wq "${pool}"; then
            continue
        fi
        imported_pools="${imported_pools} ${pool}"
    done
    echo "${imported_pools}"
}
# List all the dataset with a root mountpoint
get_root_datasets() {
    local pools="$(zpool list | awk '{if (NR>1) print $1}')"
    for p in ${pools}; do
        local rel_pool_root=$(zpool get -H altroot ${p} | awk '{print $3}')
        if [ "${rel_pool_root}" = "-" ]; then
            rel_pool_root="/"
        fi
        zfs list -H -o name,canmount,mountpoint -t filesystem | grep -E '^'"${p}"'(\s|/[[:print:]]*\s)(on|noauto)\s'"${rel_pool_root}"'$' | awk '{print $1}'
    done
}
# find if given datasets can be mounted for directory and return its path (snapshot or real path)
# $1 is our current dataset name
# $2 directory path we look for (cannot contains /)
# $3 is the temporary mount directory to use
# $4 is the optional snapshot name
# return path for directory (which can be a mountpoint)
validate_system_dataset() {
    local dataset="$1"
    local directory="$2"
    local mntdir="$3"
    local snapshot_name="$4"
    local mount_path="${mntdir}/${directory}"
    if ! zfs list "${dataset}" >/dev/null 2>&1; then
        return
    fi
    if ! mount -o noatime,zfsutil -t zfs "${dataset}" "${mount_path}"; then
        grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset}@${snapshot_name}'. Ignoring"
        return
    fi
    local candidate_path="${mount_path}"
    if [ -n "${snapshot_name}" ]; then
        # WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
        # Reading the content of a snapshot fails if it is not the first mount
        # for a given dataset
        first_mntdir=$(awk '{if ($1 == "'${dataset}'") {print $2; exit;}}' /proc/mounts)
        if [ "${first_mntdir}" = "/" ]; then
            # prevents // on candidate_path
            first_mntdir=""
        fi
        candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}"
    fi
    if [ -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
        echo "${candidate_path}"
        return
    else
        mountpoint -q "${mount_path}" && umount "${mount_path}" || true
    fi
}
# Detect system directory relevant to the other, trying to find the ones associated on the current dataset or snapshot/
# System directory should be at most a direct child dataset of main datasets (no recursivity)
# We can fallback trying other zfs pools if no match has been found.
# $1 is our current dataset name (which can have @snapshot name)
# $2 directory path we look for (cannot contains /)
# $3 restrict_to_same_pool (true|false) force looking for dataset with the same basename in the current dataset pool only
# $4 is the temporary mount directory to use
# $5 is the optional etc directory (if not $2 is not etc itself)
# return path for directory (which can be a mountpoint)
get_system_directory() {
    local dataset_path="$1"
    local directory="$2"
    local restrict_to_same_pool="$3"
    local mntdir="$4"
    local etc_dir="$5"
    if [ -z "${etc_dir}" ]; then
        etc_dir="${mntdir}/etc"
    fi
    local candidate_path="${mntdir}/${directory}"
    # 1. Look for /etc/fstab first (which will mount even on top of non empty $directory)
    local mounted_fstab_entry="false"
    if [ -f "${etc_dir}/fstab" ]; then
        mount_args=$(awk '/^[^#].*[ \t]\/'"${directory}"'[ \t]/ {print "-t", $3, $1}' "${etc_dir}/fstab")
        if [ -n "${mount_args}" ]; then
            mounted_fstab_entry="true"
            mount -o noatime ${mount_args} "${candidate_path}" || mounted_fstab_entry="false"
        fi
    fi
    # If directory isn't empty. Only count if coming from /etc/fstab. Will be
    # handled below otherwise as we are interested in potential snapshots.
    if [ "${mounted_fstab_entry}" = "true" -a -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
        echo "${candidate_path}"
        return
    fi
    # 2. Handle zfs case, which can be a snapshots.
    local base_dataset_path="${dataset_path}"
    local snapshot_name=""
    # For snapshots we extract the parent dataset
    if echo "${dataset_path}" | grep -q '@'; then
        base_dataset_path=$(echo "${dataset_path}" | cut -d '@' -f1)
        snapshot_name=$(echo "${dataset_path}" | cut -d '@' -f2)
    fi
    base_dataset_name="${base_dataset_path##*/}"
    base_pool="$(echo "${base_dataset_path}" | cut -d'/' -f1)"
    # 2.a) Look for child dataset included in base dataset, which needs to hold same snapshot if any
    candidate_path=$(validate_system_dataset "${base_dataset_path}/${directory}" "${directory}" "${mntdir}" "${snapshot_name}")
    if [ -n "${candidate_path}" ]; then
        echo "${candidate_path}"
        return
    fi
    # 2.b) Look for current dataset (which is already mounted as /)
    candidate_path="${mntdir}/${directory}"
    if [ -n "${snapshot_name}" ]; then
        # WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
        # Reading the content of a snapshot fails if it is not the first mount
        # for a given dataset
        first_mntdir=$(awk '{if ($1 == "'${base_dataset_path}'") {print $2; exit;}}' /proc/mounts)
        if [ "${first_mntdir}" = "/" ]; then
            # prevents // on candidate_path
            first_mntdir=""
        fi
        candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}/${directory}"
    fi
    if [ -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
        echo "${candidate_path}"
        return
    fi
    # 2.c) Look for every datasets in every pool which isn't the current dataset which holds:
    # - the same dataset name (last section) than our base_dataset_name
    # - mountpoint=directory
    # - canmount!=off
    all_same_base_dataset_name="$(zfs list -H -t filesystem -o name,canmount | awk '/^[^ ]+\/'"${base_dataset_name}"'[ \t](on|noauto)/ {print $1}') "
    # order by local pool datasets first
    current_pool_same_base_datasets=""
    other_pools_same_base_datasets=""
    root_pool=$(echo "${dataset_path%%/*}")
    for d in ${all_same_base_dataset_name}; do
        cur_dataset_pool=$(echo "${d%%/*}")
        if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
            current_pool_same_base_datasets="${current_pool_same_base_datasets} ${d}"
        else
            other_pools_same_base_datasets="${other_pools_same_base_datasets} ${d}"
        fi
    done
    ordered_same_base_datasets="${current_pool_same_base_datasets} ${other_pools_same_base_datasets}"
    if [ "${restrict_to_same_pool}" = "true" ]; then
        ordered_same_base_datasets="${current_pool_same_base_datasets}"
    fi
    # now, loop over them
    for d in ${ordered_same_base_datasets}; do
        cur_dataset_pool=$(echo "${d%%/*}")
        rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
        if [ "${rel_pool_root}" = "-" ]; then
            rel_pool_root=""
        fi
        # check mountpoint match
        candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
        if [ -z "${candidate_dataset}" ]; then
            continue
        fi
        candidate_path=$(validate_system_dataset "${candidate_dataset}" "${directory}" "${mntdir}" "${snapshot_name}")
        if [ -n "${candidate_path}" ]; then
            echo "${candidate_path}"
            return
        fi
    done
    # 2.d) If we didn't find anything yet: check for persistent datasets corresponding to our mountpoint, with canmount=on without any snapshot associated:
    # Note: we go over previous datasets as well, but this is ok, as we didn't include them before.
    all_mountable_datasets="$(zfs list -t filesystem -o name,canmount | awk  '/^[^ ]+[ \t]+on/ {print $1}')"
    # order by local pool datasets first
    current_pool_datasets=""
    other_pools_datasets=""
    root_pool=$(echo "${dataset_path%%/*}")
    for d in ${all_mountable_datasets}; do
        cur_dataset_pool=$(echo "${d%%/*}")
        if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
            current_pool_datasets="${current_pool_datasets} ${d}"
        else
            other_pools_datasets="${other_pools_datasets} ${d}"
        fi
    done
    ordered_datasets="${current_pool_datasets} ${other_pools_datasets}"
    if [ "${restrict_to_same_pool}" = "true" ]; then
        ordered_datasets="${current_pool_datasets}"
    fi
    for d in ${ordered_datasets}; do
        cur_dataset_pool=$(echo "${d%%/*}")
        rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
        if [ "${rel_pool_root}" = "-" ]; then
            rel_pool_root=""
        fi
        # check mountpoint match
        candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
        if [ -z "${candidate_dataset}" ]; then
            continue
        fi
        candidate_path=$(validate_system_dataset "${d}" "${directory}" "${mntdir}" "")
        if [ -n "${candidate_path}" ]; then
            echo "${candidate_path}"
            return
        fi
    done
    grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset_path}'. Ignoring"
    return
}
# Try our default layout bpool as a prefered layout (fast path)
# This is get_system_directory for boot optimized for our default installation layout
# $1 is our current dataset name (which can have @snapshot name)
# $2 is the temporary mount directory to use
# return path for directory (which can be a mountpoint) if found
try_default_layout_bpool() {
    local root_dataset_path="$1"
    local mntdir="$2"
    dataset_basename="${root_dataset_path##*/}"
    candidate_dataset="bpool/BOOT/${dataset_basename}"
    dataset_properties="$(zfs get -H mountpoint,canmount ${candidate_dataset} | cut -f3 | paste -sd ' ')"
    if [ -z "${dataset_properties}" ]; then
        return
    fi
    rel_pool_root=$(zpool get -H altroot bpool | awk '{print $3}')
    if [ "${rel_pool_root}" = "-" ]; then
        rel_pool_root=""
    fi
    snapshot_name="${dataset_basename##*@}"
    [ "${snapshot_name}" = "${dataset_basename}" ] && snapshot_name=""
    if [ -z "${snapshot_name}" ]; then
        if ! echo "${dataset_properties}" | grep -Eq "${rel_pool_root}/boot (on|noauto)"; then
            return
        fi
    else
        candidate_dataset=$(echo "${candidate_dataset}" | cut -d '@' -f1)
    fi
    validate_system_dataset "${candidate_dataset}" "boot" "${mntdir}" "${snapshot_name}"
}
# Return if secure boot is enabled on that system
is_secure_boot_enabled() {
    if LANG=C mokutil --sb-state 2>/dev/null | grep -qi enabled; then
        echo "true"
        return
    fi
    echo "false"
    return
}
# Given a filesystem or snapshot dataset, returns dataset|machine id|pretty name|last used
# $1 is dataset we want information from
# $2 is the temporary mount directory to use
get_dataset_info() {
    local dataset="$1"
    local mntdir="$2"
    local base_dataset="${dataset}"
    local etc_dir="${mntdir}/etc"
    local is_snapshot="false"
    # For snapshot we extract the parent dataset
    if echo "${dataset}" | grep -q '@'; then
        base_dataset=$(echo "${dataset}" | cut -d '@' -f1)
        is_snapshot="true"
    fi
    mount -o noatime,zfsutil -t zfs "${base_dataset}" "${mntdir}"
    # read machine-id/os-release from /etc
    etc_dir=$(get_system_directory "${dataset}" "etc" "true" "${mntdir}" "")
    if [ -z  "${etc_dir}" ]; then
        grub_warn "Ignoring ${dataset}"
        mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
        umount "${mntdir}"
        return
    fi
    machine_id=""
    if [ -f "${etc_dir}/machine-id" ]; then
        machine_id=$(cat "${etc_dir}/machine-id")
    fi
    # We have to use a random temporary id if we don't have any machine-id file or if this one is empty
    # (mostly the case of new installations before first boot).
    # Let's use the dataset name directly for this.
    # Consequence is that all datasets are then separated.
    if [ -z "${machine_id}" ]; then
        machine_id="${dataset}"
    fi
    pretty_name=$(. "${etc_dir}/os-release" && echo "${PRETTY_NAME}")
    mountpoint -q "${mntdir}/etc" && umount "${mntdir}/etc" || true
    # read available kernels from /boot
    boot_dir="$(try_default_layout_bpool "${dataset}" "${mntdir}")"
    if [ -z "${boot_dir}" ]; then
        boot_dir=$(get_system_directory "${dataset}" "boot" "false" "${mntdir}" "${etc_dir}")
    fi
    if [ -z  "${boot_dir}" ]; then
        grub_warn "Ignoring ${dataset}"
        mountpoint -q "${mntdir}/boot" && umount "${mntdir}/boot" || true
        umount "${mntdir}"
        return
    fi
    initrd_list=""
    kernel_list=""
    list=$(find "${boot_dir}" -maxdepth 1 -type f -regex '.*/\(vmlinuz\|vmlinux\|kernel\)-.*')
    while [ "x$list" != "x" ] ; do
        linux=`version_find_latest $list`
        list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
        if ! grub_file_is_not_garbage "${linux}" ; then
            continue
        fi
        # Filters entry if efi/non efi.
        # Note that for now we allow kernel without .efi.signed as those are signed kernel
        # on ubuntu, loaded by the shim.
        case "${linux}" in
            *.efi.signed)
                if [ "$(is_secure_boot_enabled)" = "false" ]; then
                    continue
                fi
            ;;
        esac
        linux_basename=$(basename "${linux}")
        linux_dirname=$(dirname "${linux}")
        version=$(echo "${linux_basename}" | sed -e "s,^[^0-9]*-,,g")
        alt_version=$(echo "${version}" | sed -e "s,\.old$,,g")
        gettext_printf "Found linux image: %s in %s\n" "${linux_basename}" "${dataset}" >&2
        initrd=""
        for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
            "initrd-${version}" "initramfs-${version}.img" \
            "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
            "initrd-${alt_version}" "initramfs-${alt_version}.img" \
            "initramfs-genkernel-${version}" \
            "initramfs-genkernel-${alt_version}" \
            "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
            "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
            if test -e "${linux_dirname}/${i}" ; then
                initrd="$i"
                break
            fi
        done
        if test -z "${initrd}" ; then
            grub_warn "Couldn't find any valid initrd for dataset ${dataset}."
            continue
        fi
        gettext_printf "Found initrd image: %s in %s\n" "${initrd}" "${dataset}" >&2
        rel_linux_dirname=$(make_system_path_relative_to_its_root "${linux_dirname}")
        initrd_list="${initrd_list}|${rel_linux_dirname}/${initrd}"
        kernel_list="${kernel_list}|${rel_linux_dirname}/${linux_basename}"
    done
    initrd_list="${initrd_list#|}"
    kernel_list="${kernel_list#|}"
    initrd_device=$(${grub_probe} --target=device "${boot_dir}" | head -1)
    mountpoint -q "${mntdir}/boot" && umount "${mntdir}/boot" || true
    # We needed to look in / for snapshots on root dataset, umount there before zfs lazily unmount it
    case "${boot_dir}" in /boot/.zfs/snapshot/*)
        umount "${boot_dir}" || true
        ;;
    esac
    # for zsys snapshots: we want to know which kernel we successful last booted with
    last_booted_kernel=$(zfs get -H com.ubuntu.zsys:last-booted-kernel "${dataset}" | awk '{print $3}')
    # snapshot: last_used is dataset creation time
    if [ "${is_snapshot}" = "true" ]; then
        last_used="$(zfs get -pH creation "${dataset}" | awk -F '\t' '{print $3}')"
    # otherwise, last_used is manually marked at boot/shutdown on a root dataset for zsys
    else
        # if current system, take current time
        if zfs mount | awk '/[ \t]+\/$/ {print $1}' | grep -q ${dataset}; then
            last_used=$(date +%s)
        else
            last_used=$(zfs get -H com.ubuntu.zsys:last-used "${dataset}" | awk '{print $3}')
            # case of non zsys, or zsys without annotation, take /etc/machine-id stat (as we mounted with noatime).
            # However, as systems can be relatime, if system is current mounted one, set current time (case of clone + reboot
            # within the same d).
            if [ "${last_used}" = "-" ]; then
                last_used=$(stat --printf="%X" "${mntdir}/etc/os-release")
                if [ -f "${mntdir}/etc/machine-id" ]; then
                    last_used=$(stat --printf="%X" "${mntdir}/etc/machine-id")
                fi
            fi
        fi
    fi
    is_zsys=$(zfs get -H com.ubuntu.zsys:bootfs "${base_dataset}" | awk '{print $3}')
    if [ -n "${initrd_list}" -a -n "${kernel_list}" ]; then
        echo "${dataset}\t${is_zsys}\t${machine_id}\t${pretty_name}\t${last_used}\t${initrd_device}\t${initrd_list}\t${kernel_list}\t${last_booted_kernel}"
    else
        grub_warn "didn't find any valid initrd or kernel."
    fi
    umount "${mntdir}" || true
    # We needed to look in / for snapshots on root dataset, umount the snapshot for etc before zfs lazily unmount it
    case "${etc_dir}" in /.zfs/snapshot/*/etc)
        snapshot_path="$(findmnt -n -o TARGET -T ${etc_dir})"
        umount "${snapshot_path}" || true
        ;;
    esac
}
# Scan available boot options and returns in a formatted list
# $1 is the temporary mount directory to use
bootlist() {
    local mntdir="$1"
    local boot_list=""
    for dataset in $(get_root_datasets); do
        # get information from current root dataset
        boot_list="${boot_list}$(get_dataset_info ${dataset} ${mntdir})\n"
        # get information from snapshots of this root dataset
        for snapshot_dataset in $(zfs list -H -o name -t snapshot "${dataset}"); do
            boot_list="${boot_list}$(get_dataset_info ${snapshot_dataset} ${mntdir})\n"
        done
    done
    echo "${boot_list}"
}
# Order machine ids by last_used from their main entry
get_machines_sorted() {
    local bootlist="$1"
    local machineids="$(echo "${bootlist}" | awk '{print $3}' | sort -u)"
    for machineid in ${machineids}; do
        echo "${bootlist}" | awk 'BEGIN{FS="\t"} $1 !~ /.*@.*/  {print $5, $3}' | sort -nr | grep -E "[^^]\b${machineid}\b" | head -1
    done | sort -nr | awk '{print $2}'
}
# Sort entries by last_used for a given machineid
sort_entries_for_machineid() {
    local bootlist="$1"
    local machineid="$2"
    tab="$(printf '\t')"
    echo "${bootlist}" | grep -E "[^^]\b${machineid}\b" | sort -k5,5r -k1,1 -t "${tab}"
}
# Return main entry index
get_main_entry() {
    local entries="$1"
    echo "${entries}" | awk 'BEGIN{FS="\t"} $1 !~ /.*@.*/  {print}' | head -1
}
# Return specific field at index from entry
get_field_from_entry() {
    local entry="$1"
    local index="$2"
    echo "${entry}" | awk "BEGIN{FS=\"\t\"} {print \$$index}"
}
# Get the main entry metadata
main_entry_meta() {
    local main_entry="$1"
    initrd=$(get_field_from_entry "${main_entry}" 7 | cut -d'|' -f1)
    kernel=$(get_field_from_entry "${main_entry}" 8 | cut -d'|' -f1)
    # Take first element (most recent entry) which is not a snapshot
    echo "${main_entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"} {print \$3, \$2, \"main\", \$4, \$1, \$6, \"$initrd\", \"$kernel\"}"
}
# Get advanced entries metadata
advanced_entries_meta() {
    local main_entry="$1"
    last_used_kernel="$(get_field_from_entry "${main_entry}" 9 )"
    # We must align initrds with kernels.
    # Adds initrds to the stack then pop them 1 by 1 as we process the kernels
    set -- $(get_field_from_entry "${main_entry}" 7 | tr "|" " ")
    for kernel in $(get_field_from_entry "${main_entry}" 8 | tr "|" " "); do
        # get initrd and pop to the next one
        initrd="$1"; shift
        was_last_used_kernel="false"
        kernel_basename=$(basename "${kernel}")
        if [ "${kernel_basename}" = "${last_used_kernel}" ]; then
            was_last_used_kernel="true"
        fi
        echo "${main_entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"}    {print \$3, \$2, \"advanced\", \$4, \$1, \$6, \"$initrd\", \"$kernel\", \"$was_last_used_kernel\"}"
    done
}
# Get history metadata
history_entries_meta() {
    local entries="$1"
    local main_dataset_name="$2"
    local main_dataset_releasename="$3"
    if [ -z "${entries}" ]; then
        return
    fi
    # Traverse snapshots and clones
    echo "${entries}" | while read entry; do
        name=""
        # Compute snapshot/filesystem dataset name
        snap_dataset_name="$(get_field_from_entry "${entry}" 1)"
        snapname="${snap_dataset_name##*@}"
        # If, this is a clone, take what is after main_dataset_name
        if [ "${snapname}" = "${snap_dataset_name}" ]; then
            snapname="${snap_dataset_name##${main_dataset_name}_}"
            # Handle manual user clone (not prefixed by "main_dataset_name")
            snapname="${snapname##*/}"
        fi
        # We keep the snapname only if it is not only a zsys auto snapshot
        if echo "${snapname}" | grep -q "^autozsys_"; then
            snapname=""
        fi
        # We store the release only if it different from main dataset release (snapshot before a release upgrade)
        releasename=$(get_field_from_entry "${entry}" 4)
        if [ "${releasename}" = "${main_dataset_releasename}" ]; then
            releasename=""
        fi
        # Snapshot date
        foo="$(get_field_from_entry "${entry}" 5)"
        snapdate="$(date -d @$(get_field_from_entry "${entry}" 5) "+%x @ %H:%M")"
        # For snapshots/clones the name can have the following formats:
        # 	<DATE>: autozsys, same release
        #   <OLD_RELEASE> on <DATE>: autozsys, different release
        #   <SNAPNAME> on <DATE>: Manual snapshot, same release
        #   <SNAPNAME>, <OLD_RELEASE> on <DATE>: Manual snapshot, different release
        if [ "${snapname}" = "" -a "${releasename}" = "" ]; then
            name="${snapdate}"
        elif [ "${snapname}" = "" -a "${releasename}" != "" ]; then
            name=$(gettext_printf "%s on %s" "${releasename}" "${snapdate}")
        elif [ "${snapname}" != "" -a "${releasename}" = "" ]; then
            name=$(gettext_printf "%s on %s" "${snapname}" "${snapdate}")
        else # snapname != "" && releasename != ""
            name=$(gettext_printf "%s, %s on %s" "${snapname}" "${releasename}" "${snapdate}")
        fi
        # Choose kernel and initrd if the snapshot was booted successfully on a specific kernel before
        # Take latest by default if no match
        initrd=$(get_field_from_entry "${entry}" 7 | cut -d'|' -f1)
        kernel=$(get_field_from_entry "${entry}" 8 | cut -d'|' -f1)
        last_used_kernel="$(get_field_from_entry "${entry}" 9)"
        # We must align initrds with kernels.
        # Adds initrds to the stack then pop them 1 by 1 as we process the kernels
        set -- $(get_field_from_entry "${entry}" 7 | tr "|" " ")
        for k in $(get_field_from_entry "${entry}" 8|tr "|" " "); do
            # get initrd and pop to the next one
            candidate_initrd="$1"; shift
            kernel_basename=$(basename "${k}")
            if [ "${kernel_basename}" = "${last_used_kernel}" ]; then
                kernel="${k}"
                initrd="${candidate_initrd}"
                break
            fi
        done
        echo "${entry}" | awk "BEGIN{ FS=\"\t\"; OFS=\"\t\"}    {print \$3, \$2, \"history\", \"$name\", \$1, \$6, \"$initrd\", \"$kernel\"}"
    done
}
# Generate metadata from a BOOTLIST that will subsequently used to generate
# the final grub menu entries
generate_grub_menu_metadata() {
    local bootlist="$1"
    # Sort machineids by last_used from their main entry
    for machineid in $(get_machines_sorted "${bootlist}"); do
        entries="$(sort_entries_for_machineid "${bootlist}" ${machineid})"
        main_entry="$(get_main_entry "${entries}")"
        if [ -z "$main_entry" ]; then
            continue
        fi
        main_entry_meta "${main_entry}"
        advanced_entries_meta "${main_entry}"
        main_dataset_name="$(get_field_from_entry "${main_entry}" 1)"
        main_dataset_releasename="$(get_field_from_entry "${main_entry}" 4)"
        # grep -v errcode != 0 if there is no match. || true to not fail with -e
        other_entries="$(echo "${entries}" | grep -v "${main_entry}" || true)"
        history_entries_meta "${other_entries}" "${main_dataset_name}" "${main_dataset_releasename}"
    done
}
# Print the configuration part common to all sections
# Note:
#   If 10_linux runs these part will be defined twice in grub configuration
print_menu_prologue() {
    cat << 'EOF'
function gfxmode {
	set gfxpayload="${1}"
EOF
    if [ "${vt_handoff}" = 1 ]; then
        cat << 'EOF'
	if [ "${1}" = "keep" ]; then
		set vt_handoff=vt.handoff=1
	else
		set vt_handoff=
	fi
EOF
    fi
    cat << EOF
}
EOF
    # Use ELILO's generic "efifb" when it's known to be available.
    # FIXME: We need an interface to select vesafb in case efifb can't be used.
    GRUB_GFXPAYLOAD_LINUX="${GRUB_GFXPAYLOAD_LINUX:-}"
    if [ "${GRUB_GFXPAYLOAD_LINUX}" != "" ] || [ "${gfxpayload_dynamic}" = 0 ]; then
        echo "set linux_gfx_mode=${GRUB_GFXPAYLOAD_LINUX}"
    else
        cat << EOF
if [ "\${recordfail}" != 1 ]; then
  if [ -e \${prefix}/gfxblacklist.txt ]; then
    if hwmatch \${prefix}/gfxblacklist.txt 3; then
      if [ \${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
EOF
    fi
    cat << EOF
export linux_gfx_mode
EOF
}
# Cache for prepare_grub_to_access_device call
# $1: boot_device
# $2: submenu_level
prepare_grub_to_access_device_cached() {
    local boot_device="$1"
    local submenu_level="$2"
    local boot_device_idx="$(echo ${boot_device} | tr '/' '_')"
    cache_file="${ZFSTMP}/$(echo boot_device${boot_device_idx})"
    if [ ! -f "${cache_file}" ]; then
        set +u
        echo "$(prepare_grub_to_access_device "${boot_device}")" > "${cache_file}"
        set -u
        for i in 0 1 2; do
            submenu_indentation="$(printf %${i}s | tr " " "${grub_tab}")"
            sed "s/^/${submenu_indentation}	/" "${cache_file}" > "${cache_file}--${i}"
        done
    fi
    cat "${cache_file}--${submenu_level}"
}
# Print a grub menu entry
zfs_linux_entry () {
    submenu_level="$1"
    title="$2"
    type="$3"
    dataset="$4"
    boot_device="$5"
    initrd="$6"
    kernel="$7"
    kernel_version="$8"
    kernel_additional_args="${9:-}"
    boot_devices="${10:-}"
    submenu_indentation="$(printf %${submenu_level}s | tr " " "${grub_tab}")"
    echo "${submenu_indentation}menuentry '$(echo "${title}" | grub_quote)' ${CLASS} \${menuentry_id_option} 'gnulinux-${dataset}-${kernel_version}' {"
    if [ "${quick_boot}" = 1 ]; then
        echo "${submenu_indentation}	recordfail"
    fi
    if [ "${type}" != "recovery" ] ; then
        GRUB_SAVEDEFAULT=${GRUB_SAVEDEFAULT:-}
        default_entry="$(save_default_entry)"
        if [ -n "${default_entry}" ]; then
            echo "${submenu_indentation}	${default_entry}"
        fi
    fi
    # Use ELILO's generic "efifb" when it's known to be available.
    # FIXME: We need an interface to select vesafb in case efifb can't be used.
    if [ "${GRUB_GFXPAYLOAD_LINUX}" = "" ]; then
        echo "${submenu_indentation}	load_video"
    else
        if [ "${GRUB_GFXPAYLOAD_LINUX}" != "text" ]; then
            echo "${submenu_indentation}	load_video"
        fi
    fi
    if ([ "${ubuntu_recovery}" = 0 ] || [ "${type}" != "recovery" ]) && \
        ([ "${GRUB_GFXPAYLOAD_LINUX}" != "" ] || [ "${gfxpayload_dynamic}" = 1 ]); then
        echo "${submenu_indentation}	gfxmode \${linux_gfx_mode}"
    fi
    echo "${submenu_indentation}	insmod gzio"
    echo "${submenu_indentation}	if [ \"\${grub_platform}\" = xen ]; then insmod xzio; insmod lzopio; fi"
    if [ -n "$boot_devices" ]; then
        for device in ${boot_devices}; do
            echo "${submenu_indentation}	if [ "${boot_device}" = "${device}" ]; then"
            echo "$(prepare_grub_to_access_device_cached "${device}" $(( submenu_level +1 )) )"
            echo "${submenu_indentation}	fi"
        done
    else
        echo "$(prepare_grub_to_access_device_cached "${boot_device}" "${submenu_level}")"
    fi
    if [ "${quiet_boot}" = 0 ] || [ "${type}" != simple ]; then
        echo "${submenu_indentation}	echo $(gettext_printf "Loading Linux %s ..." ${kernel_version} | grub_quote)"
    fi
    linux_default_args="${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
    if [ ${type} = "recovery" ]; then
        linux_default_args="${GRUB_CMDLINE_LINUX_RECOVERY} ${GRUB_CMDLINE_LINUX}"
    fi
    echo "${submenu_indentation}	linux	${kernel} root=ZFS=${dataset} ro ${linux_default_args} ${kernel_additional_args}"
    if [ "${quiet_boot}" = 0 ] || [ "${type}" != simple ]; then
        echo "${submenu_indentation}	echo '$(gettext_printf "Loading initial ramdisk ..." | grub_quote)'"
    fi
    echo "${submenu_indentation}	initrd	${initrd}"
    echo "${submenu_indentation}}"
}
# Generate a GRUB Menu from menu meta data
# $1 menu metadata
generate_grub_menu() {
    local menu_metadata="$1"
    local last_section=""
    local main_dataset_name=""
    local main_dataset=""
    local have_zsys=""
    if [ -z "${menu_metadata}" ]; then
        return
    fi
    CLASS="--class gnu-linux --class gnu --class os"
    if [ "${GRUB_DISTRIBUTOR}" = "" ] ; then
        OS=GNU/Linux
    else
        case ${GRUB_DISTRIBUTOR} in
            Ubuntu|Kubuntu)
            OS="${GRUB_DISTRIBUTOR}"
            ;;
            *)
            OS="${GRUB_DISTRIBUTOR} GNU/Linux"
            ;;
        esac
        CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1 | LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
    fi
    if [ -x /lib/recovery-mode/recovery-menu ]; then
        GRUB_CMDLINE_LINUX_RECOVERY=recovery
    else
        GRUB_CMDLINE_LINUX_RECOVERY=single
    fi
    if [ "${ubuntu_recovery}" = 1 ]; then
        GRUB_CMDLINE_LINUX_RECOVERY="${GRUB_CMDLINE_LINUX_RECOVERY} nomodeset"
    fi
    case "$GENKERNEL_ARCH" in
        x86*) GRUB_CMDLINE_LINUX_RECOVERY="$GRUB_CMDLINE_LINUX_RECOVERY dis_ucode_ldr";;
    esac
    if [ "${vt_handoff}" = 1 ]; then
        for word in ${GRUB_CMDLINE_LINUX_DEFAULT}; do
            if [ "${word}" = splash ]; then
                GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} \${vt_handoff}"
            fi
        done
    fi
    print_menu_prologue
    cat<<'EOF'
function zsyshistorymenu {
	# $1: root dataset (eg rpool/ROOT/ubuntu_2zhm07@autozsys_k56fr6)
	# $2: boot device id (eg 411f29ce1557bfed)
	# $3: initrd (eg /BOOT/ubuntu_2zhm07@autozsys_k56fr6/initrd.img-5.4.0-21-generic)
	# $4: kernel (eg /BOOT/ubuntu_2zhm07@autozsys_k56fr6/vmlinuz-5.4.0-21-generic)
	# $5: kernel_version (eg 5.4.0-21-generic)
	set root_dataset="${1}"
	set boot_device="${2}"
	set initrd="${3}"
	set kernel="${4}"
	set kversion="${5}"
EOF
    boot_devices=$(echo "${menu_metadata}" | cut -d"$(printf '\t')" -f6 | sort -u)
    title=$(gettext_printf "Revert system only")
    zfs_linux_entry 1 "${title}" "simple" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' '' "${boot_devices}"
    title="$(gettext_printf "Revert system and user data")"
    zfs_linux_entry 1 "${title}" "simple" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' 'zsys-revert=userdata' "${boot_devices}"
    GRUB_DISABLE_RECOVERY="${GRUB_DISABLE_RECOVERY:-}"
    if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
        title="$(gettext_printf "Revert system only (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
        zfs_linux_entry 1 "${title}" "recovery" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' '' "${boot_devices}"
        title="$(gettext_printf "Revert system and user data (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
        zfs_linux_entry 1 "${title}" "recovery" '${root_dataset}' '${boot_device}' '${initrd}' '${kernel}' '${kversion}' 'zsys-revert=userdata' "${boot_devices}"
    fi
echo "}"
echo
    # IFS is set to TAB (ASCII 0x09)
    echo "${menu_metadata}" |
    {
        at_least_one_entry=0
        have_zsys="$(which zsysd || true)"
        while IFS="$(printf '\t')" read -r machineid iszsys section name dataset device initrd kernel opt; do
            # Disable history for non zsys system or if systems is a zsys one and zsys isn't installed.
            # In pure zfs systems, we identified multiple issues due to the mount generator
            # in upstream zfs which makes it incompatible. Don't show history for now.
            if [ "${section}" = "history" ]; then
                if [ "${iszsys}" != "yes" ] || [ "${iszsys}" = "yes" -a -z "${have_zsys}" ]; then
                    continue
                fi
            fi
            if [ "${last_section}" != "${section}" -a -n "${last_section}" ]; then
                # Close previous section wrapper
                if [ "${last_section}" != "main" ]; then
                    echo "}"    # Add grub_tabs
                    at_least_one_entry=0
                fi
            fi
            case "${section}" in
                main)
                    title="${name}"
                    main_dataset_name="${name}"
                    main_dataset="${dataset}"
                    kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
                    zfs_linux_entry 0 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
                    at_least_one_entry=1
                ;;
                advanced)
                    # normal and recovery entries for a given kernel
                    if [ "${last_section}" != "${section}" ]; then
                        echo "submenu '$(gettext_printf "Advanced options for %s" "${main_dataset_name}" | grub_quote)' \${menuentry_id_option} 'gnulinux-advanced-${main_dataset}' {"
                    fi
                    last_booted_kernel_marker=""
                    if [ "${opt}" = "true" ]; then
                        last_booted_kernel_marker="* "
                    fi
                    kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
                    title="$(gettext_printf "%s%s, with Linux %s" "${last_booted_kernel_marker}" "${name}" "${kernel_version}")"
                    zfs_linux_entry 1 "${title}" "advanced" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
                    GRUB_DISABLE_RECOVERY=${GRUB_DISABLE_RECOVERY:-}
                    if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
                        title="$(gettext_printf "%s%s, with Linux %s (%s)" "${last_booted_kernel_marker}" "${name}" "${kernel_version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
                        zfs_linux_entry 1 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
                    fi
                    at_least_one_entry=1
                ;;
                history)
                    # Revert to a snapshot
                    # revert system, revert system and user data and associated recovery entries
                    if [ "${last_section}" != "${section}" ]; then
                        echo "submenu '$(gettext_printf "History for %s" "${main_dataset_name}" | grub_quote)' \${menuentry_id_option} 'gnulinux-history-${main_dataset}' {"
                    fi
                    if [ "${iszsys}" = "yes" ]; then
                        title="$(gettext_printf "Revert to %s" "${name}" | grub_quote)"
                    else
                        title="$(gettext_printf "Boot on %s" "${name}" | grub_quote)"
                    fi
                    echo "	submenu '${title}' \${menuentry_id_option} 'gnulinux-history-${dataset}' {"
                    kernel_version=$(basename "${kernel}" | sed -e "s,^[^0-9]*-,,g")
                    # Zsys only: let revert system without destroying snapshots
                    if [ "${iszsys}" = "yes" ]; then
                        echo "${grub_tab}${grub_tab}zsyshistorymenu" \"${dataset}\" \"${device}\" \"${initrd}\" \"${kernel}\" \"${kernel_version}\"
                    # Non-zsys: boot temporarly on snapshots or rollback (destroying intermediate snapshots)
                    else
                        title="$(gettext_printf "One time boot")"
                        zfs_linux_entry 2 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
                        GRUB_DISABLE_RECOVERY="${GRUB_DISABLE_RECOVERY:-}"
                        if [ "${GRUB_DISABLE_RECOVERY}" != "true" ]; then
                            title="$(gettext_printf "One time boot (%s)" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
                            zfs_linux_entry 2 "${title}" "recovery" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}"
                        fi
                        title="$(gettext_printf "Revert system (all intermediate snapshots will be destroyed)")"
                        zfs_linux_entry 2 "${title}" "simple" "${dataset}" "${device}" "${initrd}" "${kernel}" "${kernel_version}" "rollback=yes"
                    fi
                    echo "	}"
                    at_least_one_entry=1
                ;;
                *)
                    grub_warn "unknown section: ${section}. Ignoring entry ${name} for ${dataset}"
                ;;
            esac
            last_section="${section}"
        done
        if [ "${at_least_one_entry}" -eq 1 ]; then
            echo "}"
        fi
    }
}
# don't add trailing newline of variable is empty
# $1: content to write
# $2: destination file
trailing_newline_if_not_empty() {
    content="$1"
    dest="$2"
    if [ -z "${content}" ]; then
        rm -f "${dest}"
        touch "${dest}"
        return
    fi
    echo "${content}" > "${dest}"
}
GRUB_LINUX_ZFS_TEST="${GRUB_LINUX_ZFS_TEST:-}"
case "${GRUB_LINUX_ZFS_TEST}" in
    bootlist)
        # Import all available pools on the system and return imported list
        imported_pools=$(import_pools)
        boot_list="$(bootlist ${MNTDIR})"
        trailing_newline_if_not_empty "${boot_list}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
        break
    ;;
    metamenu)
        boot_list="$(cat ${GRUB_LINUX_ZFS_TEST_INPUT})"
        menu_metadata="$(generate_grub_menu_metadata "${boot_list}")"
        trailing_newline_if_not_empty "${menu_metadata}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
        break
    ;;
    grubmenu)
        menu_metadata="$(cat ${GRUB_LINUX_ZFS_TEST_INPUT})"
        grub_menu=$(generate_grub_menu "${menu_metadata}")
        trailing_newline_if_not_empty "${grub_menu}" "${GRUB_LINUX_ZFS_TEST_OUTPUT}"
        break
    ;;
    *)
        # Import all available pools on the system and return imported list
        imported_pools=$(import_pools)
        # Generate the complete list of boot entries
        boot_list="$(bootlist ${MNTDIR})"
        # Create boot menu meta data from the list of boot entries
        menu_metadata="$(generate_grub_menu_metadata "${boot_list}")"
        # Create boot menu meta data from the list of boot entries
        grub_menu="$(generate_grub_menu "${menu_metadata}")"
        if [ -n "${grub_menu}" ]; then
            # We want the trailing newline as a marker will be added
            echo "${grub_menu}"
        fi
    ;;
esac

========================= sde5/etc/grub.d/33_linux_xen =========================

#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
. "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
CLASS="--class gnu-linux --class gnu --class os --class xen"
SUPPORTED_INITS="sysvinit:/lib/sysvinit/init systemd:/lib/systemd/systemd upstart:/sbin/upstart"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  OS=GNU/Linux
else
  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
  /dev/loop/*|/dev/loop[0-9])
    GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
    # We can't cope with devices loop-mounted from files here.
    case ${GRUB_DEVICE} in
      /dev/*) ;;
      *) exit 0 ;;
    esac
  ;;
esac
# Default to disabling partition uuid support to maintian compatibility with
# older kernels.
GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true}
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \
    || ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
	&& [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \
    || ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
	&& ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \
    || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
  LINUX_ROOT_DEVICE=${GRUB_DEVICE}
elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \
    || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then
  LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID}
else
  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
  GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
fi
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
  GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
fi
case x"$GRUB_FS" in
    xbtrfs)
	rootsubvol="`make_system_path_relative_to_its_root /`"
	rootsubvol="${rootsubvol#/}"
	if [ "x${rootsubvol}" != x ]; then
	    GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
	fi;;
    xzfs)
	rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
	bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
	LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
	;;
esac
title_correction_code=
linux_entry ()
{
  os="$1"
  version="$2"
  xen_version="$3"
  type="$4"
  args="$5"
  xen_args="$6"
  if [ -z "$boot_device_id" ]; then
      boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
  fi
  if [ x$type != xsimple ] ; then
      if [ x$type = xrecovery ] ; then
	  title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "$(gettext "${GRUB_RECOVERY_TITLE}")")"
      elif [ "${type#init-}" != "$type" ] ; then
	  title="$(gettext_printf "%s, with Xen %s and Linux %s (%s)" "${os}" "${xen_version}" "${version}" "${type#init-}")"
      else
	  title="$(gettext_printf "%s, with Xen %s and Linux %s" "${os}" "${xen_version}" "${version}")"
      fi
      replacement_title="$(echo "Advanced options for ${OS}" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
      if [ x"Xen ${xen_version}>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
         quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
         title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
         grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
      fi
      echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
  else
      title="$(gettext_printf "%s, with Xen hypervisor" "${os}")"
      echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
  fi
  if [ x$type != xrecovery ] ; then
      save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
  fi
  if [ -z "${prepare_boot_cache}" ]; then
    prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
  fi
  printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
  xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
  lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
  sed "s/^/$submenu_indentation/" << EOF
	echo	'$(echo "$xmessage" | grub_quote)'
        if [ "\$grub_platform" = "pc" -o "\$grub_platform" = "" ]; then
            xen_rm_opts=
        else
            xen_rm_opts="no-real-mode edd=off"
        fi
	${xen_loader}	${rel_xen_dirname}/${xen_basename} placeholder ${xen_args} \${xen_rm_opts}
	echo	'$(echo "$lmessage" | grub_quote)'
	${module_loader}	${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
EOF
  if test -n "${initrd}" ; then
    # TRANSLATORS: ramdisk isn't identifier. Should be translated.
    message="$(gettext_printf "Loading initial ramdisk ...")"
    initrd_path=
    for i in ${initrd}; do
       initrd_path="${initrd_path} ${rel_dirname}/${i}"
    done
    sed "s/^/$submenu_indentation/" << EOF
	echo	'$(echo "$message" | grub_quote)'
	${module_loader}	--nounzip   $(echo $initrd_path)
EOF
  fi
  sed "s/^/$submenu_indentation/" << EOF
}
EOF
}
linux_list=
for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
    if grub_file_is_not_garbage "$i"; then
    	basename=$(basename $i)
	version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
	dirname=$(dirname $i)
	config=
	for j in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
	    if test -e "${j}" ; then
		config="${j}"
		break
	    fi
	done
        if (grep -qx "CONFIG_XEN_DOM0=y" "${config}" 2> /dev/null || grep -qx "CONFIG_XEN_PRIVILEGED_GUEST=y" "${config}" 2> /dev/null); then linux_list="$linux_list $i" ; fi
    fi
done
if [ "x${linux_list}" = "x" ] ; then
    exit 0
fi
file_is_not_sym () {
    case "$1" in
	*/xen-syms-*)
	    return 1;;
	*)
	    return 0;;
    esac
}
xen_list=
for i in /boot/xen*; do
    if grub_file_is_not_garbage "$i" && file_is_not_sym "$i" ; then xen_list="$xen_list $i" ; fi
done
prepare_boot_cache=
boot_device_id=
title_correction_code=
machine=`uname -m`
case "$machine" in
    i?86) GENKERNEL_ARCH="x86" ;;
    mips|mips64) GENKERNEL_ARCH="mips" ;;
    mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
    arm*) GENKERNEL_ARCH="arm" ;;
    *) GENKERNEL_ARCH="$machine" ;;
esac
# Extra indentation to add to menu entries in a submenu. We're not in a submenu
# yet, so it's empty. In a submenu it will be equal to '\t' (one tab).
submenu_indentation=""
is_top_level=true
while [ "x${xen_list}" != "x" ] ; do
    list="${linux_list}"
    current_xen=`version_find_latest $xen_list`
    xen_basename=`basename ${current_xen}`
    xen_dirname=`dirname ${current_xen}`
    rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname`
    xen_version=`echo $xen_basename | sed -e "s,.gz$,,g;s,^xen-,,g"`
    if [ -z "$boot_device_id" ]; then
	boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
    fi
    if [ "x$is_top_level" != xtrue ]; then
	echo "	submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
    fi
    if ($grub_file --is-arm64-efi $current_xen); then
	xen_loader="xen_hypervisor"
	module_loader="xen_module"
    else
	if ($grub_file --is-x86-multiboot2 $current_xen); then
	    xen_loader="multiboot2"
	    module_loader="module2"
	else
	    xen_loader="multiboot"
	    module_loader="module"
        fi
    fi
    initrd_early=
    for i in ${GRUB_EARLY_INITRD_LINUX_STOCK} \
             ${GRUB_EARLY_INITRD_LINUX_CUSTOM}; do
       if test -e "${xen_dirname}/${i}" ; then
          initrd_early="${initrd_early} ${i}"
       fi
    done
    while [ "x$list" != "x" ] ; do
	linux=`version_find_latest $list`
	gettext_printf "Found linux image: %s\n" "$linux" >&2
	basename=`basename $linux`
	dirname=`dirname $linux`
	rel_dirname=`make_system_path_relative_to_its_root $dirname`
	version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
	alt_version=`echo $version | sed -e "s,\.old$,,g"`
	linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
	initrd_real=
	for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
	   "initrd-${version}" "initramfs-${version}.img" \
	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
	   "initrd-${alt_version}" "initramfs-${alt_version}.img" \
	   "initramfs-genkernel-${version}" \
	   "initramfs-genkernel-${alt_version}" \
	   "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
	   "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" ; do
	    if test -e "${dirname}/${i}" ; then
		initrd_real="$i"
		break
	    fi
	done
	initrd=
	if test -n "${initrd_early}" || test -n "${initrd_real}"; then
	    initrd="${initrd_early} ${initrd_real}"
	    initrd_display=
	    for i in ${initrd}; do
		initrd_display="${initrd_display} ${dirname}/${i}"
	    done
	    gettext_printf "Found initrd image: %s\n" "$(echo $initrd_display)" >&2
	fi
	if test -z "${initrd_real}"; then
    # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
	    if [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] \
		|| [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ]; then
		linux_root_device_thisversion=${GRUB_DEVICE}
	    else
		linux_root_device_thisversion=PARTUUID=${GRUB_DEVICE_PARTUUID}
	    fi
	fi
	if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
	    linux_entry "${OS}" "${version}" "${xen_version}" simple \
		"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
	    submenu_indentation="$grub_tab$grub_tab"
    
	    if [ -z "$boot_device_id" ]; then
		boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
	    fi
            # TRANSLATORS: %s is replaced with an OS name
	    echo "submenu '$(gettext_printf "Advanced options for %s (with Xen hypervisor)" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
	echo "	submenu '$(gettext_printf "Xen hypervisor, version %s" "${xen_version}" | grub_quote)' \$menuentry_id_option 'xen-hypervisor-$xen_version-$boot_device_id' {"
	   is_top_level=false
	fi
	linux_entry "${OS}" "${version}" "${xen_version}" advanced \
	    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
	for supported_init in ${SUPPORTED_INITS}; do
	    init_path="${supported_init#*:}"
	    if [ -x "${init_path}" ] && [ "$(readlink -f /sbin/init)" != "$(readlink -f "${init_path}")" ]; then
		linux_entry "${OS}" "${version}" "${xen_version}" "init-${supported_init%%:*}" \
		    "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} init=${init_path}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
	    fi
	done
	if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
	    linux_entry "${OS}" "${version}" "${xen_version}" recovery \
		"single ${GRUB_CMDLINE_LINUX}" "${GRUB_CMDLINE_XEN}"
	fi
	list=`echo $list | tr ' ' '\n' | fgrep -vx "$linux" | tr '\n' ' '`
    done
    if [ x"$is_top_level" != xtrue ]; then
	echo '	}'
    fi
    xen_list=`echo $xen_list | tr ' ' '\n' | fgrep -vx "$current_xen" | tr '\n' ' '`
done
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
if [ x"$is_top_level" != xtrue ]; then
  echo '}'
fi
echo "$title_correction_code"

====================== sde5/etc/grub.d/34_os-prober_proxy ======================

#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "-'Windows Boot Manager (sur /dev/sda2)'~2c9af2afb335f5fcf2803fd609e8c758~
+*
+#text
"

======================= sde5/etc/grub.d/35_uefi-firmware =======================

#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2012  Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
. "${datarootdir}/grub/grub-mkconfig_lib"
efi_vars_dir=/sys/firmware/efi/vars
EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c
OsIndications="$efi_vars_dir/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE/data"
if [ -e "$OsIndications" ] && \
   [ "$(( $(printf 0x%x \'"$(cat $OsIndications | cut -b1)") & 1 ))" = 1 ]; then
  LABEL="UEFI Firmware Settings"
  gettext_printf "Adding boot menu entry for UEFI Firmware Settings\n" >&2
  onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
  cat << EOF
menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
	fwsetup
}
EOF
fi


======================== Unknown MBRs/Boot Sectors/etc =========================

Unknown MBR on /dev/sdb

00000000  45 52 02 00 00 05 38 da  00 00 00 00 00 00 00 00  |ER....8.........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000090  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000100  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000120  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000130  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000150  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000160  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000170  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000180  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000190  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001b0  00 00 00 00 31 43 6c 6b  52 64 79 24 00 00 00 20  |....1ClkRdy$... |
000001c0  21 00 07 fe 3f 13 00 08  00 00 14 df 04 00 00 07  |!...?...........|
000001d0  0e 14 07 fe ff ff da e8  04 00 fe ef 3d 25 00 00  |............=%..|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200


/dev/sda1: unknown GPT attributes
8000000000000001

/dev/sda2: unknown GPT attributes
8000000000000000

/dev/sda3: unknown GPT attributes
8000000000000000

/dev/sda5: unknown GPT attributes
8000000000000001
Unknown BootLoader on sde4

00000000  65 58 37 69 76 39 77 49  39 4c 31 46 38 38 6c 6b  |eX7iv9wI9L1F88lk|
00000010  38 52 31 58 2b 61 4f 59  37 67 45 31 6a 63 58 78  |8R1X+aOY7gE1jcXx|
00000020  52 79 47 6c 32 39 65 6f  4b 5a 49 69 0d 0a 68 6c  |RyGl29eoKZIi..hl|
00000030  76 71 76 57 2b 58 4c 44  6c 6c 2b 46 31 39 53 4f  |vqvW+XLDll+F19SO|
00000040  57 56 6a 79 4f 79 7a 71  2f 4b 65 35 54 6c 30 74  |WVjyOyzq/Ke5Tl0t|
00000050  48 76 57 37 4c 4d 55 48  56 30 77 73 6f 72 4e 46  |HvW7LMUHV0wsorNF|
00000060  61 33 64 44 57 74 64 45  47 38 4e 36 33 61 68 4c  |a3dDWtdEG8N63ahL|
00000070  72 74 4b 69 4b 7a 0d 0a  55 6f 66 4c 46 54 34 55  |rtKiKz..UofLFT4U|
00000080  51 7a 67 76 54 4d 74 74  53 4c 72 4b 59 32 2f 68  |QzgvTMttSLrKY2/h|
00000090  68 73 6f 69 31 62 37 41  53 67 31 6b 47 74 46 6c  |hsoi1b7ASg1kGtFl|
000000a0  69 41 65 4d 4d 4f 79 67  74 68 46 70 43 47 56 63  |iAeMMOygthFpCGVc|
000000b0  61 44 6c 32 46 45 4f 47  49 46 53 79 67 34 62 66  |aDl2FEOGIFSyg4bf|
000000c0  0d 0a 67 73 45 6d 73 75  48 76 52 61 30 52 59 54  |..gsEmsuHvRa0RYT|
000000d0  32 44 56 71 55 57 31 4b  49 34 6c 6a 68 42 44 4c  |2DVqUW1KI4ljhBDL|
000000e0  68 56 52 46 76 42 51 4d  31 6e 45 42 50 57 6f 46  |hVRFvBQM1nEBPWoF|
000000f0  52 37 2f 4f 38 4b 45 4e  79 37 33 74 58 31 4a 74  |R7/O8KENy73tX1Jt|
00000100  76 38 31 65 32 2b 6e 57  70 7a 0d 0a 56 53 71 57  |v81e2+nWpz..VSqW|
00000110  37 70 59 38 79 70 53 71  55 58 56 42 64 4b 6c 72  |7pY8ypSqUXVBdKlr|
00000120  55 76 74 6a 76 6f 4a 73  43 4b 42 2f 45 41 74 30  |UvtjvoJsCKB/EAt0|
00000130  4a 71 42 71 58 30 36 72  6c 43 70 32 6c 76 56 33  |JqBqX06rlCp2lvV3|
00000140  68 62 32 38 79 38 56 39  69 35 6d 52 4e 74 6f 36  |hb28y8V9i5mRNto6|
00000150  57 36 72 56 0d 0a 69 62  55 74 64 4d 43 73 54 65  |W6rV..ibUtdMCsTe|
00000160  44 77 38 77 74 53 78 73  6c 6d 42 59 4d 79 54 6c  |Dw8wtSxslmBYMyTl|
00000170  65 7a 76 47 73 64 4e 71  78 4e 33 6d 48 76 38 6e  |ezvGsdNqxN3mHv8n|
00000180  4c 45 79 65 58 61 4c 74  74 33 67 56 69 79 75 79  |LEyeXaLtt3gViyuy|
00000190  69 64 46 65 6c 42 63 7a  4e 72 75 55 6c 43 0d 0a  |idFelBczNruUlC..|
000001a0  31 42 76 7a 6d 69 46 45  66 6c 52 63 68 2b 4a 7a  |1BvzmiFEflRch+Jz|
000001b0  64 71 47 6d 4e 6d 6d 64  69 7a 50 33 36 48 00 fe  |dqGmNmmdizP36H..|
000001c0  ff ff 83 fe ff ff 02 00  00 00 00 a0 0d 1d 00 00  |................|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200


========= Devices which don't seem to have a corresponding hard drive ==========

sdf 

Suggested repair: ______________________________________________________________

The default repair of the Boot-Repair utility would purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sde5,
using the following options:        sde3/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s  use-standard-efi-file  restore-efi-backups  

Final advice in case of suggested repair: ______________________________________


Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.04.1 LTS CurrentSession entry (sde3/efi/****/shim****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.

If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\shim****.efi (**** will be updated in the final message)

Gaulois Matter !

Hors ligne

#11 Le 05/12/2020, à 20:20

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Quel est le problème ?

Hors ligne

#12 Le 05/12/2020, à 20:51

lucmars

Re : (resolu)Impossible de démarrer sur Ubuntu

Le problème est que je suis le mauvais cheval pour ton cas; mais je ne suis pas seul ici.

T'as plus d'un disque, au plus 5 ; rien d'anormal. Par contre niveau grub, sembles que t'ais créé des fichiers custom, est-ce exact ?


Gaulois Matter !

Hors ligne

#13 Le 06/12/2020, à 07:11

ikewdu

Re : (resolu)Impossible de démarrer sur Ubuntu

Salut,

Si tu tapotes F9 au démarrage, peux-tu me dire ce qui s'affiche ? Car, hormis une mauvaise partition efi montée en fstab, je ne vois pas de raison significative pour expliquer ce GRUB inopérant. Trois choses tout de même :

Comme l'installation en mode uefi sur sdc (qui est un disque msdos) est un peu foireuse, peut-être pourrais-tu déjà refaire cette installation proprement.... On verrait peut-être une évolution : disque gpt + uefi.

Idem pour sdb que tu pourrais débrancher, car il contient, selon le rapport, un boot-loader inconnu. C'est peut-être lui qui met le bazar si le PC démarre en Legacy en priorité, et que l'uefi se lance dans un second temps.

Enfin, tu as utilisé un logiciel tiers (grub-customizer ?) qui a laissé des traces de scripts. C'est peut-être lui le responsable.

Hors ligne

#14 Le 06/12/2020, à 09:35

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Comment savoir à quel disque physique correspond le sdb ?
Et F9 c'est quand j'allume le PC (comme quand je fais F10 pour accéder au Bios) ?

Hors ligne

#15 Le 06/12/2020, à 21:16

ikewdu

Re : (resolu)Impossible de démarrer sur Ubuntu

Re,

sdb:320GB:scsi:512:512:mac:Hitachi HTS543232L9A300:;

Pour F9, c'est en effet au démarrage.

Hors ligne

#16 Le 07/12/2020, à 09:00

malbo

Re : (resolu)Impossible de démarrer sur Ubuntu

Chanchris a écrit :

Si je fais un tour dans le bios au préalable, pas d'écran noir, le menu de boot s'affiche.

Le chargeur d'amorçage qui est utilisé se trouve sur le disque dur interne sda. On peut voir ça dans cet extrait :

===================================== UEFI =====================================

BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
SecureBoot disabled.

efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0002,0001,0004,0005
Boot0000* ubuntu	HD(2,GPT,08d37f28-6a60-4f72-a65c-a7f8b3566e98,0x200000,0xb4000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* USB Floppy/CD	VenMedia(b6fef66f-1495-4584-a836-3492d1984a8d,0500000001)..BO
Boot0002* USB Hard Drive	VenMedia(b6fef66f-1495-4584-a836-3492d1984a8d,0200000001)..BO
Boot0004* UEFI: IPv4 Realtek PCIe GBE Family Controller	PciRoot(0x0)/Pci(0x1c,0x6)/Pci(0x0,0x0)/MAC(2025647e4e11,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0005* UEFI: IPv6 Realtek PCIe GBE Family Controller	PciRoot(0x0)/Pci(0x1c,0x6)/Pci(0x0,0x0)/MAC(2025647e4e11,0)/IPv6([::]:<->[::]:,0,0)..BO

On peut voir que le "BootCurrent" correspond bien à l'entrée "ubuntu", laquelle pointe vers 08d37f28-6a60-4f72-a65c-a7f8b3566e98 qui est l’identifiant PARTUUID de la partition sda2. Ce chargeur d'amorçage doit rechercher la partition racine de Ubuntu qui se trouve sur le disque dur externe sde.
Quand tu fais un démarrage normal sans faire un tour dans le Bios, le disque dur externe sde n'est pas encore opérationnel, ce qui fait que le chargeur d'amorçage de Grub déclare forfait et que tu obtiens l'écran noir avec une ligne "grub>"
Par contre, en faisant un tour par le Bios, tu laisses le temps au disque externe sde de s'établir.
Cela étant, je n'ai pas de solution à proposer si ce n'est de presser la touche F9 au démarrage quand tu dois démarrer sur Ubuntu : ainsi, ça laisse le temps au disque dur externe de s'établir et tu peux démarrer sur l'entrée "ubuntu" sans problème.

Dernière modification par malbo (Le 07/12/2020, à 09:05)

Hors ligne

#17 Le 07/12/2020, à 09:15

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

C'est donc le disque dur  externe sde qui n'est pas assez rapide ?
Quand j'appuie sur F9 au démarrage j'ai un écran qui me demande de confirmer le disque sur lequel demarrer.
Si je démarre sur ubuntu et que je choisis alors Windows dans le menu Grub, je constate lors d'un prochain  démarrage que l'ordre est changé dans le bios et que Windows boot manager est alors en premier. Si je ne remodifie pas l'ordre le pc démarre directement sur Windows sans menu Grub. Pourquoi cela ?

Hors ligne

#18 Le 07/12/2020, à 09:30

malbo

Re : (resolu)Impossible de démarrer sur Ubuntu

Chanchris a écrit :

Quand j'appuie sur F9 au démarrage j'ai un écran qui me demande de confirmer le disque sur lequel demarrer.

Ce n'est pas exact : l'écran demande sur quelle entrée démarrer et non pas sur quel disque démarrer. Toi tu sélectionnes l'entrée "ubuntu" pour démarrer dessus.

Chanchris a écrit :

Si je démarre sur ubuntu et que je choisis alors Windows dans le menu Grub, je constate lors d'un prochain  démarrage que l'ordre est changé dans le bios et que Windows boot manager est alors en premier. Si je ne remodifie pas l'ordre le pc démarre directement sur Windows sans menu Grub. Pourquoi cela ?

Je ne suis pas certain de la réponse donc je préfère m'abstenir.

Hors ligne

#19 Le 07/12/2020, à 10:15

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Donnez moi toujours votre reponse...
Je ne risque plus rien à ce stade.

Hors ligne

#20 Le 07/12/2020, à 12:03

ikewdu

Re : (resolu)Impossible de démarrer sur Ubuntu

malbo a écrit :

Quand tu fais un démarrage normal sans faire un tour dans le Bios, le disque dur externe sde n'est pas encore opérationnel, ce qui fait que le chargeur d'amorçage de Grub déclare forfait et que tu obtiens l'écran noir avec une ligne "grub>"

Salut,
J'avoue que je n'avais pas envisagé cette piste... Si elle se confirme, il ne te restera plus qu'à avoir la partition efi et ton Linux sur le même disque et à placer tout ça en tête au démarrage. C'est déjà le cas pour la première partie, mais comme l'entrée correspondant au grub présent sur sde3 n'apparaît pas dans la listes des éléments bootables, il faudrait l'ajouter. Peut-être que la commande efibootmgr autorisera cet ajout. Sans certitude.

Qu'a donné le débranchement de sdb ?

Hors ligne

#21 Le 07/12/2020, à 14:37

malbo

Re : (resolu)Impossible de démarrer sur Ubuntu

Après réexamen du Boot-info, je pense que la meilleure solution serait d'abandonner l'installation merdique actuelle (sur un disque dur externe) et de faire une installation sur le même disque (sda) que Windows. J'ai vu qu'il y a un taux d'occupation modéré des partitions sda4 (la partition système de Windows) et sda7 (la partition dont le label est "Documents"), ce qui pourrait permettre de réduire la taille de l'une ou l'autre de ces partitions afin de libérer 30 Go pour installer Ubuntu.

Dernière modification par malbo (Le 07/12/2020, à 14:40)

Hors ligne

#22 Le 08/12/2020, à 20:31

Chanchris

Re : (resolu)Impossible de démarrer sur Ubuntu

Bonsoir. Merci malbo, j'ai finalement mis en place ta solution. J'ai installé Ubuntu sur le même disque Windows 10. Tout semble fonctionner, plus d'écran noir Grub mais le menu de boot normal.
J'ai enlevé 2 disques externes dont celui sur lequel était installé Ubuntu auparavant que j'ai formatés.
De plus, le chargement de Ubuntu est plus rapide.

Hors ligne

#23 Le 09/12/2020, à 07:31

malbo

Re : (resolu)Impossible de démarrer sur Ubuntu

Bonjour,
Je suis content de cette issue heureuse.
Je te prie de fermer la discussion en procédant comme suit :
1) te connecter sur le forum
2) cliquer sur "Modifier" en bas à droite de ton PREMIER post
3) modifier le titre de la discussion pour qu'il devienne :

[Résolu] Impossible de démarrer sur Ubuntu

EDIT : ce serait bien que tu fasses de même (passage en "résolu") pour l'autre discussion que tu as ouverte : https://forum.ubuntu-fr.org/viewtopic.php?id=2059505 obsolète

Dernière modification par malbo (Le 09/12/2020, à 09:35)

Hors ligne

#24 Le 09/12/2020, à 07:35

malbo

Re : (resolu)Impossible de démarrer sur Ubuntu

La suite des aventures de Chanchris se trouve dans cette autre discussion : https://forum.ubuntu-fr.org/viewtopic.php?id=2059557 EDIT : obsolète. J'ai donc rayé le texte.

Dernière modification par malbo (Le 09/12/2020, à 09:29)

Hors ligne

#25 Le 09/12/2020, à 09:22

cqfd93

Re : (resolu)Impossible de démarrer sur Ubuntu

Modération : merci de respecter les règles du forum : les doublons sont interdits. Sujets fusionnés.


cqfd93

En ligne