Originally Posted by hookitup
You may need to do a chroot into the "broken" install from a live cd, remove the alterations from /etc/grub.d/40_custom in the chroot environment, then from within the chroot run, Note: chroot terminal is a root terminal, no sudo needed, see the edit below. By updating from within a chroot from a live cd, the grub files will be correctly set up before you try and reboot into the main install including removing the password request.
Unfortunately my notes on this aren't readily available, will get back with detailed instructions later if nobody has such notes/info handy.
1. in a terminal from a live cd copy/paste the one line of code below
Note, this sets up a chroot environment in the terminal with /dev/sda1 being mounted to /mnt, the remaining command bind mounts necessary system folders and sets up networking available (not needed in these circumstances-for when downloading into a chroot is necessary)
sudo mount /dev/sda1 /mnt/ && sudo mount --bind /dev /mnt/dev && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount -o bind /etc/resolv.conf /mnt/etc/resolv.conf && sudo chroot /mnt/ /bin/bash
2. with the terminal open and chroot mounted, open a 2nd terminal and copy/paste the command
3. Remove your alterations, read the header of the file carefully and make certain the exec line is not touched.
gksudo gedit /mnt/etc/grub.d/40_custom
4. Save the file in gedit and exit.
5. Go back into the still open chroot terminal and issue the command.
you may not need sudo, it is a root terminal in the chroot environment (working on your hard disk install).
6. Press, Ctrl+d on the keyboard to exit the chroot when the grub update completes, your prompt will return to ubuntu@ubuntu (user) from root@ubuntu (root) in the live cd terminal.
7. Unmount the chroot filesystem mounts and networking with the code,
8. Close the terminal and reboot into your hard drive install (hopefully). Cheers.
sudo umount /mnt/etc/resolv.conf && sudo umount /mnt/dev/pts && sudo umount /mnt/sys && sudo umount /mnt/proc && sudo umount /mnt/dev && sudo umount /mnt