Pages : 1
#1 Le 02/12/2020, à 19:36
- Mario2020C
Message d'erreur lors du démarrage
Bonjour à tous
J'ai un portable HP EliteBook Folio que j'aime bien.
Auparavant, il était monté en dual boot Windows10 et Ubuntu mais le côté Linux n'apparaissait pas lors du démarrage.
J'ai perdu cette façon de démarrage et j'aimerais bien la retrouver.
J'ai dû réinstaller Windows 10 et Linux et maintenant, voici ce qui se passe:
1- Lors du démarrage, j'ai le message suivant qui s'affiche: (voir le fichier 1 annexé)
FW Status recovery error.
System BootOrder not found. Initializing defaults.
Creating Boot entry Boot000F with label Ubuntu for file \EFI\ubuntu\shimx64.efi
Puis, après quelques secondes, mon portable continue le démarrage sous Windows 10 comme si rien n'était.
Pour retourner sous Linux, je dois, lors du démarrage, peser sur la touche F9 Boot options et suivre la procédure suivante:
Voilà quand je pèse sur F9 lors du démarrage
Ensuite j'ai le menu qui me donne que le choix suivant:
Seul choix disponible
Qui m'amène au choix EFI:
Choix EFI
D'où maintenant je peux choisir l'option Ubuntu:
Choix Ubuntu
D'où je peux choisir le fichier rubx64.efi:
Choix grubx64.efi
et qui m'amène finalement au démarrage de ma partition Ubuntu.
J'ai tenté la réparation par la partie Windows 10 mais cela n'a pas fonctionné. J'ai toujours le même message qui s'affiche au démarrage puis il continue en Windows 10.:
Outil de redémarrage de Windows 10
Finalement, voici ma configuration de mon disque dur. Vous conclurez que ma partition Linux est la dernière de 33G.:
Gestion de disque
Merci d'avance pour votre aide pour me retrouver avec un démarrage unique sous Windows 10 et aussi pouvoir peser sur F9 et sélectionner directement Ubuntu (comme auparavant) comme choix secondaire de démarrage.
Pour terminer, quel est le meilleur logiciel qui pourrait être utilisé sous Linux (et par une clé USB de démarrage) pour faire une image exacte et complète de mon disque dur (configuration de base) et ce, sur un disque dur externe afin de ne plus me retaper des jours en réinstallation de mes deux partitions. Auparavant, j'utilisais Acronis True image
Merci et bonne journée
Hors ligne
#2 Le 02/12/2020, à 19:54
- lucmars
Re : Message d'erreur lors du démarrage
Ben tu t'embetes à booter sur le buntu installé depuis lequel tu nous retourneras l'url fournit par boot-info (voir la doc). De là on aura tout ou presque de ce qu'il faut savoir.
Gaulois Matter !
Hors ligne
#3 Le 02/12/2020, à 21:11
- Mario2020C
Re : Message d'erreur lors du démarrage
Voici:
boot-info-4ppa125 [20201202_1450]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/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/HP/BiosUpdate/CryptRSA32.efi
/efi/HP/BiosUpdate/CryptRSA.efi
/efi/HP/BiosUpdate/HpBiosUpdate32.efi
/efi/HP/BiosUpdate/HpBiosUpdate.efi
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/Microsoft/Boot/memtest.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 8 or 10
Boot files: /Windows/System32/winload.exe
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.10
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
================================ 2 OS detected =================================
OS#1: L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession on sda6
OS#2: Windows 8 or 10 on sda4
============================ Architecture/Host Info ============================
CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.8.0-31-generic root=UUID=f56d6652-8050-4472-9a3a-cad3006d3df4 ro quiet splash vt.handoff=7
===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
SecureBoot disabled.
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0002* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0003* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0004* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008* Windows Boot Manager HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,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.}...r................
Boot0009* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000A* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000B* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000C* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
78415fb8fb9b909f8029858113f1335f sda2/Boot/bootx64.efi
2895d47544fd587b26c7e29be1295c27 sda2/Boot/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda2/Boot/mmx64.efi
951288adcc81d2d86508f3f18d9753e0 sda2/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda2/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f sda2/ubuntu/shimx64.efi
1b8c0684ede8539ccc205cf7a750eca3 sda2/HP/BiosUpdate/CryptRSA32.efi
6488d391f74263c9da3c3d47dffa6212 sda2/HP/BiosUpdate/CryptRSA.efi
d3ed3bbb2557c7232ab90f2743940084 sda2/HP/BiosUpdate/HpBiosUpdate32.efi
18baee3d6f7498125772d0fdc71b3e55 sda2/HP/BiosUpdate/HpBiosUpdate.efi
e87c4f299e44cf4153ad321c6fc7dabc sda2/Microsoft/Boot/bootmgfw.efi
ac84bbacadaa85317812273ac07cda2f sda2/Microsoft/Boot/bootmgr.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda6 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sda1 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda4 : is-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda5 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
Partitions info (2/3): _________________________________________________________
sda6 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda1 : isnotESP, part-has-no-fstab, no-nt, no-winload, recovery-or-hidden, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda4 : isnotESP, part-has-no-fstab, no-nt, haswinload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda6 : not-sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sda
sda1 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda2 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda4 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda5 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk identifier: C652B6D7-FBAA-44C8-89E4-0C33DC7F4C17
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 235061247 233799680 111.5G Microsoft basic data
sda5 235061248 399638445 164577198 78.5G Microsoft basic data
sda6 399638528 468860927 69222400 33G Linux filesystem
parted -lm (filtered): _________________________________________________________
sda:240GB:scsi:512:512:gpt:ATA KINGSTON SA400S3:;
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:120GB:120GB:ntfs:Basic data partition:msftdata;
5:120GB:205GB:84.3GB:ntfs:Basic data partition:msftdata;
6:205GB:240GB:35.4GB:ext4::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs 52065B76065B5A55 6441af14-8e78-473c-9341-e47add437ce3 Récupération Basic data partition
├─sda2 vfat F25C-2931 254074f1-6eec-4d4b-9272-c4d5326ee64b EFI system partition
├─sda3 47202770-fb5f-4d29-94e0-2b4d7af2f0ee Microsoft reserved partition
├─sda4 ntfs 64DE658DDE6557F6 3fd269fd-2683-4e5e-b7aa-11f646a95121 Basic data partition
├─sda5 ntfs EABEF801BEF7C45B 21066d0d-3a60-4b4f-bc37-f1f2180aefdb DATAS Basic data partition
└─sda6 ext4 f56d6652-8050-4472-9a3a-cad3006d3df4 623c33a0-779d-4938-b70e-442cea5c464c
df (filtered): _________________________________________________________________
Avail Use% Mounted on
sda1 122.4M 75% /mnt/boot-sav/sda1
sda4 59.4G 47% /mnt/boot-sav/sda4
sda5 76.6G 2% /mnt/boot-sav/sda5
sda6 19.8G 33% /
Mount options: __________________________________________________________________
sda1 rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda4 rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5 rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda6 rw,relatime,errors=remount-ro
===================== sda2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid f56d6652-8050-4472-9a3a-cad3006d3df4 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Windows Boot Manager (sur sda2) osprober-efi-F25C-2931
### END /etc/grub.d/30_os-prober_proxy ###
Ubuntu f56d6652-8050-4472-9a3a-cad3006d3df4
Ubuntu, avec Linux 5.8.0-31-generic f56d6652-8050-4472-9a3a-cad3006d3df4
Ubuntu, avec Linux 5.8.0-25-generic f56d6652-8050-4472-9a3a-cad3006d3df4
UEFI Firmware Settings uefi-firmware
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=f56d6652-8050-4472-9a3a-cad3006d3df4 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=F25C-2931 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda6/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=""
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
199,232601166 = 213,924376576 boot/grub/grub.cfg 1
197,059646606 = 211,591184384 boot/vmlinuz 1
195,281246185 = 209,681641472 boot/vmlinuz-5.8.0-25-generic 2
197,059646606 = 211,591184384 boot/vmlinuz-5.8.0-31-generic 1
195,281246185 = 209,681641472 boot/vmlinuz.old 2
197,429683685 = 211,988508672 boot/initrd.img 5
197,318382263 = 211,868999680 boot/initrd.img-5.8.0-25-generic 3
197,429683685 = 211,988508672 boot/initrd.img-5.8.0-31-generic 5
197,318382263 = 211,868999680 boot/initrd.img.old 3
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 702 déc 2 01:06 10_linux_proxy
-rwxr-xr-x 1 root root 198 déc 2 01:06 30_os-prober_proxy
-rwxr-xr-x 1 root root 702 déc 2 01:06 31_linux_proxy
-rwxr-xr-x 1 root root 42359 oct 1 10:59 32_linux_zfs
-rwxr-xr-x 1 root root 12894 oct 1 10:59 33_linux_xen
-rwxr-xr-x 1 root root 1992 aoû 18 06:23 34_memtest86+
-rwxr-xr-x 1 root root 198 déc 2 01:06 35_os-prober_proxy
-rwxr-xr-x 1 root root 1424 oct 1 10:59 36_uefi-firmware
-rwxr-xr-x 1 root root 214 oct 1 10:59 40_custom
-rwxr-xr-x 1 root root 216 oct 1 10:59 41_custom
drwxr-xr-x 4 root root 4096 déc 2 01:06 backup
drwxr-xr-x 2 root root 4096 déc 2 01:06 bin
drwxr-xr-x 2 root root 4096 déc 2 01:06 proxifiedScripts
======================== sda6/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'~4310aa557e6d767111801ea3cececaa9~
-*
-#text
+'SUBMENU' as 'Options avancées pour Ubuntu'{+'Options avancées pour Ubuntu'/*, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-31-generic'~6fdb9e61417e2b23160aaee440600e9f~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-31-generic (recovery mode)'~1d99cf9068e57d6376eee3ca7d5a8bee~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-25-generic'~4a45f46b9bdb5123fea06d66bd891fd4~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-25-generic (recovery mode)'~27aead4ae2df55673294b08c8f1347a9~}
"
========================= sda6/etc/grub.d/32_linux_zfs =========================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2019 Canonical Ltd.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <[url]http://www.gnu.org/licenses/[/url]>.
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 [url]https://github.com/zfsonlinux/zfs/issues/9958[/url]
# 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 [url]https://github.com/zfsonlinux/zfs/issues/9958[/url]
# 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
========================= sda6/etc/grub.d/33_linux_xen =========================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <[url]http://www.gnu.org/licenses/[/url]>.
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"
====================== sda6/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 "-'Windows Boot Manager (sur /dev/sda2)'~42fc2c35bc9c37b2738871d138024a9d~
+*
+#text
"
======================= sda6/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 <[url]http://www.gnu.org/licenses/[/url]>.
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
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sda6,
using the following options: sda2/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession entry (sda2/efi/****/shim****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.
If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\shim****.efi (**** will be updated in the final message)
Dernière modification par Mario2020C (Le 03/12/2020, à 05:52)
Hors ligne
#5 Le 03/12/2020, à 05:54
- Mario2020C
Re : Message d'erreur lors du démarrage
boot-info-4ppa125 [20201202_1450]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/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/HP/BiosUpdate/CryptRSA32.efi
/efi/HP/BiosUpdate/CryptRSA.efi
/efi/HP/BiosUpdate/HpBiosUpdate32.efi
/efi/HP/BiosUpdate/HpBiosUpdate.efi
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/Microsoft/Boot/memtest.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 8 or 10
Boot files: /Windows/System32/winload.exe
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.10
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
================================ 2 OS detected =================================
OS#1: L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession on sda6
OS#2: Windows 8 or 10 on sda4
============================ Architecture/Host Info ============================
CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.8.0-31-generic root=UUID=f56d6652-8050-4472-9a3a-cad3006d3df4 ro quiet splash vt.handoff=7
===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
SecureBoot disabled.
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0002* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0003* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0004* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008* Windows Boot Manager HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,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.}...r................
Boot0009* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000A* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000B* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000C* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
78415fb8fb9b909f8029858113f1335f sda2/Boot/bootx64.efi
2895d47544fd587b26c7e29be1295c27 sda2/Boot/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda2/Boot/mmx64.efi
951288adcc81d2d86508f3f18d9753e0 sda2/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda2/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f sda2/ubuntu/shimx64.efi
1b8c0684ede8539ccc205cf7a750eca3 sda2/HP/BiosUpdate/CryptRSA32.efi
6488d391f74263c9da3c3d47dffa6212 sda2/HP/BiosUpdate/CryptRSA.efi
d3ed3bbb2557c7232ab90f2743940084 sda2/HP/BiosUpdate/HpBiosUpdate32.efi
18baee3d6f7498125772d0fdc71b3e55 sda2/HP/BiosUpdate/HpBiosUpdate.efi
e87c4f299e44cf4153ad321c6fc7dabc sda2/Microsoft/Boot/bootmgfw.efi
ac84bbacadaa85317812273ac07cda2f sda2/Microsoft/Boot/bootmgr.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda6 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sda1 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda4 : is-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda5 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
Partitions info (2/3): _________________________________________________________
sda6 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda1 : isnotESP, part-has-no-fstab, no-nt, no-winload, recovery-or-hidden, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda4 : isnotESP, part-has-no-fstab, no-nt, haswinload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda6 : not-sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sda
sda1 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda2 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda4 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda5 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk identifier: C652B6D7-FBAA-44C8-89E4-0C33DC7F4C17
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 235061247 233799680 111.5G Microsoft basic data
sda5 235061248 399638445 164577198 78.5G Microsoft basic data
sda6 399638528 468860927 69222400 33G Linux filesystem
parted -lm (filtered): _________________________________________________________
sda:240GB:scsi:512:512:gpt:ATA KINGSTON SA400S3:;
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:120GB:120GB:ntfs:Basic data partition:msftdata;
5:120GB:205GB:84.3GB:ntfs:Basic data partition:msftdata;
6:205GB:240GB:35.4GB:ext4::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs 52065B76065B5A55 6441af14-8e78-473c-9341-e47add437ce3 Récupération Basic data partition
├─sda2 vfat F25C-2931 254074f1-6eec-4d4b-9272-c4d5326ee64b EFI system partition
├─sda3 47202770-fb5f-4d29-94e0-2b4d7af2f0ee Microsoft reserved partition
├─sda4 ntfs 64DE658DDE6557F6 3fd269fd-2683-4e5e-b7aa-11f646a95121 Basic data partition
├─sda5 ntfs EABEF801BEF7C45B 21066d0d-3a60-4b4f-bc37-f1f2180aefdb DATAS Basic data partition
└─sda6 ext4 f56d6652-8050-4472-9a3a-cad3006d3df4 623c33a0-779d-4938-b70e-442cea5c464c
df (filtered): _________________________________________________________________
Avail Use% Mounted on
sda1 122.4M 75% /mnt/boot-sav/sda1
sda4 59.4G 47% /mnt/boot-sav/sda4
sda5 76.6G 2% /mnt/boot-sav/sda5
sda6 19.8G 33% /
Mount options: __________________________________________________________________
sda1 rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda4 rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5 rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda6 rw,relatime,errors=remount-ro
===================== sda2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid f56d6652-8050-4472-9a3a-cad3006d3df4 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Windows Boot Manager (sur sda2) osprober-efi-F25C-2931
### END /etc/grub.d/30_os-prober_proxy ###
Ubuntu f56d6652-8050-4472-9a3a-cad3006d3df4
Ubuntu, avec Linux 5.8.0-31-generic f56d6652-8050-4472-9a3a-cad3006d3df4
Ubuntu, avec Linux 5.8.0-25-generic f56d6652-8050-4472-9a3a-cad3006d3df4
UEFI Firmware Settings uefi-firmware
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=f56d6652-8050-4472-9a3a-cad3006d3df4 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=F25C-2931 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda6/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=""
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
199,232601166 = 213,924376576 boot/grub/grub.cfg 1
197,059646606 = 211,591184384 boot/vmlinuz 1
195,281246185 = 209,681641472 boot/vmlinuz-5.8.0-25-generic 2
197,059646606 = 211,591184384 boot/vmlinuz-5.8.0-31-generic 1
195,281246185 = 209,681641472 boot/vmlinuz.old 2
197,429683685 = 211,988508672 boot/initrd.img 5
197,318382263 = 211,868999680 boot/initrd.img-5.8.0-25-generic 3
197,429683685 = 211,988508672 boot/initrd.img-5.8.0-31-generic 5
197,318382263 = 211,868999680 boot/initrd.img.old 3
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 702 déc 2 01:06 10_linux_proxy
-rwxr-xr-x 1 root root 198 déc 2 01:06 30_os-prober_proxy
-rwxr-xr-x 1 root root 702 déc 2 01:06 31_linux_proxy
-rwxr-xr-x 1 root root 42359 oct 1 10:59 32_linux_zfs
-rwxr-xr-x 1 root root 12894 oct 1 10:59 33_linux_xen
-rwxr-xr-x 1 root root 1992 aoû 18 06:23 34_memtest86+
-rwxr-xr-x 1 root root 198 déc 2 01:06 35_os-prober_proxy
-rwxr-xr-x 1 root root 1424 oct 1 10:59 36_uefi-firmware
-rwxr-xr-x 1 root root 214 oct 1 10:59 40_custom
-rwxr-xr-x 1 root root 216 oct 1 10:59 41_custom
drwxr-xr-x 4 root root 4096 déc 2 01:06 backup
drwxr-xr-x 2 root root 4096 déc 2 01:06 bin
drwxr-xr-x 2 root root 4096 déc 2 01:06 proxifiedScripts
======================== sda6/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'~4310aa557e6d767111801ea3cececaa9~
-*
-#text
+'SUBMENU' as 'Options avancées pour Ubuntu'{+'Options avancées pour Ubuntu'/*, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-31-generic'~6fdb9e61417e2b23160aaee440600e9f~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-31-generic (recovery mode)'~1d99cf9068e57d6376eee3ca7d5a8bee~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-25-generic'~4a45f46b9bdb5123fea06d66bd891fd4~, +'Options avancées pour Ubuntu'/'Ubuntu, avec Linux 5.8.0-25-generic (recovery mode)'~27aead4ae2df55673294b08c8f1347a9~}
"
========================= sda6/etc/grub.d/32_linux_zfs =========================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2019 Canonical Ltd.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <[url]http://www.gnu.org/licenses/[/url]>.
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 [url]https://github.com/zfsonlinux/zfs/issues/9958[/url]
# 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 [url]https://github.com/zfsonlinux/zfs/issues/9958[/url]
# 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
========================= sda6/etc/grub.d/33_linux_xen =========================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <[url]http://www.gnu.org/licenses/[/url]>.
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"
====================== sda6/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 "-'Windows Boot Manager (sur /dev/sda2)'~42fc2c35bc9c37b2738871d138024a9d~
+*
+#text
"
======================= sda6/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 <[url]http://www.gnu.org/licenses/[/url]>.
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
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sda6,
using the following options: sda2/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.10 CurrentSession entry (sda2/efi/****/shim****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.
If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\shim****.efi (**** will be updated in the final message)
Hors ligne
#6 Le 03/12/2020, à 18:38
- lucmars
Re : Message d'erreur lors du démarrage
Donc avant, tu passais par F9 pour lancer buntu direct, c'est ça ?
Là c'est la 20.10 ; c'est une installe fraiche, une mise à niveau ?
Ce qui cloche se trouverait ci-dessous:
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0002* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0003* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0004* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008* Windows Boot Manager HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,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.}...r................
Boot0009* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000A* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000B* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000C* ubuntu HD(2,GPT,254074f1-6eec-4d4b-9272-c4d5326ee64b,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
t'as une génération d'entrée buntu/../shimx64.efi mais quand tu t'embetes à booter c'est sur la ligne boot0000
Gaulois Matter !
Hors ligne
#7 Le 03/12/2020, à 19:54
- ikewdu
Re : Message d'erreur lors du démarrage
Salut,
Ton installation est bien faite, mais ton problème vient de toute évidence de la Nvram (la zone de ton bios qui lance les OS). Si tu regardes la capture de Lucmars, on n'y voit d'entrée ni pour Windows ni pour Ubuntu dans la zone "boot order'.
Je pense qu'il faut déjà voir dans ton bios (onglet boot, mais aussi onglet avancé), si tu as moyen d'ajouter manuellement des entrées pour les deux OS.
En revanche, tu as tenté de réparer avec un logiciel du genre "grub-customizer", ce qui ne me semble pas très judicieux. Ca a juste ajouté plein de merdouilles inutiles.
On peut toujours tenter d'ajouter ces entrées depuisUbuntu avec la commande efibootmgr, mais je doute que ça se passe mieux qu'avec le processus d'installation.
Hors ligne
#8 Le 05/12/2020, à 20:47
- Mario2020C
Re : Message d'erreur lors du démarrage
Bonjour. Je suis vraiment rouillé en ce qui concerne Linux et ses termes.
J'ai finalement tenté une réinstallation complète du portable sous Windows 10 en formatant tout le disque comme un tout neuf.
Mais j'ai pris le temps de me faire une image disque avec Acronis. C'est quand même long une installation personnalisée...
L'installation s'est bien déroulée et je Bootait directement sans aucun problème.
Aussi, durant l'installation, j'ai volontairement laissé une partie de 33G non formatée, prête pour accueillir Linux Ubuntu V20.
Par la clé USB Ubuntu, j'ai fait une nouvelle installation de Ubuntu sur le disque dur en Dual-Boot et tout semblait OK.
Je me retrouve encore une fois, lors du démarrage avec le même message du début:
FW Status recovery error.
System BootOrder not found. Initializing defaults.
Creating Boot entry Boot000F with label Ubuntu for file \EFI\ubuntu\shimx64.efi
Puis, le démarrage continue pour ensuite me donner un plus gros message d'erreur ([img=Voir le fichier ci-joint]/home/ubuntu/Bureau/FW Status Recovery Error.jpg[/img])
J'ai ensuite créé un fichier Boot-info qui donne ce qui suit:
boot-repair-4ppa125 [20201205_1928]
============================== 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 1 of
the same hard drive for core.img. core.img is at this location and looks
for (hd0,msdos1)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
biosdisk part_msdos fshelp fat ntfs exfat
---------------------------------------------------------------------------
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/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/HP/BiosUpdate/CryptRSA32.efi
/efi/HP/BiosUpdate/CryptRSA.efi
/efi/HP/BiosUpdate/HpBiosUpdate32.efi
/efi/HP/BiosUpdate/HpBiosUpdate.efi
/efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/Microsoft/Boot/memtest.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 8 or 10
Boot files: /Windows/System32/winload.exe
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.10
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb1: __________________________________________________________________________
File system: vfat
Boot sector type: MSWIN4.1: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /boot/grub/grub.cfg /efi/boot/bootx64.efi
/efi/boot/grubx64.efi /efi/boot/mmx64.efi
================================ 2 OS detected =================================
OS#1: Ubuntu 20.10 on sda6
OS#2: Windows 8 or 10 on sda4
============================ Architecture/Host Info ============================
CPU architecture: 64-bit
Live-session OS is Ubuntu 64-bit (Ubuntu 20.10, groovy, x86_64)
===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this live-session.
SecureBoot disabled.
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,0002
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* USB Hard Drive 1 - Kingston DataTraveler 3.0 BBS(HD,,0x900).......................................................................
Boot0002* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0003* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0004* ubuntu HD(2,GPT,c3326379-8477-4667-acce-121deef700de,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(2,GPT,c3326379-8477-4667-acce-121deef700de,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(2,GPT,c3326379-8477-4667-acce-121deef700de,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* ubuntu HD(2,GPT,c3326379-8477-4667-acce-121deef700de,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008* ubuntu HD(2,GPT,c3326379-8477-4667-acce-121deef700de,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0029* Windows Boot Manager HD(2,GPT,c3326379-8477-4667-acce-121deef700de,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.}..._................
78415fb8fb9b909f8029858113f1335f sda2/Boot/bootx64.efi
2895d47544fd587b26c7e29be1295c27 sda2/Boot/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda2/Boot/mmx64.efi
951288adcc81d2d86508f3f18d9753e0 sda2/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda2/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f sda2/ubuntu/shimx64.efi
1b8c0684ede8539ccc205cf7a750eca3 sda2/HP/BiosUpdate/CryptRSA32.efi
6488d391f74263c9da3c3d47dffa6212 sda2/HP/BiosUpdate/CryptRSA.efi
d3ed3bbb2557c7232ab90f2743940084 sda2/HP/BiosUpdate/HpBiosUpdate32.efi
18baee3d6f7498125772d0fdc71b3e55 sda2/HP/BiosUpdate/HpBiosUpdate.efi
e87c4f299e44cf4153ad321c6fc7dabc sda2/Microsoft/Boot/bootmgfw.efi
ac84bbacadaa85317812273ac07cda2f sda2/Microsoft/Boot/bootmgr.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda1 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda4 : is-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda5 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda6 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ng, update-grub, farbios
Partitions info (2/3): _________________________________________________________
sda1 : isnotESP, part-has-no-fstab, no-nt, no-winload, recovery-or-hidden, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda4 : isnotESP, part-has-no-fstab, no-nt, haswinload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda6 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda1 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda2 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda4 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda5 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda6 : not-sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk identifier: C652B6D7-FBAA-44C8-89E4-0C33DC7F4C17
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 235061247 233799680 111.5G Microsoft basic data
sda5 235061248 405370879 170309632 81.2G Microsoft basic data
sda6 405370880 468860927 63490048 30.3G Linux filesystem
Disk sdb: 7.22 GiB, 7751073792 bytes, 15138816 sectors
Disk identifier: 0x004cd7e0
Boot Start End Sectors Size Id Type
sdb1 * 2048 15138815 15136768 7.2G c W95 FAT32 (LBA)
parted -lm (filtered): _________________________________________________________
sda:240GB:scsi:512:512:gpt:ATA KINGSTON SA400S3:;
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:120GB:120GB:ntfs:Basic data partition:msftdata;
5:120GB:208GB:87.2GB:ntfs:Basic data partition:msftdata;
6:208GB:240GB:32.5GB:ext4::;
sdb:7751MB:scsi:512:512:msdos:Kingston DataTraveler 3.0:;
1:1049kB:7751MB:7750MB:fat32::boot, lba;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs FC9AFD729AFD29B2 077d671d-8130-4fcc-a1c0-5ddc46aa697d Récupération Basic data partition
├─sda2 vfat 08FE-6749 c3326379-8477-4667-acce-121deef700de EFI system partition
├─sda3 c415703b-9fb3-462d-abe7-4b34c151d402 Microsoft reserved partition
├─sda4 ntfs 14E60920E60903A8 a66ee43a-dd25-48fa-b210-55ae0129c4ee Basic data partition
├─sda5 ntfs 749CA1069CA0C3C8 51382eb4-bbd0-49fe-a781-a9b6dc6852e6 DATAS Basic data partition
└─sda6 ext4 09350ba6-7a9f-45e2-99ff-6bcfd18f7027 6252f47b-d167-4b73-8b22-ac40a26120a0
sdb
└─sdb1 vfat 5E0C-A6E4 004cd7e0-01 UBUNTU 20_1
df (filtered): _________________________________________________________________
Avail Use% Mounted on
sda1 122.4M 75% /mnt/boot-sav/sda1
sda2 61.8M 36% /mnt/boot-sav/sda2
sda4 52.5G 53% /mnt/boot-sav/sda4
sda5 78.4G 3% /mnt/boot-sav/sda5
sda6 20.2G 27% /mnt/boot-sav/sda6
sdb1 4.5G 38% /cdrom
Mount options: __________________________________________________________________
sda1 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda2 rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sda4 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda6 rw,relatime
sdb1 ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
===================== sda2/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid 09350ba6-7a9f-45e2-99ff-6bcfd18f7027 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Ubuntu 09350ba6-7a9f-45e2-99ff-6bcfd18f7027
Ubuntu, avec Linux 5.8.0-31-generic 09350ba6-7a9f-45e2-99ff-6bcfd18f7027
Ubuntu, avec Linux 5.8.0-25-generic 09350ba6-7a9f-45e2-99ff-6bcfd18f7027
Windows Boot Manager (sur sda2) osprober-efi-08FE-6749
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=09350ba6-7a9f-45e2-99ff-6bcfd18f7027 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=08FE-6749 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda6/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=""
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
215,586589813 = 231,484338176 boot/grub/grub.cfg 3
200,082107544 = 214,836527104 boot/vmlinuz 1
198,363353729 = 212,991029248 boot/vmlinuz-5.8.0-25-generic 1
200,082107544 = 214,836527104 boot/vmlinuz-5.8.0-31-generic 1
198,363353729 = 212,991029248 boot/vmlinuz.old 1
199,897457123 = 214,638260224 boot/initrd.img-5.8.0-25-generic 4
200,303482056 = 215,074226176 boot/initrd.img-5.8.0-31-generic.new 2
199,897457123 = 214,638260224 boot/initrd.img.old 4
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 17622 oct 1 14:59 10_linux
-rwxr-xr-x 1 root root 42359 oct 1 14:59 10_linux_zfs
-rwxr-xr-x 1 root root 12894 oct 1 14:59 20_linux_xen
-rwxr-xr-x 1 root root 12059 oct 1 14:59 30_os-prober
-rwxr-xr-x 1 root root 1424 oct 1 14:59 30_uefi-firmware
-rwxr-xr-x 1 root root 214 oct 1 14:59 40_custom
-rwxr-xr-x 1 root root 216 oct 1 14:59 41_custom
====================== sdb1/boot/grub/grub.cfg (filtered) ======================
Ubuntu
Ubuntu (safe graphics)
OEM install (for manufacturers)
Boot from next volume
UEFI Firmware Settings
Test memory
==================== sdb1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
?? = ?? boot/grub/grub.cfg 1
=============================== StdErr Messages ================================
File descriptor 63 (pipe:[118884]) leaked on lvs invocation. Parent PID 24666: /bin/bash
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sda6,
using the following options: sda2/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the Ubuntu 20.10 entry (sda2/efi/****/shim****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.
If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\shim****.efi (**** will be updated in the final message)
J'avoue que je ne crois pas avoir fait d'erreur lors de l'installation mais la, ni Windows, ni Linux ne démarre.
Merci de me répondre
Hors ligne
#9 Le 05/12/2020, à 21:42
- ikewdu
Re : Message d'erreur lors du démarrage
Re,
Tu confirmes qu'aucun des OS ne fonctionne, même en passant par F9 ?
Hors ligne
#10 Le 06/12/2020, à 00:10
- Mario2020C
Re : Message d'erreur lors du démarrage
Oui je le confirme. J'ai de plus essayé tous les choix possibles.
Je suis à me demander si c'est la configuration du bios qui est à modifier genre activer boot-secure inactif ou le genre de EFI... mais ça fonctionnait tel que présentement avant...
Hors ligne
#11 Le 06/12/2020, à 06:39
- xubu1957
Re : Message d'erreur lors du démarrage
Bonjour,
Pour info, en regardant la Doc > liste_portables_hp - § 3 - serie_elitebook, deux discussions :
> Nouvelle installation dual boot-partitions w10 non visibles
> [RESOLU] Problème de dual boot seven/linux
amenant à ce lien linuxbsdos.com/2013/02/26/zap-gpt-data-structures-from-a-disk-while-preserving-existing-mbr-partitions
Conseils pour les nouveaux demandeurs et pas qu'eux
Important : Pensez à passer vos sujets en [Réso|u] lorsque ceux-ci le sont, au début du titre en cliquant sur Modifier sous le premier message, et un bref récapitulatif de la solution à la fin de celui-ci. Merci. Membre de Linux-Azur
En ligne
#12 Le 06/12/2020, à 07:22
- ikewdu
Re : Message d'erreur lors du démarrage
Re,
Procédons dans l'ordre. Quand tu passes par F9 :
1. Que se passe-t-il si tu choisis "windows boot manager" (s'il apparaît) ?
2. Parviens-tu, comme au début, à exécuter directement un fichier efi ?
Hors ligne
#13 Le 09/12/2020, à 01:50
- Mario2020C
Re : Message d'erreur lors du démarrage
Re,
Procédons dans l'ordre. Quand tu passes par F9 :1. Que se passe-t-il si tu choisis "windows boot manager" (s'il apparaît) ?
2. Parviens-tu, comme au début, à exécuter directement un fichier efi ?
1- Il me donne le choix de booter sous Windows, Boot, et Ubuntu
Dans chacun de ces choix, j'ai essayé tous les modes qui me retournent au début ou bien il redémarre et les écrans FW... réapparaissent suivis de Kernel panic....
2- OUi je me rend à chacun des fichiers efi mais il tourne en boucle comme expliqué en 1-
J'ai tenté une réinstallation totale et je suis maintenant au tout début de l'installation de Ubuntu. Je vais réessayer l'installation différemment soit en téléchargeant une autre image de Ubuntu et une nouvelle gravure sur USB.
Histoire à suivre...
Aussi, j'ai fait un reset complet d'usine du BIOS et chipset, 3 scan complet d'antivirus différents et aussi un scan du programme MRT de Microsoft. Tous n'ont rien trouvé.
Hors ligne
#14 Le 09/12/2020, à 06:49
- ikewdu
Re : Message d'erreur lors du démarrage
Re,
Tiens-nous au courant du résultat de tes réinstallations.
Hors ligne
#15 Le 09/12/2020, à 23:50
- Mario2020C
Re : Message d'erreur lors du démarrage
Merci de me conseiller.
J'ai tenté une réinstallation totale encore une fois.
Par contre j'ai pris soin de mettre à jour le chipset et remis les valeurs par défauts du BIOS.
Aussi, actuellement, l'option de démarrage est en mode UEFI Hybride (avec CSM).
Le disque dur a été effacé complètement et j'ai réinstallé Windows 10 avec en plus, une partition DATAS de 71G.
J'ai aussi laissé une portion inutilisé de 30G pour accueillir Ubuntu.
Puis j'ai installé cette fois-ci la version Ubuntu 20.04 (stable) qui s'est bien installé grâce à Rufus, une clé USB de 8G et aussi 2G de persistance.
Tout a bien été à part le paquet Google chrome qui m'a donné le message suivant:
Impossible d'installer le fichier: Il n'est pas pris en charge
J'ai essayé de l'installer différemment mais j'ai eu le même message.
Donc, j'ai rebooté la machine et je me suis retrouvé avec le même message du début:
FW Statut Recovery error.
System BootOrder Not Found. Initializing defautls.
Creating Boot entry Boot0006 with label ubuntu for file \EFI\ubuntu\shimx64.efi
Puis, après quelques instants, le message suivant apparait:
Désolé, Ubuntu 20.04 a rencontré une erreur interne
Envoyez un rapport d'anomalie aux développeurs?
J'ai cliqué sur Envoyé mais impossible de copier ou sauvegarder le rapport.
Au démarrage,
Impossible de redémarrer sur Windows ni sur Ubuntu. Mais mes partitions sont encore intactes.
J'ai donc réeffacé la partition Windows et refait une réinstallation de l'image.
Actuellement, je boot très bien sur Windows mais je ne vois plus ubuntu sauf qu'il est présent lorsque je regarde par el gestionnaire de disque.
Par F9, il n'est pas visible non plus.
J'imagine qu'il est possible de réactiver la partition active pour que je puisse le démarrer que par F9 comme avant mais la, j'attend vos conseils.
Hors ligne
#16 Le 10/12/2020, à 06:51
- ikewdu
Re : Message d'erreur lors du démarrage
Re,
Peux-tu refaire un rapport boot-info pour qu'on voie concrètement la situation actuelle, qui est fonctionnelle pour W10 ?
Edit. As-tu testé cette solution de Yorick Reuvekamp ? https://askubuntu.com/questions/1154080 … oting-inst
Dernière modification par ikewdu (Le 10/12/2020, à 06:59)
Hors ligne
#17 Le 10/12/2020, à 14:38
- Mario2020C
Re : Message d'erreur lors du démarrage
Le rapport Boot-info va suivre.
J'ai tenté de démarrer à partir de l'ordinateur sous ubuntu mais pas possible.
J'ai démarré avec la clé usb sous ubuntu 20.04 mais curieusement, il m'affiche l'écran de fond de ubuntu 20.10 ??
De plus, il est super lent. Ouvrir Firefox prend plus de 2 minutes et ouvrir une fenêtre ou un programme est super lent.
C'est comme si la lecture sous usb se fait selon la norme usb 1.0...
Peut-être que ma clé de 8G n'est pas assez rapide.
Je viens de graver une nouvelle clé 32G Kingston.
Hors ligne
#18 Le 10/12/2020, à 15:53
- Mario2020C
Re : Message d'erreur lors du démarrage
Bonjour,
Pour info, en regardant la Doc > liste_portables_hp - § 3 - serie_elitebook, deux discussions :
> Nouvelle installation dual boot-partitions w10 non visibles
> [RESOLU] Problème de dual boot seven/linux
amenant à ce lien linuxbsdos.com/2013/02/26/zap-gpt-data-structures-from-a-disk-while-preserving-existing-mbr-partitions
Je suis allé voir vos liens et j'ai retenu le dernier qui m'a aussi amené au lien suivant:
MBR ou GPT
Ce lien m'explique que j'ai tout avantage à garder le lien GPT et je serais plutôt porté à effacer le MBR.
Effectivement, mon disque dur est un SSD et suite à la lecture, gdisk me donne exactement le même résultat tel que décrit dans l'article soit:
Partition table scan:
MBR: progressive
BSD: Not present
APM: Not present
GPT: Present
Found valid GPT with protective MBR ; using GPT.
Command (? for Help)
Je me pose la question à ce qui serait le meilleur choix.
Devrais-je supprimer l'option MBR ou GPT?
Dernière modification par Mario2020C (Le 10/12/2020, à 16:02)
Hors ligne
#19 Le 10/12/2020, à 16:24
- Mario2020C
Re : Message d'erreur lors du démarrage
P.S. Le démarrage à partir de ma nouvelle clé USB 32G Kinston avec 5G de persistance me donne une navigation et des applications très fluides.
Voici mon dernier boot-info
Selon le tutoriel, alors que j'ai démarré avec la clé USB:
1.2 Installation.
1.2.1 Cas où au moins un ubuntu installé sur disque est opérationnel (J'ai fait aussi un boot-info selon l'autre puisque je n'étais pas certain duquel choisir exactement)
boot-info-4ppa125 [20201210_1520]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
=> Syslinux MBR (5.00 and higher) is installed in the MBR of /dev/sdb.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/bootx64.efi /efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/Microsoft/Boot/memtest.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 8 or 10
Boot files: /Windows/System32/winload.exe
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb1: __________________________________________________________________________
File system: vfat
Boot sector type: SYSLINUX 6.04
Boot sector info: Syslinux looks at sector 24608 of /dev/sdb1 for its
second stage. The integrity check of Syslinux failed.
No errors found in the Boot Parameter Block.
Operating System:
Boot files: /boot/grub/grub.cfg /syslinux.cfg
/efi/BOOT/grubx64.efi /efi/BOOT/mmx64.efi /ldlinux.sys
sdb2: __________________________________________________________________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
================================ 2 OS detected =================================
OS#1: Ubuntu 20.04.1 LTS on sda6
OS#2: Windows 8 or 10 on sda4
============================ Architecture/Host Info ============================
CPU architecture: 64-bit
Live-session OS is Ubuntu 64-bit (Ubuntu 20.04.1 LTS, focal, x86_64)
===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this live-session.
SecureBoot disabled.
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,0002
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* USB Hard Drive 1 - Kingston DataTraveler 3.0 BBS(HD,,0x900).......................................................................
Boot0002* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0003* Windows Boot Manager HD(2,GPT,8f8b36a8-d61c-47b5-8e3a-15bcc5bb59d8,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.}...t................
Boot0004* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0009* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000A* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000B* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000C* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000D* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000E* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000F* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0010* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0011* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0012* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0013* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
e87c4f299e44cf4153ad321c6fc7dabc sda2/Boot/bootx64.efi
e87c4f299e44cf4153ad321c6fc7dabc sda2/Microsoft/Boot/bootmgfw.efi
ac84bbacadaa85317812273ac07cda2f sda2/Microsoft/Boot/bootmgr.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, 2048 sectors * 512 bytes
sdb : notGPT, no-BIOSboot, has-noESP, usb-disk, not-mmc, no-os, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda1 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda4 : is-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda5 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda6 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ng, update-grub, farbios
sdb2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
Partitions info (2/3): _________________________________________________________
sda1 : isnotESP, part-has-no-fstab, no-nt, no-winload, recovery-or-hidden, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda4 : isnotESP, part-has-no-fstab, no-nt, haswinload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda6 : isnotESP, fstab-has-bad-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdb2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda1 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda2 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda4 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda5 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda6 : not-sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sda
sdb2 : maybesepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sdb
fdisk -l (filtered): ___________________________________________________________
Disk sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk identifier: C652B6D7-FBAA-44C8-89E4-0C33DC7F4C17
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 235061247 233799680 111.5G Microsoft basic data
sda5 235061248 405370879 170309632 81.2G Microsoft basic data
sda6 405370880 468860927 63490048 30.3G Linux filesystem
Disk sdb: 28.84 GiB, 30943995904 bytes, 60437492 sectors
Disk identifier: 0x000ac543
Boot Start End Sectors Size Id Type
sdb1 * 2048 49951723 49949676 23.8G c W95 FAT32 (LBA)
sdb2 49951724 60437443 10485720 5G 83 Linux
parted -lm (filtered): _________________________________________________________
sda:240GB:scsi:512:512:gpt:ATA KINGSTON SA400S3:;
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:120GB:120GB:ntfs:Basic data partition:msftdata;
5:120GB:208GB:87.2GB:ntfs:Basic data partition:msftdata;
6:208GB:240GB:32.5GB:ext4::;
sdb:30.9GB:scsi:512:512:msdos:Kingston DataTraveler 3.0:;
1:1049kB:25.6GB:25.6GB:fat32::boot, lba;
2:25.6GB:30.9GB:5369MB:ext3::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs 0462A0ED62A0E520 d2fbe052-2ec8-4b64-a97d-0dd376288ea9 Récupération Basic data partition
├─sda2 vfat DAA2-CEFF 8f8b36a8-d61c-47b5-8e3a-15bcc5bb59d8 EFI system partition
├─sda3 7cc82604-a409-4055-b641-609a610df0a3 Microsoft reserved partition
├─sda4 ntfs 42AEA95EAEA94AED 122a1990-0761-4b41-b9b3-58cba95be139 Basic data partition
├─sda5 ntfs 749CA1069CA0C3C8 51382eb4-bbd0-49fe-a781-a9b6dc6852e6 DATAS Basic data partition
└─sda6 ext4 368f90e1-8668-4428-a1be-5de45dc1adb0 c3366293-de7a-45da-952c-44bf292531b6
sdb
├─sdb1 vfat F0B2-A7C1 000ac543-01 UBUNTU 20_0
└─sdb2 ext3 809e02b8-a0f9-c249-b328-649442cd5a1b 000ac543-02 casper-rw
df (filtered): _________________________________________________________________
Avail Use% Mounted on
sda1 122.4M 75% /mnt/boot-sav/sda1
sda2 71M 26% /mnt/boot-sav/sda2
sda4 90G 19% /mnt/boot-sav/sda4
sda5 73.7G 9% /media/ubuntu/DATAS
sda6 19.3G 30% /mnt/boot-sav/sda6
sdb1 21.2G 11% /cdrom
sdb2 4.5G 4% /media/ubuntu/casper-rw
Mount options: __________________________________________________________________
sda1 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda2 rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sda4 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5 ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
sda6 rw,relatime
sdb1 ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sdb2 rw,nosuid,nodev,relatime
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Ubuntu 368f90e1-8668-4428-a1be-5de45dc1adb0
Ubuntu, avec Linux 5.4.0-42-generic 368f90e1-8668-4428-a1be-5de45dc1adb0
Windows Boot Manager (sur sda2) osprober-efi-76B4-4FFB
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=368f90e1-8668-4428-a1be-5de45dc1adb0 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=76B4-4FFB /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda6/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=""
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
200,082630157 = 214,837088256 boot/grub/grub.cfg 1
197,631832123 = 212,205563904 boot/vmlinuz 2
197,631832123 = 212,205563904 boot/vmlinuz-5.4.0-42-generic 2
198,928390503 = 213,597732864 boot/initrd.img 4
198,928390503 = 213,597732864 boot/initrd.img-5.4.0-42-generic 4
198,928390503 = 213,597732864 boot/initrd.img.old 4
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 17622 nov 12 23:15 10_linux
-rwxr-xr-x 1 root root 42359 nov 12 23:15 10_linux_zfs
-rwxr-xr-x 1 root root 12894 jui 31 00:34 20_linux_xen
-rwxr-xr-x 1 root root 12059 jui 31 00:34 30_os-prober
-rwxr-xr-x 1 root root 1424 jui 31 00:34 30_uefi-firmware
-rwxr-xr-x 1 root root 214 jui 31 00:34 40_custom
-rwxr-xr-x 1 root root 216 jui 31 00:34 41_custom
====================== sdb1/boot/grub/grub.cfg (filtered) ======================
Ubuntu
Ubuntu (safe graphics)
OEM install (for manufacturers)
Boot from next volume
UEFI Firmware Settings
========================= sdb1/syslinux.cfg (filtered) =========================
DEFAULT loadconfig
LABEL loadconfig
CONFIG /isolinux/isolinux.cfg
APPEND /isolinux/
==================== sdb1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
?? = ?? boot/grub/grub.cfg 1
================== sdb1: Location of files loaded by Syslinux ==================
GiB - GB File Fragment(s)
?? = ?? syslinux.cfg 1
?? = ?? ldlinux.sys 1
======================== Unknown MBRs/Boot Sectors/etc =========================
/dev/sda1: unknown GPT attributes
8000000000000001
/dev/sda2: unknown GPT attributes
8000000000000000
/dev/sda3: unknown GPT attributes
8000000000000000
=============================== StdErr Messages ================================
File descriptor 63 (pipe:[258633]) leaked on lvs invocation. Parent PID 26818: /bin/bash
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sda6,
using the following options: sda2/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the Ubuntu 20.04.1 LTS entry (sda2/efi/****/shim****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.
If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\shim****.efi (**** will be updated in the final message)
Voici ici le second fichier boot-info selon l'installation 1.2.2
Cas où aucun Ubuntu installé sur disque n'est opérationnel.
boot-info-4ppa125 [20201210_1533]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
=> Syslinux MBR (5.00 and higher) is installed in the MBR of /dev/sdb.
sda1: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: vfat
Boot sector type: Windows 8/2012: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/Boot/bootx64.efi /efi/Microsoft/Boot/bootmgfw.efi
/efi/Microsoft/Boot/bootmgr.efi
/efi/Microsoft/Boot/memtest.efi
sda3: __________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
sda4: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 8 or 10
Boot files: /Windows/System32/winload.exe
sda5: __________________________________________________________________________
File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
sdb1: __________________________________________________________________________
File system: vfat
Boot sector type: SYSLINUX 6.04
Boot sector info: Syslinux looks at sector 24608 of /dev/sdb1 for its
second stage. The integrity check of Syslinux failed.
No errors found in the Boot Parameter Block.
Operating System:
Boot files: /boot/grub/grub.cfg /syslinux.cfg
/efi/BOOT/grubx64.efi /efi/BOOT/mmx64.efi /ldlinux.sys
sdb2: __________________________________________________________________________
File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
================================ 2 OS detected =================================
OS#1: Ubuntu 20.04.1 LTS on sda6
OS#2: Windows 8 or 10 on sda4
============================ Architecture/Host Info ============================
CPU architecture: 64-bit
Live-session OS is Ubuntu 64-bit (Ubuntu 20.04.1 LTS, focal, x86_64)
===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this live-session.
SecureBoot disabled.
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001,0002
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* USB Hard Drive 1 - Kingston DataTraveler 3.0 BBS(HD,,0x900).......................................................................
Boot0002* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0003* Windows Boot Manager HD(2,GPT,8f8b36a8-d61c-47b5-8e3a-15bcc5bb59d8,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.}...t................
Boot0004* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0008* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0009* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000A* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000B* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000C* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000D* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000E* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot000F* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0010* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0011* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0012* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
Boot0013* ubuntu HD(2,GPT,66ed2205-93c9-484c-b9e5-4073e90700bb,0xfa000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
e87c4f299e44cf4153ad321c6fc7dabc sda2/Boot/bootx64.efi
e87c4f299e44cf4153ad321c6fc7dabc sda2/Microsoft/Boot/bootmgfw.efi
ac84bbacadaa85317812273ac07cda2f sda2/Microsoft/Boot/bootmgr.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, 2048 sectors * 512 bytes
sdb : notGPT, no-BIOSboot, has-noESP, usb-disk, not-mmc, no-os, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda1 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
sda4 : is-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda5 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, farbios
sda6 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ng, update-grub, farbios
sdb2 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
Partitions info (2/3): _________________________________________________________
sda1 : isnotESP, part-has-no-fstab, no-nt, no-winload, recovery-or-hidden, no-bmgr, notwinboot
sda2 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda4 : isnotESP, part-has-no-fstab, no-nt, haswinload, no-recov-nor-hid, no-bmgr, notwinboot
sda5 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda6 : isnotESP, fstab-has-bad-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sdb2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda1 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda2 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda4 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda5 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
sda6 : not-sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sda
sdb2 : maybesepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sdb
fdisk -l (filtered): ___________________________________________________________
Disk sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk identifier: C652B6D7-FBAA-44C8-89E4-0C33DC7F4C17
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 235061247 233799680 111.5G Microsoft basic data
sda5 235061248 405370879 170309632 81.2G Microsoft basic data
sda6 405370880 468860927 63490048 30.3G Linux filesystem
Disk sdb: 28.84 GiB, 30943995904 bytes, 60437492 sectors
Disk identifier: 0x000ac543
Boot Start End Sectors Size Id Type
sdb1 * 2048 49951723 49949676 23.8G c W95 FAT32 (LBA)
sdb2 49951724 60437443 10485720 5G 83 Linux
parted -lm (filtered): _________________________________________________________
sda:240GB:scsi:512:512:gpt:ATA KINGSTON SA400S3:;
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:120GB:120GB:ntfs:Basic data partition:msftdata;
5:120GB:208GB:87.2GB:ntfs:Basic data partition:msftdata;
6:208GB:240GB:32.5GB:ext4::;
sdb:30.9GB:scsi:512:512:msdos:Kingston DataTraveler 3.0:;
1:1049kB:25.6GB:25.6GB:fat32::boot, lba;
2:25.6GB:30.9GB:5369MB:ext3::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ntfs 0462A0ED62A0E520 d2fbe052-2ec8-4b64-a97d-0dd376288ea9 Récupération Basic data partition
├─sda2 vfat DAA2-CEFF 8f8b36a8-d61c-47b5-8e3a-15bcc5bb59d8 EFI system partition
├─sda3 7cc82604-a409-4055-b641-609a610df0a3 Microsoft reserved partition
├─sda4 ntfs 42AEA95EAEA94AED 122a1990-0761-4b41-b9b3-58cba95be139 Basic data partition
├─sda5 ntfs 749CA1069CA0C3C8 51382eb4-bbd0-49fe-a781-a9b6dc6852e6 DATAS Basic data partition
└─sda6 ext4 368f90e1-8668-4428-a1be-5de45dc1adb0 c3366293-de7a-45da-952c-44bf292531b6
sdb
├─sdb1 vfat F0B2-A7C1 000ac543-01 UBUNTU 20_0
└─sdb2 ext3 809e02b8-a0f9-c249-b328-649442cd5a1b 000ac543-02 casper-rw
df (filtered): _________________________________________________________________
Avail Use% Mounted on
sda1 122.4M 75% /mnt/boot-sav/sda1
sda2 71M 26% /mnt/boot-sav/sda2
sda4 90G 19% /mnt/boot-sav/sda4
sda5 73.7G 9% /media/ubuntu/DATAS
sda6 19.3G 30% /mnt/boot-sav/sda6
sdb1 21.2G 11% /cdrom
sdb2 4.5G 4% /media/ubuntu/casper-rw
Mount options: __________________________________________________________________
sda1 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda2 rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sda4 ro,relatime,user_id=0,group_id=0,allow_other,blksize=4096
sda5 ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096
sda6 rw,relatime
sdb1 ro,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sdb2 rw,nosuid,nodev,relatime
====================== sda6/boot/grub/grub.cfg (filtered) ======================
Ubuntu 368f90e1-8668-4428-a1be-5de45dc1adb0
Ubuntu, avec Linux 5.4.0-42-generic 368f90e1-8668-4428-a1be-5de45dc1adb0
Windows Boot Manager (sur sda2) osprober-efi-76B4-4FFB
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sda6/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=368f90e1-8668-4428-a1be-5de45dc1adb0 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda2 during installation
UUID=76B4-4FFB /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda6/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=""
==================== sda6: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
200,082630157 = 214,837088256 boot/grub/grub.cfg 1
197,631832123 = 212,205563904 boot/vmlinuz 2
197,631832123 = 212,205563904 boot/vmlinuz-5.4.0-42-generic 2
198,928390503 = 213,597732864 boot/initrd.img 4
198,928390503 = 213,597732864 boot/initrd.img-5.4.0-42-generic 4
198,928390503 = 213,597732864 boot/initrd.img.old 4
===================== sda6: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 17622 nov 12 23:15 10_linux
-rwxr-xr-x 1 root root 42359 nov 12 23:15 10_linux_zfs
-rwxr-xr-x 1 root root 12894 jui 31 00:34 20_linux_xen
-rwxr-xr-x 1 root root 12059 jui 31 00:34 30_os-prober
-rwxr-xr-x 1 root root 1424 jui 31 00:34 30_uefi-firmware
-rwxr-xr-x 1 root root 214 jui 31 00:34 40_custom
-rwxr-xr-x 1 root root 216 jui 31 00:34 41_custom
====================== sdb1/boot/grub/grub.cfg (filtered) ======================
Ubuntu
Ubuntu (safe graphics)
OEM install (for manufacturers)
Boot from next volume
UEFI Firmware Settings
========================= sdb1/syslinux.cfg (filtered) =========================
DEFAULT loadconfig
LABEL loadconfig
CONFIG /isolinux/isolinux.cfg
APPEND /isolinux/
==================== sdb1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
?? = ?? boot/grub/grub.cfg 1
================== sdb1: Location of files loaded by Syslinux ==================
GiB - GB File Fragment(s)
?? = ?? syslinux.cfg 1
?? = ?? ldlinux.sys 1
======================== Unknown MBRs/Boot Sectors/etc =========================
/dev/sda1: unknown GPT attributes
8000000000000001
/dev/sda2: unknown GPT attributes
8000000000000000
/dev/sda3: unknown GPT attributes
8000000000000000
=============================== StdErr Messages ================================
File descriptor 63 (pipe:[279191]) leaked on lvs invocation. Parent PID 44141: /bin/bash
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to sign-grub) and reinstall the grub-efi-amd64-signed of
sda6,
using the following options: sda2/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s win-legacy-basic-fix use-standard-efi-file
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the Ubuntu 20.04.1 LTS entry (sda2/efi/****/shim****.efi (**** will be updated in the final message) file) !
If your computer reboots directly into Windows, try to change the boot order in your UEFI firmware.
If your UEFI firmware does not allow to change the boot order, change the default boot entry of the Windows bootloader.
For example you can boot into Windows, then type the following command in an admin command prompt:
bcdedit /set {bootmgr} path \EFI\****\shim****.efi (**** will be updated in the final message)
Dernière modification par Mario2020C (Le 10/12/2020, à 16:38)
Hors ligne
#20 Le 11/12/2020, à 08:04
- ikewdu
Re : Message d'erreur lors du démarrage
Re,
Je ne comprends pas la situation : dans le premier cas, veux-tu dire que tout fonctionne ? Et dans le second cas, c'est le contraire ?
Hors ligne
#21 Le 11/12/2020, à 21:29
- Mario2020C
Re : Message d'erreur lors du démarrage
C'est pourtant ce qui se passait et curieusement, je me suis retrouvé avec une machine qui était devenue super lente.
Je croyais que le problème venait du BIOS qui avait été corrompu du à une mise à jour mais vraiment rien ne fonctionnait.
J'ai donc décidé (pour le moment) de me concentrer sur une installation simple de Linux sur ce portable puisque c'est ce qui m'offre le plus de sécurité.
Donc mon disque dur SSD de 250G a été complètement formaté et j'ai réinstallé un version de Ubuntu 20.04 sur une clé USB 3.0.
L'installation sur la clé s'est effectuée sans problème.
Durant le démarrage à partir de la clé USB, j'ai un message qui s'affiche très rapidement et j'ai dû filmer l'écran avec mon cellulaire pour pouvoir le visionner après un second démarrage:
[ 3.834289] Initramfs unpacking failed: Decoding failed
L'installation de Ubuntu 20.04 s'est bien effectué malgré que j'ai trouvé tout un peu lent.
Finalement, après le redémarrage du portable je me retrouve encore une fois avec le même message soit:
FW Status Recovery Error
System BootOrder not found. Initializing defaults
Creating boot entry «Boot0006» with label «ubuntu» for file /EFI/ubuntu/shimx64.efi
Voilà
J'ai fait un Boot-info de ubuntu tel qu'il a démarré après l'installation (sans clé USB). (Impossible de le faire en démarrant avec la clé USB. Le système est trop lent et ne répond pas à toutes les commandes.
boot-info-4ppa125 [20201211_1456]
============================== Boot Info Summary ===============================
=> No boot loader is installed in the MBR of /dev/sda.
sda1: __________________________________________________________________________
File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /efi/BOOT/fbx64.efi /efi/BOOT/mmx64.efi
/efi/ubuntu/grubx64.efi /efi/ubuntu/mmx64.efi
/efi/ubuntu/shimx64.efi /efi/ubuntu/grub.cfg
sda2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
================================ 1 OS detected =================================
OS#1: L'OS actuellement utilisé - Ubuntu 20.04.1 LTS CurrentSession on sda2
============================ Architecture/Host Info ============================
CPU architecture: 64-bit
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-5.4.0-54-generic root=UUID=4d1b1b95-4068-4506-9318-3d1b3888f8d6 ro quiet splash vt.handoff=7
===================================== UEFI =====================================
BIOS is EFI-compatible, and is setup in EFI-mode for this installed-session.
SecureBoot disabled.
efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0006
Boot0000* Notebook Hard Drive BBS(HD,,0x0).......................................................................
Boot0001* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0002* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0003* ubuntu HD(1,GPT,aae6206b-bd99-4e89-85b3-6574956c225c,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0004* ubuntu HD(1,GPT,aae6206b-bd99-4e89-85b3-6574956c225c,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0005* ubuntu HD(1,GPT,aae6206b-bd99-4e89-85b3-6574956c225c,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0006* ubuntu HD(1,GPT,aae6206b-bd99-4e89-85b3-6574956c225c,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0011* Notebook Ethernet BBS(128,,0x0)........................E..............................................
Boot0012* USB Hard Drive 1 - Kingston DataTraveler 3.0 BBS(HD,,0x900).......................................................................
Boot0013* Notebook Ethernet BBS(128,,0x0)........................E..............................................
2895d47544fd587b26c7e29be1295c27 sda1/BOOT/fbx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda1/BOOT/mmx64.efi
8ed07d5ee4e5e1534bcf64037b7589ff sda1/ubuntu/grubx64.efi
dc3c47be2f78a78e5e57d097ae6c5c84 sda1/ubuntu/mmx64.efi
78415fb8fb9b909f8029858113f1335f sda1/ubuntu/shimx64.efi
78415fb8fb9b909f8029858113f1335f sda1/BOOT/BOOTX64.efi
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sda : is-GPT, no-BIOSboot, has---ESP, not-usb, not-mmc, has-os, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sda2 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, farbios
sda1 : no-os, 32, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, not-far
Partitions info (2/3): _________________________________________________________
sda2 : isnotESP, fstab-has-goodEFI, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
sda1 : is---ESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot
Partitions info (3/3): _________________________________________________________
sda2 : not-sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sda
sda1 : not-sepboot, no-boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, std-grub.d, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk identifier: 29CBA8DF-671C-4D30-86C6-05B19436417D
Start End Sectors Size Type
sda1 2048 1050623 1048576 512M EFI System
sda2 1050624 468860927 467810304 223.1G Linux filesystem
parted -lm (filtered): _________________________________________________________
sda:240GB:scsi:512:512:gpt:ATA KINGSTON SA400S3:;
1:1049kB:538MB:537MB:fat32:EFI System Partition:boot, esp;
2:538MB:240GB:240GB:ext4::;
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 vfat 431B-7591 aae6206b-bd99-4e89-85b3-6574956c225c EFI System Partition
└─sda2 ext4 4d1b1b95-4068-4506-9318-3d1b3888f8d6 ed24fbf0-26fe-4282-937e-518cf4f9e1ea
df (filtered): _________________________________________________________________
Avail Use% Mounted on
sda1 503.2M 2% /mnt/boot-sav/sda1
sda2 189G 8% /
Mount options: __________________________________________________________________
sda1 rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
sda2 rw,relatime,errors=remount-ro
===================== sda1/efi/ubuntu/grub.cfg (filtered) ======================
search.fs_uuid 4d1b1b95-4068-4506-9318-3d1b3888f8d6 root hd0,gpt2
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
====================== sda2/boot/grub/grub.cfg (filtered) ======================
Ubuntu 4d1b1b95-4068-4506-9318-3d1b3888f8d6
Ubuntu, avec Linux 5.4.0-54-generic 4d1b1b95-4068-4506-9318-3d1b3888f8d6
Ubuntu, avec Linux 5.4.0-42-generic 4d1b1b95-4068-4506-9318-3d1b3888f8d6
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sda2/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=4d1b1b95-4068-4506-9318-3d1b3888f8d6 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=431B-7591 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
======================= sda2/etc/default/grub (filtered) =======================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sda2: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
150,632041931 = 161,739923456 boot/grub/grub.cfg 2
125,410289764 = 134,658273280 boot/vmlinuz 2
5,043087006 = 5,414973440 boot/vmlinuz-5.4.0-42-generic 1
125,410289764 = 134,658273280 boot/vmlinuz-5.4.0-54-generic 2
5,043087006 = 5,414973440 boot/vmlinuz.old 1
5,758495331 = 6,183137280 boot/initrd.img 3
127,309249878 = 136,697266176 boot/initrd.img-5.4.0-42-generic 1
5,758495331 = 6,183137280 boot/initrd.img-5.4.0-54-generic 3
127,309249878 = 136,697266176 boot/initrd.img.old 1
===================== sda2: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 17622 nov 12 18:15 10_linux
-rwxr-xr-x 1 root root 42359 nov 12 18:15 10_linux_zfs
-rwxr-xr-x 1 root root 12894 jui 30 20:34 20_linux_xen
-rwxr-xr-x 1 root root 12059 jui 30 20:34 30_os-prober
-rwxr-xr-x 1 root root 1424 jui 30 20:34 30_uefi-firmware
-rwxr-xr-x 1 root root 214 jui 30 20:34 40_custom
-rwxr-xr-x 1 root root 216 jui 30 20:34 41_custom
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would reinstall the grub-efi-amd64-signed of
sda2,
using the following options: sda1/boot/efi,
Additional repair would be performed: unhide-bootmenu-10s use-standard-efi-file
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your UEFI firmware boot on the L'OS actuellement utilisé - Ubuntu 20.04.1 LTS CurrentSession entry (sda1/efi/****/shim****.efi (**** will be updated in the final message) file) !
Je dois souligner qu'à part le message de démarrage (FW Status...) qui demande quelques secondes, le reste est très rapide et le système est très fluide. Si je peux me débarasser de ce message du début qui me fait craindre une anomalie quelconque, je serais satisfait du reste.
Il me restera dans les semaines qui suivent (après avoir effectué une image du disque) à réinstaller Windows 10 sur une autre partition.
Hors ligne
#22 Le 12/12/2020, à 19:55
- Mario2020C
Re : Message d'erreur lors du démarrage
Je continue mes recherches concernant mon message d'erreur du démarrage FW Status Recovery error...
Étant donné que cela concerne le fichier shimx64.efi, je suis allé tenter de l'éditer histoire de lire son contenu.
Je me retrouve avec des répertoires et noms de fichiers qui ont des icones avec un X.
Et de plus, le répertoire EFI est inconnu.
Est-ce que les icones qui possèdent un X sont-ils corrompus ou alors non-accessibles parce qu'ils sont fichiers et répertoires systèmes?
Contenu 1 de mon répertoire boot
Contenu 2 de mon répertoire boot
Probablement la cause de mon message d'erreur du démarrage.
Hors ligne
Pages : 1