Pages : 1
#1 Le 14/01/2025, à 22:31
- dom12
emergency mode
Bonjour,
Au démarrage de Ubuntu (V24.04 LTS) je rencontre l'erreur:
"You are in emergency mode. After logging in, type « journalctl -xb» to view system logs, « systemctl reboot » to reboot, « systemctl default » or « exit » to boot into default mode.
Appuyer sur Entrée pour la maintenance
(ou appuyer sur Ctrl et D pour continuer) "
J'ai tapé (comme j'ai trouvé indiqué sur le forum):
journalctl -b -p err
qui donne cette information que j'ai prise en photo:
root@h63: ** journalctl-b -p err
janv. 14 21:18:23 h63 kernel: x86/pu: VMX (outside TXT) disabled by BIOS
jan. 14 21:19:53 h69 systemd [1]: Timed out waiting for device dev-disk-by\x2duuid-70D6\x2d1701.device - /dev/disk/by-uuid/70D6-1701.
root@h63:#
Après Ubuntu démarre 'normalement'
Pour information j'ai exécuté le boot-info (c'est la 1ere fois), je suppose que cela vous donne les informations de mon systeme (sinon dites moi ce qu'il vous faut):
https://paste.ubuntu.com/p/pt4YKyNt2f/
Quelqu’un peut il m'aider?
Grand merci car je suis perdu.
Dominique
Hors ligne
#2 Le 14/01/2025, à 22:40
- xubu1957
Re : emergency mode
Bonjour,
Collage du Boot-info, (2079 lignes !) pour les spécialistes :
boot-info-4ppa2081 [20250114_2201]
============================== 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 2048
of the same hard drive for core.img. core.img is at this location and
looks for (,gpt1)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_gpt biosdisk
---------------------------------------------------------------------------
=> Grub2 (v2.00) is installed in the MBR of /dev/sdc and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos1)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_msdos biosdisk
---------------------------------------------------------------------------
=> Grub2 (v2.00) is installed in the MBR of /dev/sdd and looks at sector 2048
of the same hard drive for core.img. core.img is at this location and
looks for (,gpt1)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_gpt biosdisk
---------------------------------------------------------------------------
=> Grub2 (v2.00) is installed in the MBR of /dev/sde and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos2)/boot/grub. It also embeds following components:
modules
---------------------------------------------------------------------------
fshelp ext2 part_msdos biosdisk
---------------------------------------------------------------------------
sda1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sda2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sda3: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdb1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 22.04.5 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sdb2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdb3: __________________________________________________________________________
File system: BIOS Boot partition
Boot sector type: Grub2's core.img
Boot sector info:
sdc1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 24.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sdc2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdc3: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.5 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sdc4: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdd1: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 24.04.1 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /etc/default/grub
/boot/grub/i386-pc/core.img
sdd2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdd3: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdd4: __________________________________________________________________________
File system: BIOS Boot partition
Boot sector type: Grub2's core.img
Boot sector info:
sde1: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sde2: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sde4: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
================================ 4 OS detected =================================
OS#1 (linux): L'OS actuellement utilisé - Ubuntu 24.04.1 LTS on sdd1
OS#2 (linux): Ubuntu 22.04.5 LTS on sdb1
OS#3 (linux): Ubuntu 24.04.1 LTS on sdc1
OS#4 (linux): Ubuntu 20.04.5 LTS on sdc3
================================ Host/Hardware =================================
CPU architecture: 64-bit
Video: Park [Mobility Radeon HD 5430] 2nd Generation Core Processor Family Integrated Graphics Controller from Advanced Micro Devices, Inc. [AMD/ATI] Intel Corporation
BOOT_IMAGE of the installed session in use:
/boot/vmlinuz-6.8.0-51-generic root=UUID=9ad91ff3-16e6-4507-8211-5af34dcacc8a ro quiet splash vt.handoff=7
df -Th / : /dev/sdd1 ext4 43G 20G 21G 50% /
===================================== UEFI =====================================
BIOS/UEFI firmware: F12 from Award Software International, Inc.
This installed-session is in Legacy/BIOS/CSM mode (not in EFI mode).
============================= Drive/Partition Info =============================
Disks info: ____________________________________________________________________
sdd : is-GPT, hasBIOSboot, has-noESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sdb : is-GPT, hasBIOSboot, has-noESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sde : notGPT, no-BIOSboot, has-noESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
sdc : notGPT, no-BIOSboot, has-noESP, not-usb, not-mmc, has-os, no-wind, 2048 sectors * 512 bytes
sda : is-GPT, no-BIOSboot, has-noESP, not-usb, not-mmc, no-os, no-wind, 2048 sectors * 512 bytes
Partitions info (1/3): _________________________________________________________
sdd1 : is-os, 64, apt-get, signed grub-pc grub-efi , grub2, grub-install, grubenv-ok, update-grub, not-far
sdd2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sdd3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sdb2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sdb1 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, not-far
sde2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sde4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sdc2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sdc3 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sdc1 : is-os, 64, apt-get, grub-pc , grub2, grub-install, grubenv-ok, update-grub, end-after-100GB
sdc4 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sda2 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sda3 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
sda1 : no-os, 64, nopakmgr, no-docgrub, nogrub, nogrubinstall, no-grubenv, noupdategrub, end-after-100GB
Partitions info (2/3): _________________________________________________________
sdd1 : isnotESP, fstab-has-bad-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdd2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdd3 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdb2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdb1 : isnotESP, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sde2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sde4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdc2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdc3 : isnotESP, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdc1 : isnotESP, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sdc4 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sda2 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sda3 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
sda1 : isnotESP, part-has-no-fstab, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, ext4
Partitions info (3/3): _________________________________________________________
sdd1 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, customized, sdd
sdd2 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdd
sdd3 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdd
sdb2 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdb
sdb1 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sdb
sde2 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sde
sde4 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sde
sdc2 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sdc3 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sdc
sdc1 : not--sepboot, with-boot, fstab-without-boot, not-sep-usr, with--usr, fstab-without-usr, std-grub.d, sdc
sdc4 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sdc
sda2 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda3 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
sda1 : maybesepboot, no---boot, part-has-no-fstab, not-sep-usr, no---usr, part-has-no-fstab, no--grub.d, sda
fdisk -l (filtered): ___________________________________________________________
Disk sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk identifier: 10A3F1FE-BB8A-47E5-A985-20EF48928F9F
Start End Sectors Size Type
sda1 2048 2453616639 2453614592 1.1T Linux filesystem
sda2 2453616640 2578610175 124993536 59.6G Linux filesystem
sda3 2578610176 2777872383 199262208 95G Linux filesystem
Disk sdb: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk identifier: 419BD892-56B8-42BA-95FD-7D809D7C54BD
Start End Sectors Size Type
sdb1 194560 96389119 96194560 45.9G Linux filesystem
sdb2 96389120 219531263 123142144 58.7G Linux home
sdb3 2048 194559 192512 94M BIOS boot
Partition table entries are not in disk order.
Disk sdc: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk identifier: 0x732c6854
Boot Start End Sectors Size Id Type
sdc1 2048 3024041983 3024039936 1.4T 83 Linux
sdc2 3024041984 3108009983 83968000 40G 83 Linux
sdc3 3108009984 3190044671 82034688 39.1G 83 Linux
sdc4 3212646400 3335526399 122880000 58.6G 83 Linux
Disk sdd: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk identifier: 3EE5A814-5270-430B-AED6-8F9F2FB2222A
Start End Sectors Size Type
sdd1 186368 91797503 91611136 43.7G Linux filesystem
sdd2 91797504 203124735 111327232 53.1G Linux filesystem
sdd3 203124736 3907028991 3703904256 1.7T Linux filesystem
sdd4 2048 186367 184320 90M BIOS boot
Partition table entries are not in disk order.
Disk sde: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk identifier: 0xe0dca3bb
Boot Start End Sectors Size Id Type
sde1 2048 96255 94208 46M 82 Linux swap / Solaris
sde2 96256 204896255 204800000 97.7G 83 Linux
sde4 1757908992 3907028991 2149120000 1T 83 Linux
parted -lm (filtered): _________________________________________________________
sda:2000GB:scsi:512:4096:gpt:ATA ST2000DM008-2UB1:;
1:1049kB:1256GB:1256GB:ext4:CPY-h560mbp:;
2:1256GB:1320GB:64.0GB:ext4:CPY-h63-home:;
3:1320GB:1422GB:102GB:ext4:jeedom:;
sdb:120GB:scsi:512:512:gpt:ATA CT120BX500SSD1:;
3:1049kB:99.6MB:98.6MB::bios_grub:bios_grub;
1:99.6MB:49.4GB:49.3GB:ext4:cpy_h63-system:;
2:49.4GB:112GB:63.0GB:ext4:cpy_h63-home:linux-home;
sdc:2000GB:scsi:512:4096:msdos:ATA ST2000DM001-1CH1:;
1:1049kB:1548GB:1548GB:ext4::;
2:1548GB:1591GB:43.0GB:ext4::;
3:1591GB:1633GB:42.0GB:ext4::;
4:1645GB:1708GB:62.9GB:ext4::;
sdd:2000GB:scsi:512:4096:gpt:ATA ST2000DM008-2FR1:;
4:1049kB:95.4MB:94.4MB::BIOS-Boot:bios_grub;
1:95.4MB:47.0GB:46.9GB:ext4::;
2:47.0GB:104GB:57.0GB:ext4::;
3:104GB:2000GB:1896GB:ext4:temp:;
sde:2000GB:scsi:512:4096:msdos:ATA ST2000DM008-2FR1:;
1:1049kB:49.3MB:48.2MB:linux-swap(v1)::swap;
2:49.3MB:105GB:105GB:ext4::;
4:900GB:2000GB:1100GB:ext4::;
Free space >10MiB: ______________________________________________________________
sda: 1356383MiB:1907729MiB:551346MiB
sdb: 107193MiB:114473MiB:7280MiB
sdc: 1557639MiB:1568675MiB:11036MiB
sdc: 1628675MiB:1907729MiB:279054MiB
sde: 100047MiB:858354MiB:758307MiB
blkid (filtered): ______________________________________________________________
NAME FSTYPE UUID PARTUUID LABEL PARTLABEL
sda
├─sda1 ext4 b630b73c-5da2-4184-9bce-b2db6a85c98b 590e6293-28a0-4480-9a89-4b1360cf2ec4 CPY-h560mbp CPY-h560mbp
├─sda2 ext4 843515ac-b6f3-4e97-b7cc-08df8e3ad3a5 b3c1c0ae-98a2-402d-95e9-7766e31f6f39 CPY-h63-home CPY-h63-home
└─sda3 ext4 fe1177cf-4b5d-4973-aa6a-c4f200974910 543b1958-c795-4118-aa97-8261c104ab51 jeedom jeedom
sdb
├─sdb1 ext4 fd896e01-ae11-40e6-83e5-035ee7ac4e7a b7ffd733-e683-4819-9549-09c51c3fe200 cpy_h63-system cpy_h63-system
├─sdb2 ext4 3676c61d-a3e7-4142-857e-b9f327c1ea2d 5ef447d8-4836-4d6f-8c68-828959f0ce68 cpy_h63_home cpy_h63-home
└─sdb3 77b9b7fd-910e-4b53-a316-16a88a0f9d94 bios_grub
sdc
├─sdc1 ext4 e250a09b-665e-41fa-96dc-d62e3bfb55af 732c6854-01
├─sdc2 ext4 248607fb-5d4f-4ea2-8c9f-277a8b6f11d3 732c6854-02 CPY-h63_system
├─sdc3 ext4 ab2d374b-0de4-4701-a67b-7cff23dfaa98 732c6854-03 CPY-2Th580system
└─sdc4 ext4 2cdbcff1-070c-4ea9-be6d-9fab62dd1aca 732c6854-04 CPYCPY-h63-home
sdd
├─sdd1 ext4 9ad91ff3-16e6-4507-8211-5af34dcacc8a c51b7092-601a-41c1-946f-8b865fc367ae h63_system
├─sdd2 ext4 571a76fe-30b4-4c0e-987e-c90142bf18e2 1ec914c7-ebba-402a-999f-d20528788cb2 h63_home
├─sdd3 ext4 91d7ec0b-e506-4620-8916-2324fe0d57be 2d97cd43-19ae-4189-a285-31c3b9d3a5c8 temp temp
└─sdd4 171477a2-6eae-4627-a974-b212f700f72f BIOS-Boot
sde
├─sde1 swap 55646371-2f74-4a24-964d-63554af1c511 e0dca3bb-01
├─sde2 ext4 e385cb67-18ab-4167-ab3c-c2bf6498098b e0dca3bb-02 CPY_JEEDOM
└─sde4 ext4 d2a3b910-e479-4342-9742-d3e9f5148d99 e0dca3bb-04 h560mbp
Mount points (filtered): _______________________________________________________
Avail Use% Mounted on
/dev/sda1 332.4G 66% /mnt/boot-sav/sda1
/dev/sda2 28G 47% /mnt/boot-sav/sda2
/dev/sda3 76.4G 13% /mnt/boot-sav/sda3
/dev/sdb1 18.3G 54% /mnt/boot-sav/sdb1
/dev/sdb2 24.1G 53% /mnt/boot-sav/sdb2
/dev/sdc1 1.3T 1% /mnt/boot-sav/sdc1
/dev/sdc2 37.1G 0% /mnt/boot-sav/sdc2
/dev/sdc3 18.4G 47% /mnt/boot-sav/sdc3
/dev/sdc4 21.3G 58% /mnt/boot-sav/sdc4
/dev/sdd1 20.6G 47% /
/dev/sdd2 17.2G 62% /home
/dev/sdd3 1.6T 0% /mnt/boot-sav/sdd3
/dev/sde2 19.8G 74% /mnt/boot-sav/sde2
/dev/sde4 185.6G 76% /media/dvmbp/h560mbp
Mount options (filtered): ______________________________________________________
/dev/sda1 ext4 rw,relatime
/dev/sda2 ext4 rw,relatime
/dev/sda3 ext4 rw,relatime
/dev/sdb1 ext4 rw,relatime
/dev/sdb2 ext4 rw,relatime
/dev/sdc1 ext4 rw,relatime
/dev/sdc2 ext4 rw,relatime
/dev/sdc3 ext4 rw,relatime
/dev/sdc4 ext4 rw,relatime
/dev/sdd1 ext4 rw,relatime,errors=remount-ro
/dev/sdd2 ext4 rw,relatime
/dev/sdd3 ext4 rw,relatime
/dev/sde2 ext4 rw,relatime
/dev/sde4 ext4 rw,nosuid,nodev,relatime,errors=remount-ro
====================== sdb1/boot/grub/grub.cfg (filtered) ======================
Ubuntu fd896e01-ae11-40e6-83e5-035ee7ac4e7a
Ubuntu 24.04.1 LTS (24.04) (on sdb1) e250a09b-665e-41fa-96dc-d62e3bfb55af
Ubuntu 20.04.5 LTS (20.04) (on sdb3) ab2d374b-0de4-4701-a67b-7cff23dfaa98
Ubuntu 24.04.1 LTS (24.04) (on sdc1) 9ad91ff3-16e6-4507-8211-5af34dcacc8a
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###
========================== sdb1/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=9ad91ff3-16e6-4507-8211-5af34dcacc8a / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
# /home was on /dev/sdb2 during installation
UUID=571a76fe-30b4-4c0e-987e-c90142bf18e2 /home ext4 defaults 0 2
# swap was on /dev/sdk1 during installation
UUID=55646371-2f74-4a24-964d-63554af1c511 none swap sw 0 0
======================= sdb1/etc/default/grub (filtered) =======================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_OS_PROBER=false
==================== sdb1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
8,778888702 = 9,426259968 boot/grub/grub.cfg 1
8,246204376 = 8,854294528 boot/grub/i386-pc/core.img 1
1,514644623 = 1,626337280 boot/vmlinuz 2
7,418121338 = 7,965147136 boot/vmlinuz-6.2.0-37-generic 2
31,083225250 = 33,375358976 boot/vmlinuz-6.8.0-49-generic 2
1,514644623 = 1,626337280 boot/vmlinuz-6.8.0-51-generic 2
31,083225250 = 33,375358976 boot/vmlinuz.old 2
25,202144623 = 27,060596736 boot/initrd.img 4
31,217769623 = 33,519824896 boot/initrd.img-6.2.0-37-generic 6
23,569332123 = 25,307377664 boot/initrd.img-6.8.0-49-generic 2
25,202144623 = 27,060596736 boot/initrd.img-6.8.0-51-generic 4
23,569332123 = 25,307377664 boot/initrd.img.old 2
===================== sdb1: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18683 Dec 18 2022 10_linux
-rwxr-xr-x 1 root root 43031 Dec 18 2022 10_linux_zfs
-rwxr-xr-x 1 root root 14387 Dec 18 2022 20_linux_xen
-rwxr-xr-x 1 root root 13369 Dec 18 2022 30_os-prober
-rwxr-xr-x 1 root root 1372 Dec 18 2022 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Dec 18 2022 40_custom
-rwxr-xr-x 1 root root 215 Dec 18 2022 41_custom
====================== sdc1/boot/grub/grub.cfg (filtered) ======================
Ubuntu e250a09b-665e-41fa-96dc-d62e3bfb55af
Mac OS X (32-bit) (on sda2) osprober-xnu-32-789cd3f5409a58d9
Mac OS X (32-bit) (on sda3) osprober-xnu-32-2337d1e7723978aa
Mac OS X (32-bit) (on sda4) osprober-xnu-32-6513b09c79fb6d08
Mac OS X (32-bit) (on sda5) osprober-xnu-32-5587e248bddbcdfd
Mac OS X (32-bit) (on sdb2) osprober-xnu-32-6070c0b728958aee
Mac OS X (32-bit) (on sdb3) osprober-xnu-32-644df2e5fa8780d2
Ubuntu 22.04.4 LTS (22.04) (on sdc1) fd896e01-ae11-40e6-83e5-035ee7ac4e7a
Ubuntu 20.04.5 LTS (20.04) (on sdd3) ab2d374b-0de4-4701-a67b-7cff23dfaa98
### END /etc/grub.d/30_os-prober ###
UEFI Firmware Settings uefi-firmware
### END /etc/grub.d/30_uefi-firmware ###
========================== sdc1/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdd1 during curtin installation
/dev/disk/by-uuid/e250a09b-665e-41fa-96dc-d62e3bfb55af / ext4 defaults 0 1
# /home was on /dev/sdd4 during curtin installation
/dev/disk/by-uuid/2cdbcff1-070c-4ea9-be6d-9fab62dd1aca /home ext4 defaults 0 1
/swap.img none swap sw 0 0
======================= sdc1/etc/default/grub (filtered) =======================
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`( . /etc/os-release; echo ${NAME:-Ubuntu} ) 2>/dev/null || echo Ubuntu`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
==================== sdc1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
1114,131877899 = 1196,289994752 boot/grub/grub.cfg 1
1214,524299622 = 1304,085536768 boot/grub/i386-pc/core.img 1
1204,913352966 = 1293,765861376 boot/vmlinuz 1
1204,913352966 = 1293,765861376 boot/vmlinuz-6.8.0-51-generic 1
1204,913352966 = 1293,765861376 boot/vmlinuz.old 1
1217,601280212 = 1307,389419520 boot/initrd.img 1
1217,601280212 = 1307,389419520 boot/initrd.img-6.8.0-51-generic 1
1217,601280212 = 1307,389419520 boot/initrd.img.old 1
===================== sdc1: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18133 Apr 4 2024 10_linux
-rwxr-xr-x 1 root root 43202 Apr 4 2024 10_linux_zfs
-rwxr-xr-x 1 root root 14513 Apr 4 2024 20_linux_xen
-rwxr-xr-x 1 root root 786 Apr 4 2024 25_bli
-rwxr-xr-x 1 root root 13120 Apr 4 2024 30_os-prober
-rwxr-xr-x 1 root root 1174 Apr 4 2024 30_uefi-firmware
-rwxr-xr-x 1 root root 722 Apr 5 2024 35_fwupd
-rwxr-xr-x 1 root root 214 Apr 4 2024 40_custom
-rwxr-xr-x 1 root root 215 Apr 4 2024 41_custom
====================== sdc3/boot/grub/grub.cfg (filtered) ======================
Ubuntu f30c3d3c-6209-4de5-9ea7-6a76a08ec233
Mac OS X (32 bits) (sur sda2) osprober-xnu-32-6070c0b728958aee
Mac OS X (32 bits) (sur sda3) osprober-xnu-32-644df2e5fa8780d2
Ubuntu 20.04.4 LTS (20.04) (sur sdb2) a7d39d05-397a-4223-a6e1-468f0ac4eabc
Mac OS X (32 bits) (sur sdf2) osprober-xnu-32-789cd3f5409a58d9
Mac OS X (32 bits) (sur sdf3) osprober-xnu-32-2337d1e7723978aa
Mac OS X (32 bits) (sur sdf4) osprober-xnu-32-6513b09c79fb6d08
Mac OS X (32 bits) (sur sdf5) osprober-xnu-32-5587e248bddbcdfd
### END /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_uefi-firmware ###
========================== sdc3/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdd1 during installation
UUID=f30c3d3c-6209-4de5-9ea7-6a76a08ec233 / ext4 errors=remount-ro 0 1
# /home was on /dev/sdd2 during installation
UUID=e8296386-c0c8-4aa8-ad3b-27a7e2d3c487 /home ext4 defaults 0 2
# swap was on /dev/sdb1 during installation
UUID=55646371-2f74-4a24-964d-63554af1c511 none swap sw 0 0
UUID=d2a3b910-e479-4342-9742-d3e9f5148d99 /media/dvmbp/h560mbp ext4 defaults 0 2
======================= sdc3/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=""
==================== sdc3: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
1491,997112274 = 1602,019700736 boot/grub/grub.cfg 1
1494,157028198 = 1604,338892800 boot/grub/i386-pc/core.img 1
1482,298728943 = 1591,606140928 boot/vmlinuz 1
1482,288082123 = 1591,594708992 boot/vmlinuz-5.15.0-43-generic 2
1482,298728943 = 1591,606140928 boot/vmlinuz-5.15.0-46-generic 1
1482,288082123 = 1591,594708992 boot/vmlinuz.old 2
1482,280269623 = 1591,586320384 boot/initrd.img 3
1482,265792847 = 1591,570776064 boot/initrd.img-5.15.0-43-generic 2
1482,280269623 = 1591,586320384 boot/initrd.img-5.15.0-46-generic 3
1482,265792847 = 1591,570776064 boot/initrd.img.old 2
===================== sdc3: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18224 Jan 11 2022 10_linux
-rwxr-xr-x 1 root root 42359 Jan 11 2022 10_linux_zfs
-rwxr-xr-x 1 root root 12894 Apr 15 2020 20_linux_xen
-rwxr-xr-x 1 root root 12059 Apr 15 2020 30_os-prober
-rwxr-xr-x 1 root root 1424 Apr 15 2020 30_uefi-firmware
-rwxr-xr-x 1 root root 700 Feb 21 2022 35_fwupd
-rwxr-xr-x 1 root root 214 Apr 15 2020 40_custom
-rwxr-xr-x 1 root root 216 Apr 15 2020 41_custom
====================== sdd1/boot/grub/grub.cfg (filtered) ======================
Ubuntu 9ad91ff3-16e6-4507-8211-5af34dcacc8a
### END /etc/grub.d/30_os-prober_proxy ###
Ubuntu 22.04.5 LTS (22.04) (on sda1) fd896e01-ae11-40e6-83e5-035ee7ac4e7a
Ubuntu 24.04.1 LTS (24.04) (on sdb1) e250a09b-665e-41fa-96dc-d62e3bfb55af
Ubuntu 20.04.5 LTS (20.04) (on sdb3) ab2d374b-0de4-4701-a67b-7cff23dfaa98
========================== sdd1/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=9ad91ff3-16e6-4507-8211-5af34dcacc8a / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=70D6-1701 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb2 during installation
UUID=571a76fe-30b4-4c0e-987e-c90142bf18e2 /home ext4 defaults 0 2
# swap was on /dev/sdk1 during installation
UUID=55646371-2f74-4a24-964d-63554af1c511 none swap sw 0 0
/dev/disk/by-uuid/3676c61d-a3e7-4142-857e-b9f327c1ea2d /home/cpy_h63_home/3676c61d-a3e7-4142-857e-b9f327c1ea2d auto nosuid,nodev,nofail,x-gvfs-show,noauto 0 0
======================= sdd1/etc/default/grub (filtered) =======================
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT=20
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_SAVEDEFAULT="false"
==================== sdd1: Location of files loaded by Grub ====================
GiB - GB File Fragment(s)
32,815597534 = 35,235479552 boot/grub/grub.cfg 1
23,312473297 = 25,031577600 boot/grub/i386-pc/core.img 1
1,798118591 = 1,930715136 boot/vmlinuz 1
15,368434906 = 16,501731328 boot/vmlinuz-6.8.0-50-generic 1
1,798118591 = 1,930715136 boot/vmlinuz-6.8.0-51-generic 1
15,368434906 = 16,501731328 boot/vmlinuz.old 1
22,814235687 = 24,496599040 boot/initrd.img 4
33,845485687 = 36,341313536 boot/initrd.img-6.8.0-50-generic 1
22,814235687 = 24,496599040 boot/initrd.img-6.8.0-51-generic 4
33,845485687 = 36,341313536 boot/initrd.img.old 1
===================== sdd1: ls -l /etc/grub.d/ (filtered) ======================
-rwxr-xr-x 1 root root 18133 Apr 4 2024 10_linux.dpkg-dist
-rwxr-xr-x 1 root root 2816 Apr 30 2024 10_linux_proxy
-rwxr-xr-x 1 root root 43202 Apr 4 2024 10_linux_zfs.dpkg-dist
-rwxr-xr-x 1 root root 14513 Apr 4 2024 20_linux_xen.dpkg-dist
-rwxr-xr-x 1 root root 786 Apr 4 2024 25_bli
-rwxr-xr-x 1 root root 13120 Apr 4 2024 30_os-prober.dpkg-dist
-rwxr-xr-x 1 root root 3292 Apr 30 2024 30_os-prober_proxy
-rwxr-xr-x 1 root root 1174 Apr 4 2024 30_uefi-firmware.dpkg-dist
-rwxr-xr-x 1 root root 2816 Apr 30 2024 31_linux_proxy
-rwxr-xr-x 1 root root 43031 Apr 15 2022 33_linux_zfs
-rwxr-xr-x 1 root root 14387 Dec 18 2022 34_linux_xen
-rwxr-xr-x 1 root root 722 Aug 21 20:39 35_fwupd.dpkg-dist
-rwxr-xr-x 1 root root 266 Apr 30 2024 35_memtest86+_proxy
-rwxr-xr-x 1 root root 3292 Apr 30 2024 36_os-prober_proxy
-rwxr-xr-x 1 root root 266 Apr 30 2024 37_memtest86+_proxy
-rwxr-xr-x 1 root root 3292 Apr 30 2024 38_os-prober_proxy
-rwxr-xr-x 1 root root 1372 Apr 15 2022 39_uefi-firmware
-rwxr-xr-x 1 root root 700 Feb 19 2022 40_fwupd
-rwxr-xr-x 1 root root 214 Apr 15 2022 42_custom
-rwxr-xr-x 1 root root 215 Apr 15 2022 43_custom
drwxr-xr-x 4 root root 4096 Apr 25 2024 backup
drwxr-xr-x 2 root root 4096 Apr 25 2024 bin
drwxr-xr-x 2 root root 4096 Apr 30 2024 proxifiedScripts
================== sdd1/etc/grub.d/31_linux_proxy (filtered) ===================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
sh -c 'echo "### BEGIN /etc/grub.d/proxifiedScripts/linux ###";
"/etc/grub.d/proxifiedScripts/linux";
echo "### END /etc/grub.d/proxifiedScripts/linux ###";
echo "### BEGIN /etc/grub.d/proxifiedScripts/os-prober ###";
"/etc/grub.d/proxifiedScripts/os-prober";
echo "### END /etc/grub.d/proxifiedScripts/os-prober ###";' | /etc/grub.d/bin/grubcfg_proxy "-'Ubuntu'~594b44c877e7ae2f3136c2afd2f88d9e~
-'SUBMENU' as 'Advanced options for Ubuntu'{-'Advanced options for Ubuntu'/*, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 6.5.0-28-generic'~e6df5b2d691e0b99049a38779346fe8e~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 6.5.0-28-generic (recovery mode)'~eda90ef26b8bf23abf09f49999c1854b~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 6.5.0-27-generic'~936558f27a159407ecccd43d3e1524f7~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 6.5.0-27-generic (recovery mode)'~bc8d5b75107d79e9b7418eda387cfff8~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 6.2.0-37-generic'~1cd11fa92eee80a22017219f8ff48cc2~, -'Advanced options for Ubuntu'/'Ubuntu, with Linux 6.2.0-37-generic (recovery mode)'~cd109d7bab0cc7f91fdf37d673f7a41e~}
+'SUBMENU' as 'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'{+'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/* from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu (on /dev/sdc1)'~340e27466bcb1b1369252f66251892e2~ from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-28-generic (on /dev/sdc1)'~340e27466bcb1b1369252f66251892e2~ from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-28-generic (recovery mode) (on /dev/sdc1)'~a1ea0f4466334a3dfe953fde77992553~ from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-27-generic (on /dev/sdc1)'~46d978fe69bbf92def75cb0ad9ca1143~ from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-27-generic (recovery mode) (on /dev/sdc1)'~c00aff7799c2c51f33e3a02c4e882447~ from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.2.0-37-generic (on /dev/sdc1)'~3e55314569633c29c9ca523fba9ade92~ from '/etc/grub.d/proxifiedScripts/os-prober', +'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.2.0-37-generic (recovery mode) (on /dev/sdc1)'~c40d403e185d0ceec1bdfe2102f860bc~ from '/etc/grub.d/proxifiedScripts/os-prober'}
-*
-#text
" multi
=================== sdd1/etc/grub.d/33_linux_zfs (filtered) ====================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2019 Canonical Ltd.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
datarootdir="/usr/share"
ubuntu_recovery="1"
quiet_boot="1"
quick_boot="1"
gfxpayload_dynamic="1"
vt_handoff="1"
. "${pkgdatadir}/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
set -u
## Skip early if zfs utils isn't installed (instead of failing on first zpool list)
if ! `which zfs >/dev/null 2>&1`; then
exit 0
fi
imported_pools=""
MNTDIR="$(mktemp -d ${TMPDIR:-/tmp}/zfsmnt.XXXXXX)"
ZFSTMP="$(mktemp -d ${TMPDIR:-/tmp}/zfstmp.XXXXXX)"
machine="$(uname -m)"
case "${machine}" in
i?86) GENKERNEL_ARCH="x86" ;;
mips|mips64) GENKERNEL_ARCH="mips" ;;
mipsel|mips64el) GENKERNEL_ARCH="mipsel" ;;
arm*) GENKERNEL_ARCH="arm" ;;
*) GENKERNEL_ARCH="${machine}" ;;
esac
RC=0
on_exit() {
# Restore initial zpool import state
for pool in ${imported_pools}; do
zpool export "${pool}"
done
mountpoint -q "${MNTDIR}" && umount "${MNTDIR}" || true
rmdir "${MNTDIR}"
rm -rf "${ZFSTMP}"
exit "${RC}"
}
trap on_exit EXIT INT QUIT ABRT PIPE TERM
# List ONLINE and DEGRADED pools
import_pools() {
# We have to ignore zpool import output, as potentially multiple / will be available,
# and we need to autodetect all zpools this way with their real mountpoints.
local initial_pools="$(zpool list | awk '{if (NR>1) print $1}')"
local all_pools=""
local imported_pools=""
local err=""
set +e
err="$(zpool import -f -a -o cachefile=none -o readonly=on -N 2>&1)"
# Only print stderr if the command returned an error
# (it can echo "No zpool to import" with success, which we don't want)
if [ $? -ne 0 ]; then
echo "Some pools couldn't be imported and will be ignored:\n${err}" >&2
fi
set -e
all_pools="$(zpool list | awk '{if (NR>1) print $1}')"
for pool in ${all_pools}; do
if echo "${initial_pools}" | grep -wq "${pool}"; then
continue
fi
imported_pools="${imported_pools} ${pool}"
done
echo "${imported_pools}"
}
# List all the dataset with a root mountpoint
get_root_datasets() {
local pools="$(zpool list | awk '{if (NR>1) print $1}')"
for p in ${pools}; do
local rel_pool_root=$(zpool get -H altroot ${p} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root="/"
fi
zfs list -H -o name,canmount,mountpoint -t filesystem | grep -E '^'"${p}"'(\s|/[[:print:]]*\s)(on|noauto)\s'"${rel_pool_root}"'$' | awk '{print $1}'
done
}
# find if given datasets can be mounted for directory and return its path (snapshot or real path)
# $1 is our current dataset name
# $2 directory path we look for (cannot contains /)
# $3 is the temporary mount directory to use
# $4 is the optional snapshot name
# return path for directory (which can be a mountpoint)
validate_system_dataset() {
local dataset="$1"
local directory="$2"
local mntdir="$3"
local snapshot_name="$4"
local mount_path="${mntdir}/${directory}"
if ! zfs list "${dataset}" >/dev/null 2>&1; then
return
fi
if ! mount -o noatime,zfsutil -t zfs "${dataset}" "${mount_path}"; then
grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset}@${snapshot_name}'. Ignoring"
return
fi
local candidate_path="${mount_path}"
if [ -n "${snapshot_name}" ]; then
# WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
# Reading the content of a snapshot fails if it is not the first mount
# for a given dataset
first_mntdir=$(awk '{if ($1 == "'${dataset}'") {print $2; exit;}}' /proc/mounts)
if [ "${first_mntdir}" = "/" ]; then
# prevents // on candidate_path
first_mntdir=""
fi
candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}"
fi
if [ -n "$(ls "${candidate_path}" 2>/dev/null)" ]; then
echo "${candidate_path}"
return
else
mountpoint -q "${mount_path}" && umount "${mount_path}" || true
fi
}
# Detect system directory relevant to the other, trying to find the ones associated on the current dataset or snapshot/
# System directory should be at most a direct child dataset of main datasets (no recursivity)
# We can fallback trying other zfs pools if no match has been found.
# $1 is our current dataset name (which can have @snapshot name)
# $2 directory path we look for (cannot contains /)
# $3 restrict_to_same_pool (true|false) force looking for dataset with the same basename in the current dataset pool only
# $4 is the temporary mount directory to use
# $5 is the optional etc directory (if not $2 is not etc itself)
# return path for directory (which can be a mountpoint)
get_system_directory() {
local dataset_path="$1"
local directory="$2"
local restrict_to_same_pool="$3"
local mntdir="$4"
local etc_dir="$5"
if [ -z "${etc_dir}" ]; then
etc_dir="${mntdir}/etc"
fi
local candidate_path="${mntdir}/${directory}"
# 1. Look for /etc/fstab first (which will mount even on top of non empty $directory)
local mounted_fstab_entry="false"
if [ -f "${etc_dir}/fstab" ]; then
mount_args=$(awk '/^[^#].*[ \t]\/'"${directory}"'[ \t]/ {print "-t", $3, $1}' "${etc_dir}/fstab")
if [ -n "${mount_args}" ]; then
mounted_fstab_entry="true"
mount -o noatime ${mount_args} "${candidate_path}" || mounted_fstab_entry="false"
fi
fi
# If directory isn't empty. Only count if coming from /etc/fstab. Will be
# handled below otherwise as we are interested in potential snapshots.
if [ "${mounted_fstab_entry}" = "true" -a -n "$(ls ${candidate_path} 2>/dev/null)" ]; then
echo "${candidate_path}"
return
fi
# 2. Handle zfs case, which can be a snapshots.
local base_dataset_path="${dataset_path}"
local snapshot_name=""
# For snapshots we extract the parent dataset
if echo "${dataset_path}" | grep -q '@'; then
base_dataset_path=$(echo "${dataset_path}" | cut -d '@' -f1)
snapshot_name=$(echo "${dataset_path}" | cut -d '@' -f2)
fi
base_dataset_name="${base_dataset_path##*/}"
base_pool="$(echo "${base_dataset_path}" | cut -d'/' -f1)"
# 2.a) Look for child dataset included in base dataset, which needs to hold same snapshot if any
candidate_path=$(validate_system_dataset "${base_dataset_path}/${directory}" "${directory}" "${mntdir}" "${snapshot_name}")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
# 2.b) Look for current dataset (which is already mounted as /)
candidate_path="${mntdir}/${directory}"
if [ -n "${snapshot_name}" ]; then
# WORKAROUND a bug https://github.com/zfsonlinux/zfs/issues/9958
# Reading the content of a snapshot fails if it is not the first mount
# for a given dataset
first_mntdir=$(awk '{if ($1 == "'${base_dataset_path}'") {print $2; exit;}}' /proc/mounts)
if [ "${first_mntdir}" = "/" ]; then
# prevents // on candidate_path
first_mntdir=""
fi
candidate_path="${first_mntdir}/.zfs/snapshot/${snapshot_name}/${directory}"
fi
if [ -n "$(ls "${candidate_path}" 2>/dev/null)" ]; then
echo "${candidate_path}"
return
fi
# 2.c) Look for every datasets in every pool which isn't the current dataset which holds:
# - the same dataset name (last section) than our base_dataset_name
# - mountpoint=directory
# - canmount!=off
all_same_base_dataset_name="$(zfs list -H -t filesystem -o name,canmount | awk '/^[^ ]+\/'"${base_dataset_name}"'[ \t](on|noauto)/ {print $1}') "
# order by local pool datasets first
current_pool_same_base_datasets=""
other_pools_same_base_datasets=""
root_pool=$(echo "${dataset_path%%/*}")
for d in ${all_same_base_dataset_name}; do
cur_dataset_pool=$(echo "${d%%/*}")
if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
current_pool_same_base_datasets="${current_pool_same_base_datasets} ${d}"
else
other_pools_same_base_datasets="${other_pools_same_base_datasets} ${d}"
fi
done
ordered_same_base_datasets="${current_pool_same_base_datasets} ${other_pools_same_base_datasets}"
if [ "${restrict_to_same_pool}" = "true" ]; then
ordered_same_base_datasets="${current_pool_same_base_datasets}"
fi
# now, loop over them
for d in ${ordered_same_base_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
# check mountpoint match
candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
if [ -z "${candidate_dataset}" ]; then
continue
fi
candidate_path=$(validate_system_dataset "${candidate_dataset}" "${directory}" "${mntdir}" "${snapshot_name}")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
done
# 2.d) If we didn't find anything yet: check for persistent datasets corresponding to our mountpoint, with canmount=on without any snapshot associated:
# Note: we go over previous datasets as well, but this is ok, as we didn't include them before.
all_mountable_datasets="$(zfs list -t filesystem -o name,canmount | awk '/^[^ ]+[ \t]+on/ {print $1}')"
# order by local pool datasets first
current_pool_datasets=""
other_pools_datasets=""
root_pool=$(echo "${dataset_path%%/*}")
for d in ${all_mountable_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
if echo "${cur_dataset_pool}" | grep -wq "${root_pool}" 2>/dev/null ; then
current_pool_datasets="${current_pool_datasets} ${d}"
else
other_pools_datasets="${other_pools_datasets} ${d}"
fi
done
ordered_datasets="${current_pool_datasets} ${other_pools_datasets}"
if [ "${restrict_to_same_pool}" = "true" ]; then
ordered_datasets="${current_pool_datasets}"
fi
for d in ${ordered_datasets}; do
cur_dataset_pool=$(echo "${d%%/*}")
rel_pool_root=$(zpool get -H altroot ${cur_dataset_pool} | awk '{print $3}')
if [ "${rel_pool_root}" = "-" ]; then
rel_pool_root=""
fi
# check mountpoint match
candidate_dataset=$(zfs get -H mountpoint ${d} | grep -E "mountpoint\s${rel_pool_root}/${directory}\s" | awk '{print $1}')
if [ -z "${candidate_dataset}" ]; then
continue
fi
candidate_path=$(validate_system_dataset "${d}" "${directory}" "${mntdir}" "")
if [ -n "${candidate_path}" ]; then
echo "${candidate_path}"
return
fi
done
grub_warn "Failed to find a valid directory '${directory}' for dataset '${dataset_path}'. Ignoring"
return
}
# Try our default layout bpool as a prefered layout (fast path)
# This is get_system_directory for boot optimized for our default installation layout
# $1 is our current dataset name (which can have @snapshot name)
# $2 is the temporary mount directory to use
# return path for directory (which can be a mountpoint) if found
try_default_layout_bpool() {
local root_dataset_path="$1"
local mntdir="$2"
dataset_basename="${root_dataset_path##*/}"
candidate_dataset="bpool/BOOT/${dataset_basename}"
dataset_properties="$(zfs get -H mountpoint,canmount "${candidate_dataset}" 2>/dev/null | 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=""
candidate_kernel_list="$(find "${boot_dir}" -maxdepth 1 -type f -regex '.*/\(vmlinuz\|vmlinux\|kernel\)-.*')"
while [ -n "${candidate_kernel_list}" ] ; do
list_basename="$(echo "${candidate_kernel_list}" | sed -e 's#.*/##')"
linux=$(version_find_latest ${list_basename})
linux=$(echo "${candidate_kernel_list}" | while read k; do
if [ "$(basename "${k}")" = "${linux}" ]; then
echo -n "${k}"
break
fi
done)
# || true to not abort even if candidate_kernel_list is empty on last entry
candidate_kernel_list="$(echo "${candidate_kernel_list}" | fgrep -vx "${linux}"||true)"
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 -v FS='\t' '{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
snapshots="$(zfs list -H -o name -t snapshot "${dataset}"|while read snapshot_dataset; do
get_dataset_info "${snapshot_dataset}" ${mntdir}
done)"
[ -n "${snapshots}" ] && boot_list="${boot_list}${snapshots}\n"
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
oldIFS="$IFS"
export IFS='|'
set -- $(get_field_from_entry "${main_entry}" 7)
for kernel in $(get_field_from_entry "${main_entry}" 8); 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
IFS="$oldIFS"
}
# 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
oldIFS="$IFS"
export IFS='|'
set -- $(get_field_from_entry "${entry}" 7)
for k in $(get_field_from_entry "${entry}" 8); 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
IFS="$oldIFS"
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 in echo trims end of line spaces
echo "${submenu_indentation} linux \"${kernel}\" root=ZFS=\"${dataset}\" ro $(echo ${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
=================== sdd1/etc/grub.d/34_linux_xen (filtered) ====================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
. "$pkgdatadir/grub-mkconfig_lib"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
CLASS="--class gnu-linux --class gnu --class os --class xen"
SUPPORTED_INITS="sysvinit:/lib/sysvinit/init systemd:/lib/systemd/systemd upstart:/sbin/upstart"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
# the initrds that Linux uses don't like that.
case ${GRUB_DEVICE} in
/dev/loop/*|/dev/loop[0-9])
GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
# We can't cope with devices loop-mounted from files here.
case ${GRUB_DEVICE} in
/dev/*) ;;
*) exit 0 ;;
esac
;;
esac
# Default to disabling partition uuid support to maintian compatibility with
# older kernels.
GRUB_DISABLE_LINUX_PARTUUID=${GRUB_DISABLE_LINUX_PARTUUID-true}
# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter
# and mounting btrfs requires user space scanning, so force UUID in this case.
if ( [ "x${GRUB_DEVICE_UUID}" = "x" ] && [ "x${GRUB_DEVICE_PARTUUID}" = "x" ] ) \
|| ( [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
&& [ "x${GRUB_DISABLE_LINUX_PARTUUID}" = "xtrue" ] ) \
|| ( ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
&& ! test -e "/dev/disk/by-partuuid/${GRUB_DEVICE_PARTUUID}" ) \
|| ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
elif [ "x${GRUB_DEVICE_UUID}" = "x" ] \
|| [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ]; then
LINUX_ROOT_DEVICE=PARTUUID=${GRUB_DEVICE_PARTUUID}
else
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
# Allow overriding GRUB_CMDLINE_LINUX and GRUB_CMDLINE_LINUX_DEFAULT.
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE}" ]; then
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX_XEN_REPLACE}"
fi
if [ "${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}" ]; then
GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT}"
fi
case x"$GRUB_FS" in
xbtrfs)
rootsubvol="`make_system_path_relative_to_its_root /`"
rootsubvol="${rootsubvol#/}"
if [ "x${rootsubvol}" != x ]; then
GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
fi;;
xzfs)
rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
;;
esac
title_correction_code=
linux_entry ()
{
linux_entry_xsm "$@" false
linux_entry_xsm "$@" true
}
linux_entry_xsm ()
{
os="$1"
version="$2"
xen_version="$3"
type="$4"
args="$5"
xen_args="$6"
xsm="$7"
# If user wants to enable XSM support, make sure there's
# corresponding policy file.
if ${xsm} ; then
xenpolicy="xenpolicy-$xen_version"
if test ! -e "${xen_dirname}/${xenpolicy}" ; then
return
fi
xen_args="$xen_args flask=enforcing"
xen_version="$(gettext_printf "%s (XSM enabled)" "$xen_version")"
# xen_version is used for messages only; actual file is xen_basename
fi
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="${rel_dirname}/${i}"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
${module_loader} --nounzip $(echo $initrd_path)
EOF
done
fi
if ${xsm} && test -n "${xenpolicy}" ; then
message="$(gettext_printf "Loading XSM policy ...")"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
${module_loader} ${rel_dirname}/${xenpolicy}
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
if [ "x${linux_list}" = "x" ] ; then
exit 0
fi
file_is_not_xen_garbage () {
case "$1" in
*/xen-syms-*)
return 1;;
*/xenpolicy-*)
return 1;;
*/*.config)
return 1;;
*)
return 0;;
esac
}
xen_list=
for i in /boot/xen*; do
if grub_file_is_not_garbage "$i" && file_is_not_xen_garbage "$i" ; then xen_list="$xen_list $i" ; fi
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
# Xen assumes the real initrd is the first module after the kernel.
# Additional (later) initrds can also be used for microcode update,
# with Xen option 'ucode=<scan|module number> (non-default anyway).
initrd="${initrd_real} ${initrd_early}"
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
# The GRUB_DISABLE_SUBMENU option used to be different than others since it was
# mentioned in the documentation that has to be set to 'y' instead of 'true' to
# enable it. This caused a lot of confusion to users that set the option to 'y',
# 'yes' or 'true'. This was fixed but all of these values must be supported now.
if [ "x${GRUB_DISABLE_SUBMENU}" = xyes ] || [ "x${GRUB_DISABLE_SUBMENU}" = xy ]; then
GRUB_DISABLE_SUBMENU="true"
fi
if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xtrue ]; 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' ' '`
# 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"
================ sdd1/etc/grub.d/36_os-prober_proxy (filtered) =================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "-'Mac OS X (32-bit) (on /dev/sda2)'~d4dfb3060a8b1e30f91747c20a5d7a84~
-'Mac OS X (64-bit) (on /dev/sda2)'~a5e6059c9cc82aac3e6c2525acb432df~
-'Mac OS X (32-bit) (on /dev/sda3)'~d04c19fb6a34629ee03518e517e173cb~
-'Mac OS X (64-bit) (on /dev/sda3)'~c14c51b21628aac3f17fad4fd1e47c31~
-'Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'~84387a7260505478a30e8c4c85537e17~
-'SUBMENU' as 'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'{-'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/*, -'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu (on /dev/sdd3)'~89a06d6d83d84b76fd5c61999cdbe747~, -'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-46-generic (on /dev/sdd3)'~89a06d6d83d84b76fd5c61999cdbe747~, -'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-46-generic (recovery mode) (on /dev/sdd3)'~d9db882056249960e34c6e1d3bd8e972~, -'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-43-generic (on /dev/sdd3)'~32204d9a610f896144424d1597bacb00~, -'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-43-generic (recovery mode) (on /dev/sdd3)'~6a8869f148ebabc236ab1bb9e30701b0~}
-'Mac OS X (32-bit) (on /dev/sdf2)'~88183efd8506d2707e4c60487a978a01~
-'Mac OS X (64-bit) (on /dev/sdf2)'~c4f40cbdf65e6839076587008a458707~
-'Mac OS X (32-bit) (on /dev/sdf3)'~aed6acee2d33f2143408ea737ad2bbbd~
-'Mac OS X (64-bit) (on /dev/sdf3)'~709dc5950d95b7f1315bd9687dd84464~
-'Mac OS X (32-bit) (on /dev/sdf4)'~87bd194731f40b93594d6e67a688ca18~
-'Mac OS X (64-bit) (on /dev/sdf4)'~e83689ec0958e1f9fafb65bf4a8533a5~
-'Mac OS X (32-bit) (on /dev/sdf5)'~c481a11ff88565893a5e477ad4c26275~
-'Mac OS X (64-bit) (on /dev/sdf5)'~a5ff9b56ad5f69741d8d5fd2cb69417a~
-'Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'~99ecaf685475b26f0a6cbcf2d8b02ef1~
-'SUBMENU' as 'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'{-'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/*, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu (on /dev/sdc1)'~340e27466bcb1b1369252f66251892e2~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-28-generic (on /dev/sdc1)'~340e27466bcb1b1369252f66251892e2~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-28-generic (recovery mode) (on /dev/sdc1)'~a1ea0f4466334a3dfe953fde77992553~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-27-generic (on /dev/sdc1)'~46d978fe69bbf92def75cb0ad9ca1143~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-27-generic (recovery mode) (on /dev/sdc1)'~c00aff7799c2c51f33e3a02c4e882447~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.2.0-37-generic (on /dev/sdc1)'~3e55314569633c29c9ca523fba9ade92~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.2.0-37-generic (recovery mode) (on /dev/sdc1)'~c40d403e185d0ceec1bdfe2102f860bc~}
+*
+#text
"
================ sdd1/etc/grub.d/38_os-prober_proxy (filtered) =================
#!/bin/sh
#THIS IS A GRUB PROXY SCRIPT
'/etc/grub.d/proxifiedScripts/os-prober' | /etc/grub.d/bin/grubcfg_proxy "-*
-#text
-'Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'~99ecaf685475b26f0a6cbcf2d8b02ef1~
-'SUBMENU' as 'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'{-'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/*, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu (on /dev/sdc1)'~340e27466bcb1b1369252f66251892e2~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-28-generic (on /dev/sdc1)'~340e27466bcb1b1369252f66251892e2~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-28-generic (recovery mode) (on /dev/sdc1)'~a1ea0f4466334a3dfe953fde77992553~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-27-generic (on /dev/sdc1)'~46d978fe69bbf92def75cb0ad9ca1143~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.5.0-27-generic (recovery mode) (on /dev/sdc1)'~c00aff7799c2c51f33e3a02c4e882447~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.2.0-37-generic (on /dev/sdc1)'~3e55314569633c29c9ca523fba9ade92~, -'Advanced options for Ubuntu 22.04.4 LTS (22.04) (on /dev/sdc1)'/'Ubuntu, with Linux 6.2.0-37-generic (recovery mode) (on /dev/sdc1)'~c40d403e185d0ceec1bdfe2102f860bc~}
+'Mac OS X (32-bit) (on /dev/sda2)'~d4dfb3060a8b1e30f91747c20a5d7a84~
+'Mac OS X (64-bit) (on /dev/sda2)'~a5e6059c9cc82aac3e6c2525acb432df~
+'Mac OS X (32-bit) (on /dev/sda3)'~d04c19fb6a34629ee03518e517e173cb~
+'Mac OS X (64-bit) (on /dev/sda3)'~c14c51b21628aac3f17fad4fd1e47c31~
+'Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'~84387a7260505478a30e8c4c85537e17~
+'SUBMENU' as 'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'{+'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/*, +'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu (on /dev/sdd3)'~89a06d6d83d84b76fd5c61999cdbe747~, +'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-46-generic (on /dev/sdd3)'~89a06d6d83d84b76fd5c61999cdbe747~, +'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-46-generic (recovery mode) (on /dev/sdd3)'~d9db882056249960e34c6e1d3bd8e972~, +'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-43-generic (on /dev/sdd3)'~32204d9a610f896144424d1597bacb00~, +'Advanced options for Ubuntu 20.04.5 LTS (20.04) (on /dev/sdd3)'/'Ubuntu, avec Linux 5.15.0-43-generic (recovery mode) (on /dev/sdd3)'~6a8869f148ebabc236ab1bb9e30701b0~}
+'Mac OS X (32-bit) (on /dev/sdf2)'~88183efd8506d2707e4c60487a978a01~
+'Mac OS X (64-bit) (on /dev/sdf2)'~c4f40cbdf65e6839076587008a458707~
+'Mac OS X (32-bit) (on /dev/sdf3)'~aed6acee2d33f2143408ea737ad2bbbd~
+'Mac OS X (64-bit) (on /dev/sdf3)'~709dc5950d95b7f1315bd9687dd84464~
+'Mac OS X (32-bit) (on /dev/sdf4)'~87bd194731f40b93594d6e67a688ca18~
+'Mac OS X (64-bit) (on /dev/sdf4)'~e83689ec0958e1f9fafb65bf4a8533a5~
+'Mac OS X (32-bit) (on /dev/sdf5)'~c481a11ff88565893a5e477ad4c26275~
+'Mac OS X (64-bit) (on /dev/sdf5)'~a5ff9b56ad5f69741d8d5fd2cb69417a~
"
================= sdd1/etc/grub.d/39_uefi-firmware (filtered) ==================
#! /bin/sh
set -e
# grub-mkconfig helper script.
# Copyright (C) 2020 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
. "$pkgdatadir/grub-mkconfig_lib"
EFI_VARS_DIR=/sys/firmware/efi/efivars
EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c
OS_INDICATIONS="$EFI_VARS_DIR/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE"
if [ -e "$OS_INDICATIONS" ] && \
[ "$(( $(printf 0x%x \'"$(cat $OS_INDICATIONS | cut -b5)"\') & 1 ))" = 1 ]; then
LABEL="UEFI Firmware Settings"
gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2
cat << EOF
menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
fwsetup
}
EOF
fi
===================== sdd1/etc/grub.d/40_fwupd (filtered) ======================
#! /bin/sh
# SPDX-License-Identifier: LGPL-2.1+
set -e
[ -d ${pkgdatadir:?} ]
# shellcheck source=/dev/null
. "$pkgdatadir/grub-mkconfig_lib"
if [ -f /var/lib/fwupd/uefi_capsule.conf ] &&
ls /sys/firmware/efi/efivars/fwupd-*-0abba7dc-e516-4167-bbf5-4d9d1c739416 1>/dev/null 2>&1; then
. /var/lib/fwupd/uefi_capsule.conf
if [ "${EFI_PATH}" != "" ] && [ "${ESP}" != "" ]; then
echo "Adding Linux Firmware Updater entry" >&2
cat << EOF
menuentry 'Linux Firmware Updater' \$menuentry_id_option 'fwupd' {
EOF
${grub_probe:?}
prepare_grub_to_access_device '`${grub_probe} --target=device \${ESP}` | sed -e "s/^/\t/"'
cat << EOF
chainloader ${EFI_PATH}
}
EOF
fi
fi
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to unsign) and reinstall the grub2 of
sdd1 into the MBR of sdd.
Grub-efi would not be selected by default because no ESP detected.
Additional repair would be performed: unhide-bootmenu-10s
Final advice in case of suggested repair: ______________________________________
Please do not forget to make your BIOS boot on sdd (ATA ST2000DM008-2FR1) disk!
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
#3 Le 14/01/2025, à 23:34
- geole
Re : emergency mode
Bonsoir.
Dans un de tes quatre /etc/fstab, tu as défini une partition de boot EFi qui n'existe plus.
dev/disk/by-uuid/70D6-1701
qui a disparu, il faut rectifier le fstsab en question.
Reste à lire le boot-info
========================= sdd1/etc/fstab (filtered) ===========================
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=9ad91ff3-16e6-4507-8211-5af34dcacc8a / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=70D6-1701 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sdb2 during installation
....
sda1:
__________________________________________________________________________
File system: ext4
sda2: __________________________________________________________________________
File system: ext4
sda3: __________________________________________________________________________
File system: ext4
sdb1: __________________________________________________________________________
Dernière modification par geole (Le 14/01/2025, à 23:57)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#4 Le 15/01/2025, à 14:47
- dom12
Re : emergency mode
Bonjour Geole, et surtout Merci !!!
ça fait sacrement plaisir de voir quelqu’un qui vous entend et qui est compétent.
J'ai commenté la ligne du fstab.
Elle correspondait peut être à un disque dur qui contenait Apple/OSX. En effet c'est un hackintosh, assemblé par moi, avec 8 disques durs. Devant le problème j'ai débranché électriquement 4 disques et même une carte PCIe qui semblait avoir un problème?.
J'apprends, j'apprends : Je suis un jeune de 85 ans autodidacte en informatique !
Ma question maintenant est : était ce cette partition EFI qui causait tout le problème ??? (le journalctl contenait plein plein d'erreurs). Je soupçonnait même le Processeur??? Comment savoir que tout est correct maintenant?
Encore un énorme merci Geole, car j'y suis depuis dimanche à des heures avancées dans la nuit...
Est ce que ce soir je pourrai dormir tranquille?
Dominique
Hors ligne
#5 Le 15/01/2025, à 15:12
- geole
Re : emergency mode
Bonjour
Cet incident provoquait le plantage en emergency. Mais le plantage en emergency peut avoir plein d'autres causes.
On peut toujours regarder si les anomalies de fonctionnement sont graves ou pas.
journalctl --no-pager -b -p err -n 200
Effectivement, un de tes O.S. montre un reste mac.
===================== sdc3/boot/grub/grub.cfg (filtered) ======================
Ubuntu f30c3d3c-6209-4de5-9ea7-6a76a08ec233
Mac OS X (32 bits) (sur sda2) osprober-xnu-32-6070c0b728958aee
Mac OS X (32 bits) (sur sda3) osprober-xnu-32-644df2e5fa8780d2
Ubuntu 20.04.4 LTS (20.04) (sur sdb2) a7d39d05-397a-4223-a6e1-468f0ac4eabc
Mac OS X (32 bits) (sur sdf2) osprober-xnu-32-789cd3f5409a58d9
Mac OS X (32 bits) (sur sdf3) osprober-xnu-32-2337d1e7723978aa
Mac OS X (32 bits) (sur sdf4) osprober-xnu-32-6513b09c79fb6d08
Mac OS X (32 bits) (sur sdf5) osprober-xnu-32-5587e248bddbcdfd
Dernière modification par geole (Le 15/01/2025, à 17:07)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#6 Le 15/01/2025, à 16:46
- dom12
Re : emergency mode
Rebonjour Geole,
Merci de ne pas m'abandonner...
voici ce que j'ai trouvé. (signification?):
root@h63:~# journalctl --no-pager -b -p err -n 200
janv. 15 14:35:12 h63 kernel: x86/cpu: VMX (outside TXT) disabled by BIOS
janv. 15 14:35:24 h63 smartd[2369]: Device: /dev/sda [SAT], no ATA CHECK POWER STATUS support, ignoring -n Directive
janv. 15 14:35:26 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Currently unreadable (pending) sectors
janv. 15 14:35:26 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Offline uncorrectable sectors
janv. 15 14:35:33 h63 canonical-livepatch.canonical-livepatchd[2662]: Task "refresh" returned an error: livepatch check failed: POST request to "https://livepatch.canonical.com/v1/client/22b7820cb9f2464f9067c2a8a80d8707/updates" failed, retrying in 30s.
janv. 15 14:35:40 h63 gdm-autologin][2796]: gkr-pam: couldn't unlock the login keyring.
janv. 15 14:35:42 h63 systemd[2885]: Failed to start app-gnome-gnome\x2dkeyring\x2dpkcs11-3228.scope - Application launched by gnome-session-binary.
janv. 15 14:35:42 h63 systemd[2885]: Failed to start app-gnome-gnome\x2dkeyring\x2dsecrets-3225.scope - Application launched by gnome-session-binary.
janv. 15 14:35:42 h63 systemd[2885]: Failed to start app-gnome-gnome\x2dkeyring\x2dssh-3223.scope - Application launched by gnome-session-binary.
janv. 15 15:05:29 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Currently unreadable (pending) sectors
janv. 15 15:05:29 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Offline uncorrectable sectors
janv. 15 15:35:28 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Currently unreadable (pending) sectors
janv. 15 15:35:28 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Offline uncorrectable sectors
janv. 15 16:05:28 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Currently unreadable (pending) sectors
janv. 15 16:05:28 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Offline uncorrectable sectors
root@h63:~#
Hors ligne
#7 Le 15/01/2025, à 17:12
- geole
Re : emergency mode
Un incident qui peut avoir des conséquences pas évidentes
janv. 15 14:35:26 h63 smartd[2369]: Device: /dev/sdc [SAT], 8 Currently unreadable (pending) sectors
Donc tu installes l'application smartmontools avec cette commande
sudo apt-get install --no-install-recommends smartmontools
et tu postes le retour de cette commande
sudo smartctl -s on -a /dev/sdc
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#8 Le 15/01/2025, à 17:45
- dom12
Re : emergency mode
merci ! voilà
dvmbp@h63:~$ sudo smartctl -s on -a /dev/sdc
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.8.0-51-generic] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.14 (AF)
Device Model: ST2000DM001-1CH164
Serial Number: W1E1Q8DA
LU WWN Device Id: 5 000c50 05ca4aca6
Firmware Version: CC24
User Capacity: 2000398934016 bytes [2,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database 7.3/5528
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Wed Jan 15 17:41:50 2025 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 592) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 220) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x3085) SCT Status supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 117 099 006 Pre-fail Always - 135996288
3 Spin_Up_Time 0x0003 096 095 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 089 089 020 Old_age Always - 11604
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 075 060 030 Pre-fail Always - 8660019705
9 Power_On_Hours 0x0032 054 054 000 Old_age Always - 40452
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 096 096 020 Old_age Always - 4319
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 099 000 Old_age Always - 0 0 1
189 High_Fly_Writes 0x003a 099 099 000 Old_age Always - 1
190 Airflow_Temperature_Cel 0x0022 074 054 045 Old_age Always - 26 (Min/Max 25/26)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 727
193 Load_Cycle_Count 0x0032 094 094 000 Old_age Always - 13215
194 Temperature_Celsius 0x0022 026 046 000 Old_age Always - 26 (0 4 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 8
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 8
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 35583h+25m+12.226s
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 12332838258
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 20668565585
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 40451 -
# 2 Short offline Completed without error 00% 9438 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
The above only provides legacy SMART information - try 'smartctl -x' for more
dvmbp@h63:~$
Hors ligne
#9 Le 15/01/2025, à 18:47
- geole
Re : emergency mode
Sector Sizes: 512 bytes logical, 4096 bytes physical
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 054 054 000 Old_age Always - 40452
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 8
No Errors Logged
Cela ne représente qu'un secteur physique et c'est le premier pour un disque statistiquement au milieu de sa vie. J'aurais aimé qu'il dise lesquels et quand cela est arrivé.
Pour le moment. Je dis "affaire à suivre". Tous les deux ou trois mois, tu feras cette commande pour savoir si cela empire ou pas. Car il possible que cette situation soit très ancienne.
sudo smartctl -a /dev/sdc|grep -E "Serial|Reallocated_Sector|Current_Pending|Power_On|Errors Logged"
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#10 Le 15/01/2025, à 21:08
- dom12
Re : emergency mode
Merci Geole,
Ok je vais surveiller ce disque comme indiqué. Le système qu'y est n'est pas celui que j'utilise couramment.
Par contre, J'ai relancé boot info, et j'ai toujours le message :
Suggested repair: ______________________________________________________________
The default repair of the Boot-Repair utility would purge (in order to unsign) and reinstall the grub2 of
sdd1 into the MBR of sdd.
Grub-efi would not be selected by default because no ESP detected.
Additional repair would be performed: unhide-bootmenu-10s
Cela semble dire que grub2 n'est pas bien installé sur sdd (sur lequel est mob systeme principal que j'utilise en permanence).
Je ne suis pas à l'aise avec les grub, MBR, programme de démarrage, gpt, msdos...
- 1) Si je dois le faire comment je reinstalle le grub2 de sdd1 into the MBR of sdd?.
- 2) et que veut dire : unhide-bootmenu-10s
merci encore, car je suis soulagé que ce ne soit pas le processor (c'est à dire un gros problème de hard) et le disque dur sdc je peux le changer.
dominique
Hors ligne
#11 Le 15/01/2025, à 22:38
- geole
Re : emergency mode
Bonsoir.
Boot-repair a l'habitude de toujours proposer une réparation.
Même si le boot fonctionne bien.
Même si sa proposition est identique au boot actuel.
Il dit qu'il va laisser 10 secondes le menu grub affiché afin de te permettre de faire un choix.
Si au bout de 10 secondes tu n'as pas choisi, il fait un choix.
Cette réparation est forte utile lorsque initialement la valeur est de zéro seconde, cas assez fréquent. mais aucun intérêt pour toi puisque c'est 20 secondes.
======================= sdd1/etc/default/grub (filtered) =======================
....
GRUB_TIMEOUT=20
Dernière modification par geole (Le 15/01/2025, à 22:40)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
Pages : 1