# Bash: update-grub: command not found en live-cd !

**URL:** <https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803>\
**Category:** Trucs et Astuces\
**Created:** [Février 21, 2016, 3:18 UTC](https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803 "2016-02-21T03:18:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loreleil](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/l/77aa72/32.png) [@loreleil](https://www.debian-fr.org/u/loreleil)\
**Post date:** [Février 21, 2016, 3:18 UTC](https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803/1 "2016-02-21T03:18:16Z")

</div>

Salut,

Suite à une mésaventure sur mon os maître, j’avais planté Grub !

Et sa ré-installation m’avais posé le problème suivant en chroot: bash: update-grub: command not found

Si, ce problème se pose à vous, il y a de forte chance, que vous ayez lors de l’installation de vôtre Debian d’amour opter pour /home, /tmp, /usr, et /var séparées !

Voici ce qui en était …

[code]debian:~# mkdir /mnt/chroot  
debian:~# mount /dev/sda5 /mnt/chroot  
debian:~# mount --bind /proc /mnt/chroot/proc  
debian:~# mount --bind /dev /mnt/chroot/dev  
debian:~# mount --bind /sys /mnt/chroot/sys

debian:~# chroot /mnt/chroot  
root@debian:/#

root@debian:/# update-grub  
bash: update-grub: command not found  
root@debian:/#

root@debian:/# aptitude update  
bash: aptitude: command not found  
root@debian:/#

root@debian:/# apt-cache policy aptitude  
bash: apt-cache: command not found  
root@debian:/#[/code]

Ceci pour toute commande la réponse était : command not found

Voici, comment solutionné ceci, pour ce faire le chroot doit être établit, comme ci-dessus (par exemple).

Il suffisait de monter /usr !!! ![:033](https://www.debian-fr.org/uploads/default/original/1X/42cd8bd0447ecac24cdff1e26fa990a5c8442791.gif "petard")

[code]root@debian:/# df -h  
Filesystem Size Used Avail Use% Mounted on

/dev/sda6 12G 4.9G 6.4G 44% /usr

root@debian:/#[/code]

```auto
root@debian:/# mount /dev/sda6
```

[code]root@debian:/# update-grub  
Generating grub.cfg …  
Found background image: /usr/share/images/desktop-base/desktop-grub.png  
Found linux image: /boot/vmlinuz-2.6.32-5-amd64  
Found initrd image: /boot/initrd.img-2.6.32-5-amd64  
Found memtest86+ image: /boot/memtest86+.bin  
Found memtest86+ multiboot image: /boot/memtest86+\_multiboot.bin  
No volume groups found  
done  
root@debian:/#

root@debian:/# grub-install /dev/sda  
Installation finished. No error reported.  
root@debian:/#[/code]

Vérification (et croisez les doigts pour le re-démarrage)

`root@debian:/# dd if=/dev/sda bs=512 count=1 | strings
1+0 records in
1+0 records out
512 bytes (512 B) copied, 3.4276e-05 s, 14.9 MB/s
ZRr=
`|f
\|f1
GRUB
Geom
Hard Disk
Read
 Error
root@debian:/#`

Voilà, en espérant qu’un jour ceci vous soit utile … ![:whistle:](https://www.debian-fr.org/uploads/default/original/1X/899b2c331f8cc02517f77948602974610a95f952.gif "Whistle")

---

<div class="post-metadata">

**Author:** ![lol](https://www.debian-fr.org/user_avatar/www.debian-fr.org/lol/32/15629_2.png) [@lol](https://www.debian-fr.org/u/lol)\
**Post date:** [Février 21, 2016, 3:18 UTC](https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803/2 "2016-02-21T03:18:23Z")

</div>

Salut,  
Ce n’est pas lié spécifiquement à update-grub.

Quand tu fais un chroot, toutes les partitions qui composent le système “chrooté” doivent être montés.

---

<div class="post-metadata">

**Author:** ![loreleil](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/l/77aa72/32.png) [@loreleil](https://www.debian-fr.org/u/loreleil)\
**Post date:** [Février 21, 2016, 3:18 UTC](https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803/3 "2016-02-21T03:18:30Z")

</div>

Salut lol,

Autant pour moi, cependant je ne me souviens pas de l’avoir lu, où alors pas là ou il le fallait.

Ce qui fait que, quand tu ne le sais pas, ben tu as le temps de chercher et de t’arracher les cheveux, s’il t’en restes … 😆 surtout quand tu débutes avec un live-cd ![:mrgreen:](https://www.debian-fr.org/uploads/default/original/1X/cc83e9b583138e48ff45f96609046b06d06c7f9d.gif "Mr. Green")

En tout état de cause, Merci pour cette précision … 😉

---

<div class="post-metadata">

**Author:** ![lol](https://www.debian-fr.org/user_avatar/www.debian-fr.org/lol/32/15629_2.png) [@lol](https://www.debian-fr.org/u/lol)\
**Post date:** [Février 21, 2016, 3:18 UTC](https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803/4 "2016-02-21T03:18:30Z")

</div>

Salut,  
Pas de soucis, mais il fallait le préciser.

Ceci aurait pu te mettre sur la voie:[quote=“[http://www.isalo.org/wiki.debian-fr/index.php?title=Réinstaller\_Grub2#Solution\_avec\_un\_chroot](http://www.isalo.org/wiki.debian-fr/index.php?title=R%C3%A9installer_Grub2#Solution_avec_un_chroot)”]Si vous aviez créé une partition séparée pour /boot, il faut la monter :

# mount /dev/hdxy /mnt/chroot/boot[/quote]

---

<div class="post-metadata">

**Author:** ![loreleil](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/l/77aa72/32.png) [@loreleil](https://www.debian-fr.org/u/loreleil)\
**Post date:** [Février 21, 2016, 3:18 UTC](https://www.debian-fr.org/t/bash-update-grub-command-not-found-en-live-cd/33803/5 "2016-02-21T03:18:31Z")

</div>

![:005](https://www.debian-fr.org/uploads/default/original/1X/cdd45e7dd754015ac5291329b843a2851a0d4fe8.gif "chaud") ![:005](https://www.debian-fr.org/uploads/default/original/1X/cdd45e7dd754015ac5291329b843a2851a0d4fe8.gif "chaud") … ![:017](https://www.debian-fr.org/uploads/default/original/1X/7bbea83f89515ab7c7a738dddb86c4d4f140bd13.gif "reflechit") le plus couillon, c’est que je me suis basé sur le wiki, et dans la bagarre (panique) j’ai zappé !

Pour le coup, mon neurone n’étaient très certainement pas au top, où alors à moitié … 😆

Ma foi, se sera certainement utile (cette précision) pour d’autres … bagarres ![:083](https://www.debian-fr.org/uploads/default/original/1X/d14bbab5e0eb9167fe7ed1d009c5a9b723425957.gif "yeux-ciel") à cœur vaillant … 😉

Merci lol … 😉
