LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Grub2 rewrite from liveDVD (https://www.linuxquestions.org/questions/linux-software-2/grub2-rewrite-from-livedvd-878892/)

jago25_98 05-04-2011 09:25 PM

[solved] Grub2 rewrite from liveDVD
 
Made a mistake with /etc/default/grub
...
now nothing will boot.

So I need to edit that file and update-grub.

But if I chroot to the / from a liveCD I get
"/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?)."

How do I change grub if I can't get to it (set the menu to 0 by mistake)

andrewthomas 05-04-2011 09:36 PM

Use this to chroot.

Make sure that you replace /dev/sdXy with the correct disk and partition

Code:

#! /bin/bash
sudo mount /dev/sdXy /mnt/
sudo mount --bind /proc /mnt/proc
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /sys /mnt/sys
chroot /mnt/ /bin/bash

sudo umount /mnt/sys
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/



All times are GMT -5. The time now is 05:55 AM.