#1 Le 25/01/2023, à 11:47
- Doc Brown
[RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Bonjour à toutes et tous,
Je vous communique ci-dessous le rapport boot-info, que je ne sais pas encore exploiter.
Si une bonne âme pouvait me secourir je lui en serait reconnaissant
sda1
sda2
sda4 => Windows 10
sdb1 => UBUNTU 22.04 LTS
sdb2 => UBUNTU 22.10
sdb3 => Données Ubuntu /home
sdc2
sdc3 => 1- Données Windows
sdd4 => 2- Données Windows
boot-info-4ppa203 [20230125_1129]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
=> Grub2 (v2.00) is installed in the MBR of /dev/sdb and looks at sector
2165660368 of the same hard drive for core.img. core.img is at this
location and looks for (,gpt2)/boot/grub. It also embeds following
components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_gpt biosdisk
---------------------------------------------------------------------------
=> Windows 7/8/10/11/2012 is installed in the MBR of /dev/sdc.
=> Syslinux MBR (4.04-4.07) is installed in the MBR of /dev/sdd.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/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/10/11/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /EFI/refind/refind.conf /efi/Boot/bkpbootx64.efi
/efi/Boot/bootx64.efi /efi/Boot/fbx64.efi
/efi/Boot/mmx64.efi /efi/refind/refind_x64.efi
/efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
/efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/refind/drivers_x64/ext4_x64.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 10 or 11
Boot files: /Windows/System32/winload.exe
sdb1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.5 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.10
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb3: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub/grub.cfg
sdb4: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sdc1: __________________________________________________________________________
File system:
Boot sector type: Unknown
Boot sector info:
sdc2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/10/11/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/mmx64.efi
/efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
/efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
sdc3: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: According to the info in the boot sector, sdc3 starts
at sector 29. But according to the info from fdisk,
sdc3 starts at sector 264192. According to the info in
the boot sector, sdc3 has 312313855 sectors, but
according to the info from fdisk, it has 312317582
sectors.
Operating System:
Boot files:
sdc4: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sdd4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD
================================ 3 OS detected =================================
OS#1: Ubuntu 20.04.5 LTS on sdb1
OS#2: Ubuntu 22.10 on sdb2
OS#3: Windows 10 or 11 on sda4
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: GP104 [GeForce GTX 1060 6GB] EFI VGA from NVIDIA Corporation
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.19.0-29-generic root=UUID=81cc1007-920c-48f1-b034-37097baeafe2 ro quiet splash
df -Th / : /dev/sdb2 ext4 749G 18G 694G 3% /
===================================== UEFI =====================================
BIOS/UEFI firmware: A.A0(5.12) from American Megatrends Inc.
The firmware is EFI-compatible, and is set in EFI-mode for this installed-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0004,0005,0006,0055,0057,0000,0065,0066,0003,0002
Boot0000* Windows Boot Manager HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0002 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0003 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0004* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0005* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\GRUBX64.EFI)
Boot0006* Windows Boot Manager HD(3,GPT,8091998b-81ff-11e9-a8c1-309c238c7b41,0x40800,0x129d968f)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot002A* Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.a.n.D.i.s.k. .S.D.S.S.D.H.P.2.5.6.G...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.3.1.4.4.6.0.1.4.7.3.5.3. . . . . . . . ........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0037* CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0051 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0054* Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0055* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0057* Windows Boot Manager HD(3,GPT,8091998b-81ff-11e9-a8c1-309c238c7b41,0x40800,0x129d968f)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0065* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Boot0066* ubuntu HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
728124f6ec8e22fbdbe7034812c81b95 sdc2/BOOT/bkpbootx64.efi
b87d854e443e7fe6609397a3e5bfb74b sdc2/BOOT/bootx64.efi
c152ec201c37b6e97bbc2207e49d1271 sdc2/BOOT/fbx64.efi
fdafb5eece6caeccb788c946a28e6872 sdc2/BOOT/mmx64.efi
3795ef72a4ed0369ca44e711527904bf sdc2/ubuntu/grubx64.efi
fdafb5eece6caeccb788c946a28e6872 sdc2/ubuntu/mmx64.efi
728124f6ec8e22fbdbe7034812c81b95 sdc2/ubuntu/shimx64.efi
2fa8904690cb2325fb80a4cc8250430f sdc2/Microsoft/Boot/bootmgfw.efi
efe3eaf638e25d2d07654842986c6b21 sdc2/Microsoft/Boot/bootmgr.efi
2efa3903d89ff64f51dec6ed96e40941 sdc3/Boot/bootx64.efi
2efa3903d89ff64f51dec6ed96e40941 sdc3/Microsoft/Boot/bootmgfw.efi
edad6ce3a0215d232e1f8ee172737d1a sdc3/Microsoft/Boot/bootmgr.efi
b87d854e443e7fe6609397a3e5bfb74b sda2/Boot/bkpbootx64.efi
b87d854e443e7fe6609397a3e5bfb74b sda2/Boot/bootx64.efi
85fa9d77b929ec4231aba29476574eb6 sda2/Boot/fbx64.efi
469e608783843a701d172242f016c79c sda2/Boot/mmx64.efi
9ebe81104c6771392df1631c521e1378 sda2/refind/refind_x64.efi
b87d854e443e7fe6609397a3e5bfb74b sda2/ubuntu/grubx64.efi
469e608783843a701d172242f016c79c sda2/ubuntu/mmx64.efi
728124f6ec8e22fbdbe7034812c81b95 sda2/ubuntu/shimx64.efi
20ac8dde00311476f3755604eb0e545a sda2/Microsoft/Boot/bootmgfw.efi
27d382c5fc21df6f4a75baed05aa1d9d sda2/Microsoft/Boot/bootmgr.efi
8d7843519407a3e439789c55f2187fd2 sda2/refind/drivers_x64/ext4_x64.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sdb : is-GPT, no-BIOSboot, has-noESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sdd : notGPT, no-BIOSboot, has-noESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
sdc : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, no-os, no-wind, 34 sectors * 512 bytes
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, has-win, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sdb2 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sdd4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sdb3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, grubenv-ng, noupdategrub, farbios
sdb1 : is-os, 64, apt-get, signed grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sdc2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sdc3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda4 : is-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sdc4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
Partitions info (2/3): _________________________________________________________
sdb2 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdd4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, bootmgr, is-winboot
sdb3 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdb1 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdc2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdc3 : isnotESP, 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, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, 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
sdc4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sdb2 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sdb
sdd4 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdd
sdb3 : is---sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdb
sdb1 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sdb
sdc2 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sdc3 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sda4 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda2 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda1 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sdc4 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
fdisk -l (filtered): ___________________________________________________________
Disk sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk identifier: 0F171C48-5858-9090-8081-828310111213
Start End Sectors Size Type
sda1 2048 1023999 1021952 499M Windows recovery environment
sda2 1024000 1228799 204800 100M EFI System
sda3 1228800 1261567 32768 16M Microsoft reserved
sda4 1261568 488396799 487135232 232.3G Microsoft basic data
Disk sdb: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk identifier: 8E2280B5-955B-4975-9DD7-985B424898A5
Start End Sectors Size Type
sdb1 2048 1984765719 1984763672 946.4G Microsoft basic data
sdb2 1984765952 3581986655 1597220704 761.6G Linux filesystem
sdb3 3581986816 7467010047 3885023232 1.8T Linux filesystem
sdb4 7467010048 7814035455 347025408 165.5G Linux swap
Disk sdc: 149.05 GiB, 160041885696 bytes, 312581808 sectors
Disk identifier: 35A8B8AC-B507-4CEF-A407-9A8E09672791
Start End Sectors Size Type
sdc1 2082 3105 1024 512K Microsoft reserved
sdc2 4096 264191 260096 127M EFI System
sdc3 264192 312581774 312317583 148.9G Microsoft LDM data
sdc4 34 2081 2048 1M Microsoft LDM metadata
Partition table entries are not in disk order.
Disk sdd: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk identifier: 0x9a25d517
Boot Start End Sectors Size Id Type
sdd1 * 0 0 0 0B 0 Empty
sdd4 * 2747115 1953471869 1950724755 930.2G 7 HPFS/NTFS/exFAT
parted -lm (filtered): _________________________________________________________
sda:250GB:scsi:512:4096:gpt:ATA Crucial_CT250MX2:;
1:1049kB:524MB:523MB:ntfs:Basic data partition:hidden, diag;
2:524MB:629MB:105MB:fat32:EFI system partition:boot, esp;
3:629MB:646MB:16.8MB::Microsoft reserved partition:msftres;
4:646MB:250GB:249GB:ntfs:Basic data partition:msftdata;
sdb:4001GB:scsi:512:4096:gpt:ATA ST4000VN000-1H41:;
1:1049kB:1016GB:1016GB:ext4:Da Vinci Resolve-Caches:msftdata;
2:1016GB:1834GB:818GB:ext4:Ubuntu 22.04 LTS:;
3:1834GB:3823GB:1989GB:ext4::;
4:3823GB:4001GB:178GB:linux-swap(v1)::swap;
sdc:160GB:scsi:512:512:gpt:ATA WDC WD1600AAJS-0:;
4:17.4kB:1066kB:1049kB::LDM metadata partition:;
1:1066kB:1590kB:524kB::EasyRE Microsoft Reserved:hidden, msftres;
2:2097kB:135MB:133MB:fat32::boot, esp;
3:135MB:160GB:160GB:ntfs:LDM data partition:;
sdd:1000GB:scsi:512:512:msdos:ATA ST31000528AS:;
4:1407MB:1000GB:999GB:ntfs::boot;
Free space >10MiB: ______________________________________________________________
sdd: 0.03MiB:1341MiB:1341MiB
sdd: 953844MiB:953870MiB:26.0MiB
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs AA8C1C848C1C4CE7 74a16772-f71e-446f-83ea-c8293acc997a Récupération Basic data partition
├─sda2 vfat A61D-3B2F 4eb0104e-e8a8-433d-aac7-51d164e1afab EFI system partition
├─sda3 8d3f9c9e-5405-4e1f-b2a3-e34e5c017601 Microsoft reserved partition
└─sda4 ntfs 407A21B27A21A59E 8eaab9e5-c36f-42b5-b548-95538e20f885 Windows 10 - ALAIN Basic data partition
sdb
├─sdb1 ext4 52d1150b-c938-4f90-8ed1-df2497a41974 82746738-173d-4ad1-a20d-5425521068ec Da Vinci Resolve-Caches
├─sdb2 ext4 81cc1007-920c-48f1-b034-37097baeafe2 8b370963-3a7e-4c0c-b15d-2b642310b3b9 Ubuntu 22.04 LTS
├─sdb3 ext4 55daf850-708f-4232-8f8b-ec1a4858bde6 87d7bf75-ab56-4fc6-a3ee-45db8256e32c Ubuntu - Données
└─sdb4 swap 7edb29e3-5dcd-4cb1-83c4-3297773b6594 636c650d-c7d0-40f7-b367-90094e41c132
sdc
├─sdc1 078c82d4-0392-00f7-9ad2-ccee2f61b96b EasyRE Microsoft Reserved
├─sdc2 vfat 8C7E-FDE3 51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9
├─sdc3 ntfs 8CBA0602BA05EA12 8091998b-81ff-11e9-a8c1-309c238c7b41 Insta_TikTok_et_Cache LDM data partition
└─sdc4 2fb730e7-81d2-11e9-a8b4-309c238c7b41 LDM metadata partition
sdd
└─sdd4 ntfs EA2A7E2F2A7DF941 9a25d517-04 Données
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda1 55.7M 89% /mnt/boot-sav/sda1
/dev/sda2 60M 38% /mnt/boot-sav/sda2
/dev/sda4 47.9G 79% /mnt/boot-sav/sda4
/dev/sdb1 869.6G 1% /mnt/boot-sav/sdb1
/dev/sdb2 693.1G 2% /
/dev/sdb3 1.6T 5% /home
/dev/sdc2 92.2M 26% /mnt/boot-sav/sdc2
/dev/sdc3 84.3G 43% /mnt/boot-sav/sdc3
/dev/sdd4 250.3G 73% /mnt/boot-sav/sdd4
Mount options (filtered): ______________________________________________________
==================== sda2/EFI/refind/refind.conf (filtered) ====================
timeout 20
use_nvram false
menuentry Linux {
icon EFI/refind/icons/os_linux.png
volume 904404F8-B481-440C-A1E3-11A5A954E601
loader bzImage-3.3.0-rc7
initrd initrd-3.3.0.img
options "ro root=UUID=5f96cafa-e0a7-4057-b18f-fa709db5b837"
disabled
}
menuentry "Arch Linux" {
icon /EFI/refind/icons/os_arch.png
volume "Arch Linux"
loader /boot/vmlinuz-linux
initrd /boot/initramfs-linux.img
options "root=PARTUUID=5028fa50-0079-4c40-b240-abfaf28693ea rw add_efi_memmap"
submenuentry "Boot using fallback initramfs" {
initrd /boot/initramfs-linux-fallback.img
}
submenuentry "Boot to terminal" {
add_options "systemd.unit=multi-user.target"
}
disabled
}
menuentry Ubuntu {
loader /EFI/ubuntu/grubx64.efi
icon /EFI/refind/icons/os_linux.png
disabled
}
menuentry "ELILO" {
loader \EFI\elilo\elilo.efi
disabled
}
menuentry "Windows 7" {
loader \EFI\Microsoft\Boot\bootmgfw.efi
disabled
}
menuentry "Windows via shell script" {
icon \EFI\refind\icons\os_win.png
loader \EFI\tools\shell.efi
options "fs0:\EFI\tools\launch_windows.nsh"
disabled
}
menuentry "My macOS" {
icon \EFI\refind\icons\os_mac.png
volume "macOS boot"
loader \System\Library\CoreServices\boot.efi
disabled
}
menuentry "macOS via BootNext" {
icon /EFI/refind/icons/os_mac.png
firmware_bootnum 80
disabled
}
===================== sda2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid 52d1150b-c938-4f90-8ed1-df2497a41974 root hd1,gpt1
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
====================== sdb1/boot/grub/grub.cfg (filtered) ======================
Ubuntu 22.10 (22.10) (sur sdb2) 81cc1007-920c-48f1-b034-37097baeafe2
### END /etc/grub.d/30_os-prober_proxy ###
Ubuntu 20.04 LTS 52d1150b-c938-4f90-8ed1-df2497a41974
Windows Boot Manager (sur sda2) osprober-efi-A61D-3B2F
Windows Boot Manager (sur sdc2) osprober-efi-8C7E-FDE3
UEFI Firmware Settings uefi-firmware
========================== sdb1/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=52d1150b-c938-4f90-8ed1-df2497a41974 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=A61D-3B2F /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb3 during installation
UUID=55daf850-708f-4232-8f8b-ec1a4858bde6 /home ext4 defaults 0 2
# swap was on /dev/sdb4 during installation
UUID=7edb29e3-5dcd-4cb1-83c4-3297773b6594 none swap sw 0 0
======================= sdb1/etc/default/grub (filtered) =======================
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="menu"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER="false"
==================== sdb1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
536,126697540 = 575,661658112 boot/grub/grub.cfg 2
112,136638641 = 120,405798912 boot/vmlinuz 2
107,722576141 = 115,666235392 boot/vmlinuz-5.15.0-57-generic 1
112,136638641 = 120,405798912 boot/vmlinuz-5.15.0-58-generic 2
107,722576141 = 115,666235392 boot/vmlinuz.old 1
113,058181763 = 121,395298304 boot/initrd.img 1
295,378494263 = 317,160243200 boot/initrd.img-5.15.0-57-generic 4
113,058181763 = 121,395298304 boot/initrd.img-5.15.0-58-generic 1
295,378494263 = 317,160243200 boot/initrd.img.old 4
===================== sdb1: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 728 Jan 21 11:12 10_linux_proxy
-rwxr-xr-x 1 root root 1261 Jan 21 11:12 30_os-prober_proxy
-rwxr-xr-x 1 root root 728 Jan 21 11:12 31_linux_proxy
-rwxr-xr-x 1 root root 42359 Dec 2 16:20 33_linux_zfs
-rwxr-xr-x 1 root root 12894 Dec 2 16:20 34_linux_xen
-rwxr-xr-x 1 root root 1261 Jan 21 11:12 35_os-prober_proxy
-rwxr-xr-x 1 root root 1424 Dec 2 16:20 36_uefi-firmware
-rwxr-xr-x 1 root root 214 Dec 2 16:20 40_custom
-rwxr-xr-x 1 root root 216 Dec 2 16:20 41_custom
drwxr-xr-x 4 root root 4096 Jan 21 11:12 backup
drwxr-xr-x 2 root root 4096 Jan 21 11:12 bin
drwxr-xr-x 2 root root 4096 Jan 21 11:12 proxifiedScripts
======================== sdb1/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'~65f00c957859740459591bcf757f486e~ as 'Ubuntu 20.04 LTS'
-*
-#text
-'SUBMENU' as 'Options avancées pour Ubuntu'{-'Options avancées pour Ubuntu'/*, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-58-generic'~f8385c762a3c34934c07aa6d6985556a~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-58-generic (recovery mode)'~0fb0b958485591445cc95cebe536374f~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-57-generic'~937d77aa392a9e082d61734fb19c1221~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-57-generic (recovery mode)'~c857a5f4db9f305097a3fe019b5a3403~}
"
========================= sdb1/etc/grub.d/33_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
========================= sdb1/etc/grub.d/34_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"
====================== sdb1/etc/grub.d/35_os-prober_proxy ======================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu 22.10 (22.10) (sur /dev/sdb2)'~a279270903245262f1c28dafac16432b~
+'Windows Boot Manager (sur /dev/sda2)'~3abe98b52f408f68ea512e34b3bdc4a0~
-'SUBMENU' as 'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'{-'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/*, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu 22.10 (sur /dev/sdb2)'~528c1a9e6fd6839898de3292627a7370~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-29-generic (sur /dev/sdb2)'~528c1a9e6fd6839898de3292627a7370~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-29-generic (recovery mode) (sur /dev/sdb2)'~b15efa9fefe450233af5eb5edcd81f89~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-28-generic (sur /dev/sdb2)'~e244bdc6c0dddce932fc85e696153bae~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-28-generic (recovery mode) (sur /dev/sdb2)'~5d9450992b6350c4b1bf378dc7533741~}
+'Windows Boot Manager (sur /dev/sdc2)'~35cc3beed79b8e35690a274f842e7615~
"
======================= sdb1/etc/grub.d/36_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
====================== sdb2/boot/grub/grub.cfg (filtered) ======================
Ubuntu 22.10 81cc1007-920c-48f1-b034-37097baeafe2
Ubuntu, with Linux 5.19.0-29-generic 81cc1007-920c-48f1-b034-37097baeafe2
Ubuntu, with Linux 5.19.0-28-generic 81cc1007-920c-48f1-b034-37097baeafe2
Ubuntu 20.04.5 LTS (20.04) (on sdb1) 52d1150b-c938-4f90-8ed1-df2497a41974
Ubuntu 20.04 LTS (sur sdb1) (on sdb1) 52d1150b-c938-4f90-8ed1-df2497a41974
Windows Boot Manager (on sda2) osprober-efi-A61D-3B2F
### END /etc/grub.d/30_os-prober_proxy ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sdb2/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb2 during installation
UUID=81cc1007-920c-48f1-b034-37097baeafe2 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=A61D-3B2F /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb3 during installation
UUID=55daf850-708f-4232-8f8b-ec1a4858bde6 /home ext4 defaults 0 2
# swap was on /dev/sdb4 during installation
UUID=7edb29e3-5dcd-4cb1-83c4-3297773b6594 none swap sw 0 0
======================= sdb2/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=""
==================== sdb2: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
1158,541923523 = 1243,974918144 boot/grub/grub.cfg 1
995,327705383 = 1068,724985856 boot/vmlinuz 1
1159,702705383 = 1245,221298176 boot/vmlinuz-5.19.0-28-generic 1
995,327705383 = 1068,724985856 boot/vmlinuz-5.19.0-29-generic 1
1159,702705383 = 1245,221298176 boot/vmlinuz.old 1
1435,653873444 = 1541,521608704 boot/initrd.img 1
1472,027339935 = 1580,577320960 boot/initrd.img-5.19.0-28-generic 5
1435,653873444 = 1541,521608704 boot/initrd.img-5.19.0-29-generic 1
1472,027339935 = 1580,577320960 boot/initrd.img.old 5
===================== sdb2: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 712 Jan 4 13:04 10_linux_proxy
-rwxr-xr-x 1 root root 43263 Sep 19 16:00 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Sep 19 16:00 20_linux_xen
-rwxr-xr-x 1 root root 270 Jan 4 13:04 30_os-prober_proxy
-rwxr-xr-x 1 root root 1372 Sep 19 16:00 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Aug 30 20:33 35_fwupd
-rwxr-xr-x 1 root root 214 Sep 19 16:00 40_custom
-rwxr-xr-x 1 root root 215 Sep 19 16:00 41_custom
drwxr-xr-x 4 root root 4096 Jan 4 11:42 backup
drwxr-xr-x 2 root root 4096 Jan 4 11:42 bin
drwxr-xr-x 2 root root 4096 Jan 4 13:04 proxifiedScripts
======================== sdb3/grub/grub.cfg (filtered) =========================
Ubuntu aa7f712b-2fd9-4fa8-830e-91afa13969ab
Ubuntu, with Linux 5.15.0-56-generic aa7f712b-2fd9-4fa8-830e-91afa13969ab
Ubuntu, with Linux 5.15.0-43-generic aa7f712b-2fd9-4fa8-830e-91afa13969ab
Windows Boot Manager (on sda2) osprober-efi-A61D-3B2F
Windows Boot Manager (on sdc2) osprober-efi-8C7E-FDE3
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
==================== sdb3: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
2664,166999817 = 2860,627533824 grub/grub.cfg 1
1708,636734009 = 1834,634723328 vmlinuz 1
1708,172847748 = 1834,136629248 vmlinuz-5.15.0-43-generic 2
1708,636734009 = 1834,634723328 vmlinuz-5.15.0-56-generic 1
1708,172847748 = 1834,136629248 vmlinuz.old 2
1724,208442688 = 1851,354718208 initrd.img 1
1724,019996643 = 1851,152375808 initrd.img-5.15.0-43-generic 1
1724,208442688 = 1851,354718208 initrd.img-5.15.0-56-generic 1
1724,019996643 = 1851,152375808 initrd.img.old 1
===================== sdc2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid 830361cb-cc32-43d2-97c7-103f9e0a7ff7 root hd0,gpt2
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to unsign) and reinstall the grub-efi of
sdb2,
using the following options: sda2/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 Ubuntu 22.10 entry (sda2/efi/****/grub****.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\****\grub****.efi (**** will be updated in the final message)
Dernière modification par Doc Brown (Le 27/01/2023, à 16:26)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#2 Le 25/01/2023, à 12:51
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Bonjour
Je vois un certain nombres d'anomalies.
1) Le boot standard n'est pas sur refind ou ubuntu.
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0004,0005,0006,0055,0057,0000,0065,0066,0003,0002
Boot0000* Windows Boot Manager HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0002 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0003 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0004* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0005* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\GRUBX64.EFI)
Je te propose de choisir ubuntu
sudo efibootmgr -o 5,4
2) Le disque SDD est mal constitué et il contient des données!
Disk sdd: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk identifier: 0x9a25d517
Boot Start End Sectors Size Id Type
sdd1 * 0 0 0 0B 0 Empty
sdd4 * 2747115 1953471869 1950724755 930.2G 7 HPFS/NTFS/exFAT
Avail Use% Mounted on
/dev/sdd4 250.3G 73% /mnt/boot-sav/sdd4
Free space >10MiB: ______________________________________________________________
sdd: 0.03MiB:1341MiB:1341MiB
sdd: 953844MiB:953870MiB:26.0MiB
3) Refind est installé et il n'est pas utilisé
Que faire? l'utiliser? le supprimer?
4) Des entrées EFI sont régulièrement ajoutées dans la RAM. Il y certainement quelque chose qui ne va pas.
Boot0037* CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0051 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0054* Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0055* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0057* Windows Boot Manager HD(3,GPT,8091998b-81ff-11e9-a8c1-309c238c7b41,0x40800,0x129d968f)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0065* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Boot0066* ubuntu HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Pour les supprimer:
sudo efibootmgr -B -b 37
sudo efibootmgr -B -b 51
sudo efibootmgr -B -b 54
sudo efibootmgr -B -b 55
sudo efibootmgr -B -b 57
sudo efibootmgr -B -b 65
sudo efibootmgr -B -b 66
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#3 Le 25/01/2023, à 13:33
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
@ geole Merci pour ton support !
J'ai exécuté toutes les commandes suggérées et malgré cela, il faut que je boot avec F11, l'ordre des boot proposés a changé et c'est mieux.
Je n'ai cependant pas de boot automatique.
Faut-il refaire Boot-info ?
Dernière modification par Doc Brown (Le 25/01/2023, à 13:42)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#4 Le 25/01/2023, à 13:35
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Oui
et dit si tu as un boot automatique sur quelque chose si tu ne fais pas de choix
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#5 Le 25/01/2023, à 14:35
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Pas de démarrage automatique
Paste from boot-info 25 January 2023 13:32 +0000
Syntax highlighting: bash
View raw
boot-info-4ppa203 [20230125_1428]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
=> Grub2 (v2.00) is installed in the MBR of /dev/sdb and looks at sector
2165660368 of the same hard drive for core.img. core.img is at this
location and looks for (,gpt2)/boot/grub. It also embeds following
components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_gpt biosdisk
---------------------------------------------------------------------------
=> Windows 7/8/10/11/2012 is installed in the MBR of /dev/sdc.
=> Syslinux MBR (4.04-4.07) is installed in the MBR of /dev/sdd.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/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/10/11/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /EFI/refind/refind.conf /efi/Boot/bkpbootx64.efi
/efi/Boot/bootx64.efi /efi/Boot/fbx64.efi
/efi/Boot/mmx64.efi /efi/refind/refind_x64.efi
/efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
/efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/refind/drivers_x64/ext4_x64.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 10 or 11
Boot files: /Windows/System32/winload.exe
sdb1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.5 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.10
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb3: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /grub/grub.cfg
sdb4: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sdc1: __________________________________________________________________________
File system:
Boot sector type: Unknown
Boot sector info:
sdc2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/10/11/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/mmx64.efi
/efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
/efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
sdc3: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: According to the info in the boot sector, sdc3 starts
at sector 29. But according to the info from fdisk,
sdc3 starts at sector 264192. According to the info in
the boot sector, sdc3 has 312313855 sectors, but
according to the info from fdisk, it has 312317582
sectors.
Operating System:
Boot files:
sdc4: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sdd4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD
================================ 3 OS detected =================================
OS#1: Ubuntu 20.04.5 LTS on sdb1
OS#2: Ubuntu 22.10 on sdb2
OS#3: Windows 10 or 11 on sda4
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: GP104 [GeForce GTX 1060 6GB] EFI VGA from NVIDIA Corporation
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.19.0-29-generic root=UUID=81cc1007-920c-48f1-b034-37097baeafe2 ro quiet splash
df -Th / : /dev/sdb2 ext4 749G 18G 694G 3% /
===================================== UEFI =====================================
BIOS/UEFI firmware: A.A0(5.12) from American Megatrends Inc.
The firmware is EFI-compatible, and is set in EFI-mode for this installed-session.
SecureBoot disabled (confirmed by mokutil).
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0005,0004
Boot0000* Windows Boot Manager HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...a................
Boot0002 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0003 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0004* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0005* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\GRUBX64.EFI)
Boot0006 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
Boot0007 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.-.R.E. . .B.H.1.0.L.S.3.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.B.K.9.1.0.9.3.7. .3. . . . . . . . ........BO
Boot0009* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Boot000A* ubuntu HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\UBUNTU\SHIMX64.EFI)..BO
Boot000B* Windows Boot Manager HD(3,GPT,8091998b-81ff-11e9-a8c1-309c238c7b41,0x40800,0x129d968f)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot002A* Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........C.r.u.c.i.a.l._.C.T.2.5.0.M.X.2.0.0.S.S.D.1...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . .5.1.5.4.1.1.6.0.9.B.B.8........BO..NO..........S.a.n.D.i.s.k. .S.D.S.S.D.H.P.2.5.6.G...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.3.1.4.4.6.0.1.4.7.3.5.3. . . . . . . . ........BO..NO..........W.D.C. .W.D.1.6.0.0.A.A.J.S.-.0.8.L.7.A.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.V.A.6.3.1.3.6.3.9.3........BO..NO..........S.T.4.0.0.0.V.N.0.0.0.-.1.H.4.1.6.8...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .3.Z.5.0.J.P.L.R........BO..NO..........S.T.3.1.0.0.0.5.2.8.A.S...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.5.3.P.Q.Z.6.Z........BO
728124f6ec8e22fbdbe7034812c81b95 sdc2/BOOT/bkpbootx64.efi
b87d854e443e7fe6609397a3e5bfb74b sdc2/BOOT/bootx64.efi
c152ec201c37b6e97bbc2207e49d1271 sdc2/BOOT/fbx64.efi
fdafb5eece6caeccb788c946a28e6872 sdc2/BOOT/mmx64.efi
3795ef72a4ed0369ca44e711527904bf sdc2/ubuntu/grubx64.efi
fdafb5eece6caeccb788c946a28e6872 sdc2/ubuntu/mmx64.efi
728124f6ec8e22fbdbe7034812c81b95 sdc2/ubuntu/shimx64.efi
2fa8904690cb2325fb80a4cc8250430f sdc2/Microsoft/Boot/bootmgfw.efi
efe3eaf638e25d2d07654842986c6b21 sdc2/Microsoft/Boot/bootmgr.efi
2efa3903d89ff64f51dec6ed96e40941 sdc3/Boot/bootx64.efi
2efa3903d89ff64f51dec6ed96e40941 sdc3/Microsoft/Boot/bootmgfw.efi
edad6ce3a0215d232e1f8ee172737d1a sdc3/Microsoft/Boot/bootmgr.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sdb : is-GPT, no-BIOSboot, has-noESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sdd : notGPT, no-BIOSboot, has-noESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
sdc : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, no-os, no-wind, 34 sectors * 512 bytes
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, has-win, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sdb2 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sdd4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sdb3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, grubenv-ng, noupdategrub, farbios
sdb1 : is-os, 64, apt-get, signed grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sdc2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sdc3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda4 : is-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sdc4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
Partitions info (2/3): _________________________________________________________
sdb2 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdd4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, bootmgr, is-winboot
sdb3 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdb1 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdc2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdc3 : isnotESP, 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, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, 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
sdc4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sdb2 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sdb
sdd4 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdd
sdb3 : is---sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdb
sdb1 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sdb
sdc2 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sdc3 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sda4 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda2 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda1 : not--sepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sdc4 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
fdisk -l (filtered): ___________________________________________________________
Disk sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk identifier: 0F171C48-5858-9090-8081-828310111213
Start End Sectors Size Type
sda1 2048 1023999 1021952 499M Windows recovery environment
sda2 1024000 1228799 204800 100M EFI System
sda3 1228800 1261567 32768 16M Microsoft reserved
sda4 1261568 488396799 487135232 232.3G Microsoft basic data
Disk sdb: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk identifier: 8E2280B5-955B-4975-9DD7-985B424898A5
Start End Sectors Size Type
sdb1 2048 1984765719 1984763672 946.4G Microsoft basic data
sdb2 1984765952 3581986655 1597220704 761.6G Linux filesystem
sdb3 3581986816 7467010047 3885023232 1.8T Linux filesystem
sdb4 7467010048 7814035455 347025408 165.5G Linux swap
Disk sdc: 149.05 GiB, 160041885696 bytes, 312581808 sectors
Disk identifier: 35A8B8AC-B507-4CEF-A407-9A8E09672791
Start End Sectors Size Type
sdc1 2082 3105 1024 512K Microsoft reserved
sdc2 4096 264191 260096 127M EFI System
sdc3 264192 312581774 312317583 148.9G Microsoft LDM data
sdc4 34 2081 2048 1M Microsoft LDM metadata
Partition table entries are not in disk order.
Disk sdd: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk identifier: 0x9a25d517
Boot Start End Sectors Size Id Type
sdd1 * 0 0 0 0B 0 Empty
sdd4 * 2747115 1953471869 1950724755 930.2G 7 HPFS/NTFS/exFAT
parted -lm (filtered): _________________________________________________________
sda:250GB:scsi:512:4096:gpt:ATA Crucial_CT250MX2:;
1:1049kB:524MB:523MB:ntfs:Basic data partition:hidden, diag;
2:524MB:629MB:105MB:fat32:EFI system partition:boot, esp;
3:629MB:646MB:16.8MB::Microsoft reserved partition:msftres;
4:646MB:250GB:249GB:ntfs:Basic data partition:msftdata;
sdb:4001GB:scsi:512:4096:gpt:ATA ST4000VN000-1H41:;
1:1049kB:1016GB:1016GB:ext4:Da Vinci Resolve-Caches:msftdata;
2:1016GB:1834GB:818GB:ext4:Ubuntu 22.04 LTS:;
3:1834GB:3823GB:1989GB:ext4::;
4:3823GB:4001GB:178GB:linux-swap(v1)::swap;
sdc:160GB:scsi:512:512:gpt:ATA WDC WD1600AAJS-0:;
4:17.4kB:1066kB:1049kB::LDM metadata partition:;
1:1066kB:1590kB:524kB::EasyRE Microsoft Reserved:hidden, msftres;
2:2097kB:135MB:133MB:fat32::boot, esp;
3:135MB:160GB:160GB:ntfs:LDM data partition:;
sdd:1000GB:scsi:512:512:msdos:ATA ST31000528AS:;
4:1407MB:1000GB:999GB:ntfs::boot;
Free space >10MiB: ______________________________________________________________
sdd: 0.03MiB:1341MiB:1341MiB
sdd: 953844MiB:953870MiB:26.0MiB
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs AA8C1C848C1C4CE7 74a16772-f71e-446f-83ea-c8293acc997a Récupération Basic data partition
├─sda2 vfat A61D-3B2F 4eb0104e-e8a8-433d-aac7-51d164e1afab EFI system partition
├─sda3 8d3f9c9e-5405-4e1f-b2a3-e34e5c017601 Microsoft reserved partition
└─sda4 ntfs 407A21B27A21A59E 8eaab9e5-c36f-42b5-b548-95538e20f885 Windows 10 - ALAIN Basic data partition
sdb
├─sdb1 ext4 52d1150b-c938-4f90-8ed1-df2497a41974 82746738-173d-4ad1-a20d-5425521068ec Da Vinci Resolve-Caches
├─sdb2 ext4 81cc1007-920c-48f1-b034-37097baeafe2 8b370963-3a7e-4c0c-b15d-2b642310b3b9 Ubuntu 22.04 LTS
├─sdb3 ext4 55daf850-708f-4232-8f8b-ec1a4858bde6 87d7bf75-ab56-4fc6-a3ee-45db8256e32c Ubuntu - Données
└─sdb4 swap 7edb29e3-5dcd-4cb1-83c4-3297773b6594 636c650d-c7d0-40f7-b367-90094e41c132
sdc
├─sdc1 078c82d4-0392-00f7-9ad2-ccee2f61b96b EasyRE Microsoft Reserved
├─sdc2 vfat 8C7E-FDE3 51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9
├─sdc3 ntfs 8CBA0602BA05EA12 8091998b-81ff-11e9-a8c1-309c238c7b41 Insta_TikTok_et_Cache LDM data partition
└─sdc4 2fb730e7-81d2-11e9-a8b4-309c238c7b41 LDM metadata partition
sdd
└─sdd4 ntfs EA2A7E2F2A7DF941 9a25d517-04 Données
sde
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda1 55.7M 89% /mnt/boot-sav/sda1
/dev/sda4 47.9G 79% /mnt/boot-sav/sda4
/dev/sdb1 869.6G 1% /mnt/boot-sav/sdb1
/dev/sdb2 693.1G 2% /
/dev/sdb3 1.6T 5% /home
/dev/sdc2 92.2M 26% /mnt/boot-sav/sdc2
/dev/sdc3 84.3G 43% /mnt/boot-sav/sdc3
/dev/sdd4 250.3G 73% /mnt/boot-sav/sdd4
Mount options (filtered): ______________________________________________________
==================== sda2/EFI/refind/refind.conf (filtered) ====================
timeout 20
use_nvram false
menuentry Linux {
icon EFI/refind/icons/os_linux.png
volume 904404F8-B481-440C-A1E3-11A5A954E601
loader bzImage-3.3.0-rc7
initrd initrd-3.3.0.img
options "ro root=UUID=5f96cafa-e0a7-4057-b18f-fa709db5b837"
disabled
}
menuentry "Arch Linux" {
icon /EFI/refind/icons/os_arch.png
volume "Arch Linux"
loader /boot/vmlinuz-linux
initrd /boot/initramfs-linux.img
options "root=PARTUUID=5028fa50-0079-4c40-b240-abfaf28693ea rw add_efi_memmap"
submenuentry "Boot using fallback initramfs" {
initrd /boot/initramfs-linux-fallback.img
}
submenuentry "Boot to terminal" {
add_options "systemd.unit=multi-user.target"
}
disabled
}
menuentry Ubuntu {
loader /EFI/ubuntu/grubx64.efi
icon /EFI/refind/icons/os_linux.png
disabled
}
menuentry "ELILO" {
loader \EFI\elilo\elilo.efi
disabled
}
menuentry "Windows 7" {
loader \EFI\Microsoft\Boot\bootmgfw.efi
disabled
}
menuentry "Windows via shell script" {
icon \EFI\refind\icons\os_win.png
loader \EFI\tools\shell.efi
options "fs0:\EFI\tools\launch_windows.nsh"
disabled
}
menuentry "My macOS" {
icon \EFI\refind\icons\os_mac.png
volume "macOS boot"
loader \System\Library\CoreServices\boot.efi
disabled
}
menuentry "macOS via BootNext" {
icon /EFI/refind/icons/os_mac.png
firmware_bootnum 80
disabled
}
===================== sda2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid 52d1150b-c938-4f90-8ed1-df2497a41974 root hd1,gpt1
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
====================== sdb1/boot/grub/grub.cfg (filtered) ======================
Ubuntu 22.10 (22.10) (sur sdb2) 81cc1007-920c-48f1-b034-37097baeafe2
### END /etc/grub.d/30_os-prober_proxy ###
Ubuntu 20.04 LTS 52d1150b-c938-4f90-8ed1-df2497a41974
Windows Boot Manager (sur sda2) osprober-efi-A61D-3B2F
Windows Boot Manager (sur sdc2) osprober-efi-8C7E-FDE3
UEFI Firmware Settings uefi-firmware
========================== sdb1/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=52d1150b-c938-4f90-8ed1-df2497a41974 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=A61D-3B2F /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb3 during installation
UUID=55daf850-708f-4232-8f8b-ec1a4858bde6 /home ext4 defaults 0 2
# swap was on /dev/sdb4 during installation
UUID=7edb29e3-5dcd-4cb1-83c4-3297773b6594 none swap sw 0 0
======================= sdb1/etc/default/grub (filtered) =======================
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="menu"
GRUB_TIMEOUT="10"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER="false"
==================== sdb1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
536,126697540 = 575,661658112 boot/grub/grub.cfg 2
112,136638641 = 120,405798912 boot/vmlinuz 2
107,722576141 = 115,666235392 boot/vmlinuz-5.15.0-57-generic 1
112,136638641 = 120,405798912 boot/vmlinuz-5.15.0-58-generic 2
107,722576141 = 115,666235392 boot/vmlinuz.old 1
113,058181763 = 121,395298304 boot/initrd.img 1
295,378494263 = 317,160243200 boot/initrd.img-5.15.0-57-generic 4
113,058181763 = 121,395298304 boot/initrd.img-5.15.0-58-generic 1
295,378494263 = 317,160243200 boot/initrd.img.old 4
===================== sdb1: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 728 Jan 21 11:12 10_linux_proxy
-rwxr-xr-x 1 root root 1261 Jan 21 11:12 30_os-prober_proxy
-rwxr-xr-x 1 root root 728 Jan 21 11:12 31_linux_proxy
-rwxr-xr-x 1 root root 42359 Dec 2 16:20 33_linux_zfs
-rwxr-xr-x 1 root root 12894 Dec 2 16:20 34_linux_xen
-rwxr-xr-x 1 root root 1261 Jan 21 11:12 35_os-prober_proxy
-rwxr-xr-x 1 root root 1424 Dec 2 16:20 36_uefi-firmware
-rwxr-xr-x 1 root root 214 Dec 2 16:20 40_custom
-rwxr-xr-x 1 root root 216 Dec 2 16:20 41_custom
drwxr-xr-x 4 root root 4096 Jan 21 11:12 backup
drwxr-xr-x 2 root root 4096 Jan 21 11:12 bin
drwxr-xr-x 2 root root 4096 Jan 21 11:12 proxifiedScripts
======================== sdb1/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'~65f00c957859740459591bcf757f486e~ as 'Ubuntu 20.04 LTS'
-*
-#text
-'SUBMENU' as 'Options avancées pour Ubuntu'{-'Options avancées pour Ubuntu'/*, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-58-generic'~f8385c762a3c34934c07aa6d6985556a~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-58-generic (recovery mode)'~0fb0b958485591445cc95cebe536374f~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-57-generic'~937d77aa392a9e082d61734fb19c1221~, -'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.15.0-57-generic (recovery mode)'~c857a5f4db9f305097a3fe019b5a3403~}
"
========================= sdb1/etc/grub.d/33_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
========================= sdb1/etc/grub.d/34_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"
====================== sdb1/etc/grub.d/35_os-prober_proxy ======================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu 22.10 (22.10) (sur /dev/sdb2)'~a279270903245262f1c28dafac16432b~
+'Windows Boot Manager (sur /dev/sda2)'~3abe98b52f408f68ea512e34b3bdc4a0~
-'SUBMENU' as 'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'{-'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/*, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu 22.10 (sur /dev/sdb2)'~528c1a9e6fd6839898de3292627a7370~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-29-generic (sur /dev/sdb2)'~528c1a9e6fd6839898de3292627a7370~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-29-generic (recovery mode) (sur /dev/sdb2)'~b15efa9fefe450233af5eb5edcd81f89~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-28-generic (sur /dev/sdb2)'~e244bdc6c0dddce932fc85e696153bae~, -'Options avancées pour Ubuntu 22.10 (22.10) (sur /dev/sdb2)'/'Ubuntu, with Linux 5.19.0-28-generic (recovery mode) (sur /dev/sdb2)'~5d9450992b6350c4b1bf378dc7533741~}
+'Windows Boot Manager (sur /dev/sdc2)'~35cc3beed79b8e35690a274f842e7615~
"
======================= sdb1/etc/grub.d/36_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
====================== sdb2/boot/grub/grub.cfg (filtered) ======================
Ubuntu 22.10 81cc1007-920c-48f1-b034-37097baeafe2
Ubuntu, with Linux 5.19.0-29-generic 81cc1007-920c-48f1-b034-37097baeafe2
Ubuntu, with Linux 5.19.0-28-generic 81cc1007-920c-48f1-b034-37097baeafe2
Ubuntu 20.04.5 LTS (20.04) (on sdb1) 52d1150b-c938-4f90-8ed1-df2497a41974
Ubuntu 20.04 LTS (sur sdb1) (on sdb1) 52d1150b-c938-4f90-8ed1-df2497a41974
Windows Boot Manager (on sda2) osprober-efi-A61D-3B2F
### END /etc/grub.d/30_os-prober_proxy ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sdb2/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb2 during installation
UUID=81cc1007-920c-48f1-b034-37097baeafe2 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=A61D-3B2F /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb3 during installation
UUID=55daf850-708f-4232-8f8b-ec1a4858bde6 /home ext4 defaults 0 2
# swap was on /dev/sdb4 during installation
UUID=7edb29e3-5dcd-4cb1-83c4-3297773b6594 none swap sw 0 0
======================= sdb2/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=""
==================== sdb2: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
1158,541923523 = 1243,974918144 boot/grub/grub.cfg 1
995,327705383 = 1068,724985856 boot/vmlinuz 1
1159,702705383 = 1245,221298176 boot/vmlinuz-5.19.0-28-generic 1
995,327705383 = 1068,724985856 boot/vmlinuz-5.19.0-29-generic 1
1159,702705383 = 1245,221298176 boot/vmlinuz.old 1
1435,653873444 = 1541,521608704 boot/initrd.img 1
1472,027339935 = 1580,577320960 boot/initrd.img-5.19.0-28-generic 5
1435,653873444 = 1541,521608704 boot/initrd.img-5.19.0-29-generic 1
1472,027339935 = 1580,577320960 boot/initrd.img.old 5
===================== sdb2: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 712 Jan 4 13:04 10_linux_proxy
-rwxr-xr-x 1 root root 43263 Sep 19 16:00 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Sep 19 16:00 20_linux_xen
-rwxr-xr-x 1 root root 270 Jan 4 13:04 30_os-prober_proxy
-rwxr-xr-x 1 root root 1372 Sep 19 16:00 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Aug 30 20:33 35_fwupd
-rwxr-xr-x 1 root root 214 Sep 19 16:00 40_custom
-rwxr-xr-x 1 root root 215 Sep 19 16:00 41_custom
drwxr-xr-x 4 root root 4096 Jan 4 11:42 backup
drwxr-xr-x 2 root root 4096 Jan 4 11:42 bin
drwxr-xr-x 2 root root 4096 Jan 4 13:04 proxifiedScripts
======================== sdb3/grub/grub.cfg (filtered) =========================
Ubuntu aa7f712b-2fd9-4fa8-830e-91afa13969ab
Ubuntu, with Linux 5.15.0-56-generic aa7f712b-2fd9-4fa8-830e-91afa13969ab
Ubuntu, with Linux 5.15.0-43-generic aa7f712b-2fd9-4fa8-830e-91afa13969ab
Windows Boot Manager (on sda2) osprober-efi-A61D-3B2F
Windows Boot Manager (on sdc2) osprober-efi-8C7E-FDE3
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
==================== sdb3: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
2664,166999817 = 2860,627533824 grub/grub.cfg 1
1708,636734009 = 1834,634723328 vmlinuz 1
1708,172847748 = 1834,136629248 vmlinuz-5.15.0-43-generic 2
1708,636734009 = 1834,634723328 vmlinuz-5.15.0-56-generic 1
1708,172847748 = 1834,136629248 vmlinuz.old 2
1724,208442688 = 1851,354718208 initrd.img 1
1724,019996643 = 1851,152375808 initrd.img-5.15.0-43-generic 1
1724,208442688 = 1851,354718208 initrd.img-5.15.0-56-generic 1
1724,019996643 = 1851,152375808 initrd.img.old 1
===================== sdc2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid 830361cb-cc32-43d2-97c7-103f9e0a7ff7 root hd0,gpt2
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to unsign) and reinstall the grub-efi of
sdb2,
using the following options: sda2/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 Ubuntu 22.10 entry (sda2/efi/****/grub****.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\****\grub****.efi (**** will be updated in the final message)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#6 Le 25/01/2023, à 15:19
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Pas de démarrage automatique
Si tu le veux bien, tu vas poster tous les onglets du bios et on va chercher l'endroit où il pourrait être indiqué
Qu'elle est la marque de ta carte mère?
sudo dmidecode -t2
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#7 Le 25/01/2023, à 15:37
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
alain@alain-Tour:~$ sudo dmidecode -t2
[sudo] Mot de passe de alain :
# dmidecode 3.4
Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.
Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: Micro-Star International Co., Ltd.
Product Name: Z370 GAMING PRO CARBON (MS-7B45)
Version: 2.0
Serial Number: I116877130
Asset Tag: Default string
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Default string
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0
alain@alain-Tour:~$
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#8 Le 25/01/2023, à 17:36
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Pourrais-tu regarder qu'elle est sa version.
Il me semble avoir trouvé un document de référence https://fr.msi.com/Motherboard/Z370-GAM … ON/support
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#9 Le 25/01/2023, à 18:20
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#10 Le 25/01/2023, à 18:34
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Oui à deux titres
1) La version de ton bios est E7B45IMS.AA0 donc le fichier de référence ne convient pas car E7B45Vxx
2) On voit que ton bios est positionné prioritairement en LEGACY alors que les fichiers de boot sont en EFI
Mais, je ne sais pas du tout comment faire le changement,, Appuie sur la touche F7 pour voir ce qui va être proposé.
Je note cela.... Il fallait y penser
Why the BIOS version in BIOS setup menu is different from the version on the website?
LastUpdate : Wed, 11 Apr 2018
AnswerThey are the same version. For example, the version on the website is 7B58v11 and it shows E7B58IMS.110 in BIOS setup menu.
Si je traduis bien E7B45IMS.AA0 > 7B45vaa ??
Donc, tu aurais au moins une version en attente d'installation.....
Ta version actuelle:
AMI BIOS 7B45vAA 2020-01-108.06 MB - Update Microcode. - Improved TPM function.
Celle qui apporte des améliorations:
AMI BIOS7B45vAB 2020-06-108.07 MB - Improved memory compatibility. - Update Intel Micro code for security vulnerabilities
Celle qui va supporter windows 11. A toi de savoir si tu vas utiliser windows11.
AMI BIOS7B45vAC3 (Beta version)2022-03-108.08 MB - Windows 11 Supported. - Support Re-size Bar function
Dernière modification par geole (Le 25/01/2023, à 19:46)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#11 Le 25/01/2023, à 19:07
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
En mettant le boot sur cette option => aucun démarrage et plantage direct
Par contre avec l'option ci dessous => affichage des démarrage possibles ci contre
D'ailleurs avec ta commande
sudo efibootmgr -o 5,4
il y a eu changement des ordres des boot
Du coup serait-il possible de faire passer en première ligne, la ligne actuelle N°2 : ubuntu (P0:Crucial_CT250MX200SSD)
Dernière modification par Doc Brown (Le 25/01/2023, à 19:08)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#12 Le 25/01/2023, à 19:19
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Dans cet écran https://i.postimg.cc/wysc5kJZ/20230125-185146.jpg
peux-tu descendre sur la dernière ligne "entrer dans les réglages".
D’après le boot-info, l’ordre serait bon.
BootOrder: 0005,0004
Boot0004* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0005* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\GRUBX64.EFI)
Pas trop surprenant que cela plante lorsque tu sélectionnes EFI ==> Regarde le ligne du bas qui liste les périphériques EFI, elle n’affiche rien.
Dernière modification par geole (Le 25/01/2023, à 19:30)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#13 Le 25/01/2023, à 19:26
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Quand je démarre avec Boot0005* ubuntu, s’affiche un autre menu contenant Windows.
Je peux envisager de faire cette commande, sans tout planter, pour booter avec Ubuntu ?
sudo efibootmgr -o 4,5
Dernière modification par Doc Brown (Le 25/01/2023, à 19:26)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#14 Le 25/01/2023, à 19:27
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Cette commande devrait faire booter windows...
Dernière modification par geole (Le 25/01/2023, à 19:27)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#15 Le 25/01/2023, à 20:11
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Avec cette commande
sudo efibootmgr -o 4,5
La précédente ligne 5 S'est montée en 3 et la ligne 3 est descendue en 5
Alors qu'avec cette commande
sudo efibootmgr -o 5,4
Comment faire passer la ligne 2 en 1 ?
Dernière modification par Doc Brown (Le 25/01/2023, à 20:12)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#16 Le 25/01/2023, à 21:46
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Que donne Entrer dans les réglages
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#17 Le 26/01/2023, à 10:27
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Que donne Entrer dans les réglages
J'ai accès à l'ordre des boot-disques (clef USB, DVD,USBD, et DD) mais pas aux partitions. Seule ta commande
sudo efibootmgr -o 5,4
permet de changer l'ordre des boot affichés et du coup si ubuntu (P0: Crucial_CT250MX200SSD1) passait en ligne 1 le démarrage se ferait sur grub.
Dernière modification par Doc Brown (Le 26/01/2023, à 12:04)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#18 Le 26/01/2023, à 13:29
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
. Seule ta commande
sudo efibootmgr -o 5,4
permet de changer l'ordre des boot affichés et du coup si ubuntu (P0: Crucial_CT250MX200SSD1) passait en ligne 1 le démarrage se ferait sur grub.
Bonjour
Merci de dire si cette commande permet de mettre ubuntu en début de liste et si c'est stable. Si oui, Il reste à comprendre pourquoi le boot ne peut pas se faire automatiquement.
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#19 Le 26/01/2023, à 13:44
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Je viens d'exécuter la commande que tu viens de me proposer => et P0: Crucial_CT250MX200SSD1 reste désespérément en second
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#20 Le 26/01/2023, à 13:58
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
C'est un peu ce que je craignais.
Je pense qu'il y a trois pistes
- Rester en l'état et demander à windows de faire la proposition de boot .
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\grub****.efi
Traduction: Sous windows, lancer l'application powershell (admin) et faire un copier/coller de cette commande
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
ou si mauvaise codification
bcdedit /set '{bootmgr}' path \EFI\ubuntu\grubx64.efi
- Installer refind en live USB avec le script indiqué au paragraphe 2.1.2 et en disant de finaliser avec un écrasement de la structure de boot de windows qui sera sauvegardée.
- Procéder à une mise à jour du bios version +1 en espérant une amélioration de cette séquence.
Dernière modification par geole (Le 26/01/2023, à 14:00)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#21 Le 26/01/2023, à 16:09
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
J'ai commencé l'installation de refind mais dès la première commande je suis bloqué car je ne sais pas répondre.
Je suis un boulet, désolé.
sudo mount -v $(sudo blkid | grep vfat | cut -d: -f1) /mnt # Monter la partition de boot ESP.
sudo cp -rv /usr/share/refind/* /mnt/EFI/boot # Installer refind dans le répertoire de boot.
sudo cp -v /mnt/EFI/refind/refind_x64.efi /mnt/EFI/Boot/bootx64.efi # Dire qu'il devient le fichier de boot officiel.
exit
alain@alain-Tour:~$ sudo mount -v $(sudo blkid | grep vfat | cut -d: -f1) /mnt # Monter la partition de boot ESP.
[sudo] Mot de passe de alain :
mount: bad usage
Exécutez « mount --help » pour obtenir des renseignements complémentaires.
alain@alain-Tour:~$
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne
#22 Le 26/01/2023, à 23:38
- geole
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Bonsoir.
Je t'avais suggéré un script pour éviter ce problème.
Dans la documentation, il n'était pas prévu la présence de plusieurs partitions de boot.
Je consulte ton boot-info pour te donner la bonne commande.
sudo mount -v /dev/sda2 /mnt
Dernière modification par geole (Le 26/01/2023, à 23:45)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#23 Le 27/01/2023, à 08:08
- iznobe
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Bonjour .
Deja il serait bon de mettre a jour le BIOS avec la derniere version en date ( 2 versions de retard ) .
Pour parametrer ubuntu en priorité 1 de disque de demarrage , le plus simple est encore de passer par le BIOS vu qu ' avec efibootmgr ca ne veut pas .
il faudrait etre cependant certain qu ' ubuntu et windows sont installés dans le meme mode demarrage et si oui lequel .
il faut aussi savoir si ubuntu et windows sont sur le meme disque dur ou pas .
d ' apres ce retour :
BootOrder: 0005,0004
Boot0004* Windows Boot Manager HD(2,GPT,51fe7025-5c5f-4e7d-9688-e7dbb9cde4d9,0x1000,0x3f800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)..BO
Boot0005* ubuntu HD(2,GPT,4eb0104e-e8a8-433d-aac7-51d164e1afab,0xfa000,0x32000)/File(\EFI\UBUNTU\GRUBX64.EFI)
j ' en deduis que windows et ubuntu sont installés en EFI et sont sur le meme disque .
je demande confirmation a geole en passant ...
si oui , dans le BIOS , il faut alors modifier plusieurs choses simultanement .
Deja , il faut evidemment forcer le mode de demarrage EFI ( dans : " boot mode select " ) , puis , desuite apres et juste en dessous modifier l ' ordre des peripheriques de boot afin d' obtenir la liste suivante :
UEFI USB KEY
UEFI CD/DVD
UEFI HARD DISK DRIVES
puis pour la suite de la liste , mettre tout ce qui ne commence pas par UEFI , par exemple USB KEY etc ..
ensuite , te rendre dans l ' onglet " BOOT " et selectionner le bon peripherique de demarrage comme on le voit sur cette photo : https://postlmg.cc/30QSkwNs
tu click sur " windows boot manager " , puis dans la liste qui apparaitra , tu cliques sur " ubuntu P0 CRUCIAL " , cela aura pour effet d' inverser les 2 , donc ubuntu passera en 1er et windows en 2eme .
tu appuies alors sur F10 pour sauvegarder les changements .
MAIS : le soucis c ' est que d' apres ce que l' on voit sur la photo suivante https://postlmg.cc/30QSkwNs , c ' est que tu n ' as pas seulement :
sda1
sda2
sda4 => Windows 10
sdb1 => UBUNTU 22.04 LTS
sdb2 => UBUNTU 22.10
sdb3 => Données Ubuntu /home
sdc2
sdc3 => 1- Données Windows
sdd4 => 2- Données Windows
il y apparait des entrés en double , on voit 2 fois windows et 2 fois ubuntu , ca n' est pas normal , il faudrait d' abord corriger cela !
je ne sais pas si c' est du a la presence de refind et de grub simultanement ou autre chose , mais il faut d' abord rectifier cela avant toute manip .
Toi tu dis que windows et un des 2 ubuntu ne sont pas installés sur le meme disque . ce n' est pas ce que montre le retour ci-dessus , le retour montre que windows et un des 2 ubuntu sont installés sur le disque hd2 probablement le disque sdb .
un autre ubuntu est installé sur le disque a plateau western digital .
De plus , depuis la 22.04 , afin d' avoir un multiboot , il faut activer la detection des OS via le fichier /etc/default/grub manuellement , pour commencer donc , commence par nous donner le contenu de ce fichier de l' ubuntu avec lequel tu desires demarrer en priorité :
cat /etc/default/grub
Autre point : il y aurait 3 systemes differents a traiter : windobs , ubu 22.04 et ubu 22.10 , donc une ligne efibootmgr a 3 entrées . A mon avis il y a au moins un des 3 OS qui n' est pas installé en EFI . faudrait que j' analyse le boot info plus en details ...
Dernière modification par iznobe (Le 27/01/2023, à 08:15)
retour COMPLET et utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .
Hors ligne
#24 Le 27/01/2023, à 08:23
- iznobe
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
d' apres le boot info , on y voit :
données windows :
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
un truc inconnu
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
un windows 10 ( ou 11 ) :
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 10 or 11
Ubuntu 20.04.5 LTS
sdb1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.5 LTS
Ubuntu 22.10
sdb2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.10
une partition inconnue :
sdc1: __________________________________________________________________________
File system:
Boot sector type: Unknown
Boot sector info:
une anomalie probablement a corriger sur des données windows :
sdc3: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: According to the info in the boot sector, sdc3 starts
at sector 29. But according to the info from fdisk,
sdc3 starts at sector 264192. According to the info in
the boot sector, sdc3 has 312313855 sectors, but
according to the info from fdisk, it has 312317582
sectors.
un autre truc inconnu
sdc4: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
un autre windows ??
sdd4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/10/11/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /bootmgr /Boot/BCD
de multiples partitions vfat EFI ???
bref , c' est le bins , il faut tout d' abord commencer par traiter tout ce qui ne va pas . sacré travail ...
Donc , il faut supprimer les partitions inutiles , sans se tromper , en plus des différentes anomalies vues avant et de celles relevées par @geole ...
Note : les partitions inconnues sont probablement des partitions etendues , a verifier .
Dernière modification par iznobe (Le 27/01/2023, à 08:37)
retour COMPLET et utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .
Hors ligne
#25 Le 27/01/2023, à 11:48
- Doc Brown
Re : [RÉSOLU] Multi boot qui ne fonctionne plus - Rapport Boot-Repair
Bonjour à toutes et tous,
Pour expliquer ce fouillis de démarrage, c’est du au fait que j’avais un multiboot pour tester plusieurs OS et c’est le disque contenant le grub qui a crashé.
bref, c' est le bins, il faut tout d' abord commencer par traiter tout ce qui ne va pas
commence par nous donner le contenu de ce fichier de l' ubuntu avec lequel tu désires démarrer en priorité :
cat /etc/default/grub
alain@alain-Tour:~$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
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=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
alain@alain-Tour:~$
Pour en faire la synthèse, j'ai fait la photo
Avec F11, j'obtiens le choix des boot
puis avec le choix 1 (en rouge) démarrage de Windows
avec le choix 2 (en rouge) menu de grub où je peux démarrer les ubuntu ainsi que windows.
C'est ce choix 2 (en rouge) que je souhaiterai en première ligne pour automatiser le démarrage sur Grub et d'ailleurs s'il était possible, supprimer les autres choix de ce menu, qui sont obsolètes.
Encore merci pour votre support et votre patience
Dernière modification par Doc Brown (Le 27/01/2023, à 12:33)
Membre de linux-azur
Insérer image
Conseils pour les nouveaux demandeurs et pas qu'eux copie de la signature de xubu1957
Hors ligne