I screwed up the grub.cfg file in ubuntu and now i cant boot to that partition. What do i need to put in the file to be able to boot from that partition?
1 Answer
If you're using grub2 you can just run a sudo update-grub
to find the correct OSes and generate a new cfg.
From a live CD, you'll have to mount your partition:
sudo mkdir /mnt/root
sudo mount -t ext3 <your ubuntu partition, example /dev/sda4> /mnt/root
sudo mount -t proc none /mnt/root/proc
sudo mount -o bind /dev /mnt/root/dev
sudo mount -o bind /sys /mnt/root/sys
sudo chroot /mnt/root /bin/bash
sudo update-grub
-
so i'm using grub2. but i'm in a live cd at the moment.– user1450296Jul 3, 2012 at 19:10
-
1Result: Sudo: update-grub: command not found– user1450296Jul 3, 2012 at 20:01
-
2@user1450296: that makes no sense. Conner is perfectly right. He explained all the steps to get into the system from a live CD or an ordinary boot CD. Grub2 wouldn't be installed without also having
update-grub
. Jul 5, 2012 at 13:33 -
hi! is there anything to do if after performing update-grub, the problem isn't fixed? for me, I do it from an Ubuntu partition (I use dual-boot system on the same hard disk)– Shawn LeOct 12, 2014 at 13:53
-
@user1450296 See here: askubuntu.com/questions/418666/update-grub-command-not-found– QuidamMay 2, 2020 at 8:19