Outils pour utilisateurs

Outils du site


informatique:partition_boot_remplie_sur_debian_grub_rescue

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:partition_boot_remplie_sur_debian_grub_rescue [2026/06/05 09:36] simoninformatique:partition_boot_remplie_sur_debian_grub_rescue [2026/07/05 10:56] (Version actuelle) simon
Ligne 2: Ligne 2:
  
 Ma partition boot s'est remplie. Une mise à jour avec un nouveau noyau n'a pas pu se faire correctement et quand j'essaye de démarrer, je me retrouve dans "grub rescue"... Ma partition boot s'est remplie. Une mise à jour avec un nouveau noyau n'a pas pu se faire correctement et quand j'essaye de démarrer, je me retrouve dans "grub rescue"...
 +
 +{{ :informatique:img_20260605_104408.jpg?400 |}}
 +<code bash>
 +error: file '/grub/i386-pc/bufio.mod' not found.
 +grub rescue>
 +</code>
  
 J'ai booté sur une clé usb que j'avais sous la main (fedora workstation live). J'ai booté sur une clé usb que j'avais sous la main (fedora workstation live).
  
-À partir de là, je peux avoir un terminal complet, un clavier bien configuré (et pas un qwerty..). L'objectif va être de nettoyer la partition grub mais aussi de [[informatique:chroot]] sur mon installation pour pouvoir relancer une mise à jour.+À partir de là, je peux avoir un terminal complet, un clavier bien configuré (et pas un qwerty dans un terminal ultra limité de grub rescue...). L'objectif va être de nettoyer la partition grub mais aussi de [[informatique:chroot]] sur mon installation pour pouvoir relancer une mise à jour et réparer ce qui doit l'être.
  
 <code bash> <code bash>
Ligne 25: Ligne 31:
 mount: /rescue: unknown filesystem type 'crypto_LUKS' mount: /rescue: unknown filesystem type 'crypto_LUKS'
  
-root@localhost-live:/rescue# cryptsetup luksOpen /dev/sda5 data+root@localhost-live:/rescue# cryptsetup luksOpen /dev/sda5 sda5_crypt
 Enter passphrase for /dev/sda5:  Enter passphrase for /dev/sda5: 
  
Ligne 71: Ligne 77:
 root@localhost-live:/boot# rm vmlinuz-6.12.74+deb13+1-amd64 root@localhost-live:/boot# rm vmlinuz-6.12.74+deb13+1-amd64
    
-root@localhost-live:/boot# df -h /boot/+root@localhost-live:/boot# df -h /rescue/boot/
 Filesystem      Size  Used Avail Use% Mounted on Filesystem      Size  Used Avail Use% Mounted on
 /dev/sda1       455M  268M  163M  63% /boot /dev/sda1       455M  268M  163M  63% /boot
Ligne 84: Ligne 90:
  
 {{ :informatique:screenshot_from_2026-06-05_09-07-27.png?400 |}} {{ :informatique:screenshot_from_2026-06-05_09-07-27.png?400 |}}
 +
 +Les commandes à copier/coller :
 +<code bash>
 +sudo -i
 +mkdir /rescue
 +cryptsetup luksOpen /dev/sda5 sda5_crypt
 +mount -t ext4 -o noatime /dev/mapper/betula--vg-root /rescue
 +mount /dev/sda1 /rescue/boot/; mount -t proc proc /rescue/proc/; mount -t sysfs sys /rescue/sys/; mount -o bind /dev/ /rescue/dev/; mount -t devpts pts /rescue/dev/pts/
 +chroot /rescue/
 +</code>
  
 Maintenant on peut réparer ! Maintenant on peut réparer !
Ligne 110: Ligne 126:
    - in /boot:  146 MB / 171 MB available    - in /boot:  146 MB / 171 MB available
  
-root@localhost-live:/boot# sudo apt autoremove+root@localhost-live:/boot# apt autoremove
 (...) (...)
 Summary: Summary:
Ligne 146: Ligne 162:
  
 <code bash> <code bash>
-# update-initramfs -u+# export LANG=fr_BE.utf8  
 +# export LC_ALL=fr_BE.utf8 
 +# export LANGUAGE=fr_BE.utf8 
 +# update-initramfs -u -k all
 </code> </code>
  
-Problème résolu!+<del>Problème résolu!</del> 
 + 
 +Je croyais que le problème était résolu parce que j'ai pu démarrer l'ordinateur mais le problème revient à intervalles réguliers. Je tente donc d'ajouter la solution de [[https://tuxicoman.jesuislibre.net/2026/05/reduire-la-taille-des-fichiers-initrd-dans-boot.html|Tuxicoman pour réduire la taille des fichiers initrd dans boot]]. Je cite : 
 + 
 +<WRAP center round box 60%> 
 +Créez un fichier /etc/initramfs-tools/conf.d/smallboot et écrivez dedans: 
 +<code> 
 +MODULES=dep 
 +COMPRESS=xz 
 +</code> 
 + 
 +La première option réduit le nombre de modules embarqués dans le initrd 
 + 
 +La deuxième compresse plus fort au dépend de la vitesse de boot 
 + 
 +Puis relancez la création de l’image du noyau avec cette commande : 
 +<code bash> 
 +# export LANG=fr_BE.utf8  
 +# export LC_ALL=fr_BE.utf8 
 +# export LANGUAGE=fr_BE.utf8 
 +# update-initramfs -u -k all 
 +</code> 
 +</WRAP> 
 + 
 +Espérons que ça règle un peu le problème. Sinon je vais finir par faire une réinstallation complète et mettre une partition /boot de 2Go.:-\ 
 + 
 +<del>Problème résolu ?</del> 
 + 
 +J'ai également rencontré un autre problème :  
 +<code bash> 
 +root@localhost-live:/# grub-install --target=i386-pc /dev/sda 
 +Installing for i386-pc platform. 
 +grub-install: error: cannot backup `/boot/grub/i386-pc/ehci.mod': Structure needs cleaning. 
 +</code> 
 + 
 +Si je comprends bien, il y a des erreurs dans les partitions et ça vaut la peine de nettoyer ça (voir [[https://askubuntu.com/questions/910078/structure-needs-cleaning-error-cannot-mount-partition|askubuntu.com]]) : 
 + 
 +<code bash> 
 +root@localhost-live:/#  
 +exit 
 +root@localhost-live:~# umount /rescue/boot  
 +root@localhost-live:~# e2fsck /dev/sda1 
 +e2fsck 1.47.3 (8-Jul-2025) 
 +/dev/sda1 contains a file system with errors, check forced. 
 +Pass 1: Checking inodes, blocks, and sizes 
 +Inode 108123, i_size is 16384, should be 12288.  Fix<y>? yes 
 +Inode 108123, i_blocks is 34, should be 26.  Fix<y>? yes 
 +Inode 108363, i_blocks is 36, should be 26.  Fix<y>? yes 
 +Inode 108675, i_blocks is 32, should be 26.  Fix<y>? yes 
 +Inode 108125, i_blocks is 116, should be 26.  Fix<y>? yes 
 +Inode 108126, i_blocks is 60, should be 26.  Fix<y>? yes 
 +Inode 108127, i_blocks is 58, should be 26.  Fix<y>? yes 
 +Inode 108161, i_blocks is 236, should be 26.  Fix<y>? yes 
 +Inode 108162, i_blocks is 292, should be 26.  Fix<y>? yes 
 +Inode 108163, i_blocks is 346, should be 26.  Fix ('a' enables 'yes' to all) <y>? yes to all 
 +Inode 108630, i_blocks is 120, should be 26.  Fix? yes 
 + 
 +(...plein de trucs...) 
 + 
 +Free blocks count wrong for group #60 (2348, counted=2359). 
 +Fix? yes 
 + 
 +Free blocks count wrong (166249, counted=167613). 
 +Fix? yes 
 + 
 + 
 +/dev/sda1: ***** FILE SYSTEM WAS MODIFIED ***** 
 +/dev/sda1: 523/124440 files (22.2% non-contiguous), 331075/498688 blocks 
 +</code> 
 + 
 +Après ça, on remonte la partition, on chroot à nouveau et on réinstalle grub : 
 + 
 +<code bash> 
 +root@localhost-live:~# mount /dev/sda1 /rescue/boot/ 
 + 
 +root@localhost-live:~# chroot /rescue/ 
 + 
 +root@localhost-live:/# grub-install --target=i386-pc /dev/sda 
 +Installing for i386-pc platform. 
 +Installation finished. No error reported. 
 + 
 +root@localhost-live:/# update-grub 
 +Generating grub configuration file ... 
 +Found background image: .background_cache.png 
 +Found linux image: /boot/vmlinuz-6.12.94+deb13-amd64 
 +Found initrd image: /boot/initrd.img-6.12.94+deb13-amd64 
 +Found linux image: /boot/vmlinuz-6.12.90+deb13.1-amd64 
 +Found initrd image: /boot/initrd.img-6.12.90+deb13.1-amd64 
 +Found linux image: /boot/vmlinuz-6.12.90+deb13-amd64 
 +Found initrd image: /boot/initrd.img-6.12.90+deb13-amd64 
 +Warning: os-prober will not be executed to detect other bootable partitions. 
 +Systems on them will not be added to the GRUB boot configuration. 
 +Check GRUB_DISABLE_OS_PROBER documentation entry. 
 +Adding boot menu entry for UEFI Firmware Settings ... 
 +done 
 +</code> 
 + 
 +Ça semble mieux! Est-ce que c'était ça qui causait le problème initial ?8-o 
 + 
 +Problème résolu ? 
 + 
 +===== Sources qui m'ont aide ===== 
 + 
 +  * [[https://askubuntu.com/questions/1268943/after-upgrade-to-20-04-luks-doesnt-open-my-disk-on-boot-cryptroot-crypttab-is|askubuntu.com - After upgrade to 20.04: luks doesn't open my disk on boot; cryptroot/crypttab is empty, cryptsetup doesn't recognize the crypttab entry]]
informatique/partition_boot_remplie_sur_debian_grub_rescue.1780652193.txt.gz · Dernière modification : de simon