I'M trying to work my way through the linux from scratch project and I'M on page http://www.linuxfromscratch.org/lfs/view/stable/chapter08/grub.html I've really messed up my boot up process. I did make a boot disk as descriped in the above link.The computer originally had Debian (CLI only) has the host system from which I was building my Linux from scratch system. Now when I turn on the computer it has one OS in the list that's labeled "GRUB Linux...........", when I click enter the screen goes black and says "Press any key to continue", then goes back to the boot loader with "GRUB Linux...........". If I boot the system with the book disk it's just a prompt that says GRUB. Can anyone tell me how to repair my Debian bootloader from my current state? Thanks.
Dani AI
Short, practical recovery plan that builds on ’s symptom description and ’s suggestions: 1) confirm whether the GRUB you see is coming from the book disk or the hard drive and whether it’s GRUB legacy or GRUB2; 2) try a temporary manual boot from the GRUB prompt so the system can start; 3) if that works (or if manual boot is impossible), boot a live USB and reinstall GRUB from a chroot.
At the GRUB prompt use its basic inspection commands to find the correct partition and kernel files. ls lists disks/partitions and ls (hdX,Y)/ shows a partition’s contents — look for a boot/ directory, kernel files and either grub.cfg (GRUB2) or menu.lst (legacy). That tells you where the system files are and which GRUB flavor you’re dealing with.
Temporary manual-boot example (adapt names to what you find at ls — GRUB2 uses linux/initrd, legacy uses kernel/initrd):
grub> set root=(hd0,msdos1)
grub> linux /vmlinuz-<version> root=/dev/sda1 ro
grub> initrd /initrd.img-<version>
grub> boot If the manual boot works, the reliable fix is to reinstall GRUB from a live environment and regenerate config. Typical chroot workflow:
# from a live USB
sudo fdisk -l
sudo mount /dev/sdaX /mnt # root partition
sudo mount /dev/sdaY /mnt/boot # if /boot separate
sudo mount /dev/sdZ /mnt/boot/efi # if UEFI (FAT)
for d in /dev /dev/pts /proc /sys /run; do sudo mount --bind $d /mnt$d; done
sudo chroot /mnt /bin/bash
grub-install /dev/sda
update-grub
exit
sudo umount -R /mnt Notes and cautions: back up /boot before changes, do not run grub-install on the wrong disk, and use the UEFI-specific grub-install options if the system boots via EFI. If kernels or initrds are missing, restore or reinstall them before regenerating the grub config.
The one item in your list, is that coming from your boot disk, or is that the broken configuration left on your hard drive? Also, Im gonna assume your working with Grub 1 (as opposed to Grub 2.0; This is important...)
Its good that grub is loading, your probably just pointing at the wrong partition. What you need to do is alter the the 'grub.cfg'. If you think grub is loading from your boot disk, put that disk in another computer and you should be able to find the configuration file and make changes.
If grub is loading from your hard-drive (confirm this by removing boot disk, and if grub is still loading, you have your answer), your going to probably need a rescue disk at minumum to get you access to your boot partition (after which, you will be looking for the same 'grub.cfg')
Here is the part you are looking for...
menuentry "GNU/Linux, Linux 3.5.2-lfs-7.2" {
linux /boot/vmlinuz-3.5.2-lfs-7.2 root=/dev/sda2 ro
Try modifying the "root=..." part, example, change it to "root=/dev/sda1". It depends on which partition number your Debian installation is sitting on.
Do not just copy everything from that webpage verbatim, your going to have to use some deduction to find out which partitions you need to be working with. Go with a little trial-and-error, and post back what you find. Try to include information about your partition table as well.
If your comfortable with the terminal, dig around in the debian rescue terminal, I think you want 'grub-install', and that may autodetect and correct your bootloader. The rescue terminal also has some text tools (nano i believe), so if you can find your grub.cfg, you can just edit it from there.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.