My LFS system won't boot up after accidentally setting grub to hd1 instead of hd0
I just finished my LFS build but after rebooting i see this:
https://i.imgur.com/8boZJxL.png https://i.imgur.com/QqMKlec.png then I remembered that when configuring grub.cfg file i put set root=(hd1,6) instead of set root=(hd0,6). also i have to point out that when i booted up from my live cd, the /boot directory was empty https://i.imgur.com/4WO3KZP.png and all partitions where unmounted , only the host partition ans swap was mounted. how do i change fix this? do i have to enter chroot enviroment from live cd to install grub again? |
Yes, just chroot and change what is wrong.
|
I don't think you need to chroot. Just mount the LFS root partition somewhere convenient and edit grub.cfg by hand. You aren't reinstalling grub, after all, just changing the location information you give grub once it's loaded.
btw if you boot from a live disc, the /boot partition you see will be the one on the disc, so it may well be empty. To see the boot partition on your hard drive, you need to mount your root (say on /mnt) and then look at /mnt/boot. |
Quote:
|
You install grub as a piece of software but you install grub as bootloader as well. Those are two different things.
If you boot and see a grub command, the bootloader part is done but you messed up the config. You can change the config without chroot but you would need to mount the LFS-partition and edit the grub config file. |
Well.
Press E in GRUB and edit (hd1) to (hd0)?? |
Quote:
was i supposed to move/copy the linux kernel dir in /boot? i did't do it |
Quote:
Code:
parted -l |
Quote:
Code:
mount /dev/sdb9 /mnt/boot here is the output Code:
root@ubuntu:/# parted -l |
Quote:
|
If it isn't in the boot partition /dev/sdb9 check your / partition and/or other partitions, maybe the boot partition didn't get mounted when grub was installed and/or the wrong partition was mounted at /boot.
|
Quote:
i followed the instruction closely https://www.linuxfromscratch.org/lfs...er10/grub.html but i didn't do this Code:
If you choose to do this, you will need to mount the separate partition, move all files in the current /boot directory i also followed this instruction: From GRUB's perspective, the kernel files are relative to the partition used. If you used a separate /boot partition, remove /boot from the above linux line. You will also need to change the set root line to point to the boot partition. so i deleted the /boot from code like this: Code:
cat > /boot/grub/grub.cfg << "EOF" |
Quote:
|
Quote:
|
at the grub menu press c for a grub prompt grub>
at the grub prompt Code:
grub>set Code:
prefix= Which partition is suppose to be the / partition? |
All times are GMT -5. The time now is 11:32 PM. |