LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 05-05-2020, 04:20 PM   #1
ProfSucrose
LQ Newbie
 
Registered: May 2020
Posts: 3

Rep: Reputation: Disabled
Can't boot up original host OS after installing and booting up LFS


Hello!

I just finished the LFS book and was able to boot up the system successfully, however I can no longer boot up my host OS which I need to fix my broken GRUB config file.

Is there any way I can still boot up my original host system and interact with the LFS filesystem that way? I apologize if I'm being stupid, I'm not super experienced with Linux!

(I'm running this on VirtualBox and the host system was Ubuntu if that changes anything)

Thanks to anyone who responds!
 
Old 05-05-2020, 06:53 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,354

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
This is assuming your booting from lfs grub and the entry for ubuntu isn't working. Boot into lfs, mount ubuntu root partition at /mnt open ubuntu /mnt/boot/grub/grub.cfg, scroll down to where the menuentry for ubuntu starts, copy the ubuntu menuentry lines to the end of your lfs /boot/grub/grub.cfg reboot and you should have a working entry for ubuntu. If that doesn't work you will need to give more information on your setup and error messages.

Last edited by colorpurple21859; 05-05-2020 at 06:55 PM.
 
Old 05-05-2020, 07:19 PM   #3
ProfSucrose
LQ Newbie
 
Registered: May 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
(I apologize for my stupidity) I can't seem to access and modify my grub configuration while on the LFS system?
 
Old 05-05-2020, 08:15 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,354

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
nevermind scratch that. at the grub menu press c to get grub prompt
assuming you only have one drive and you know what partition ubuntu is on counting partitions from one, for example if ubuntu / is on the second partition
Code:
grub> configfile (hd0,2)/boot/grub/grub.cfg
should give you the ubuntu grub menu. Change the 2 accordingly for the partition that ubuntu is on. boot into ubuntu run
Code:
sudo grub-install /dev/sda
change accordingly if your drive naming is different.
 
Old 05-07-2020, 12:56 PM   #5
vsayanam
LQ Newbie
 
Registered: Jan 2009
Posts: 22

Rep: Reputation: 10
if you can give more information, you can expect some solutions from the members. In my case it has happened many times. I do not keep any data in my PC and I simply reinstall host OS. Sometime, the drive letter like /dev/sda2 or /dev/sda3 may not be correct. I press letter e on the keyboard on the line showing OSes to check the correct drive letter. I do not follow the LFS book when grub is mentioned as I have many partitions for various Linux distros. Please reply with more information.
 
Old 05-07-2020, 02:29 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,354

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
I may be wrong, but I'm assuming that the op followed the lfs guide to the letter, not realizing that they wouldn't have a boot menu for the host system. Also assuming there is only one standard drive and a standard partition layout. That is sure a lot of assuming and you know what the saying about that is lol.
 
Old 05-11-2020, 08:50 AM   #7
GarethInWales
LQ Newbie
 
Registered: Nov 2019
Posts: 5

Rep: Reputation: Disabled
A maybe longwinded resolution but one that works for me
I had the same problem when first I got as far as the grub config back in 7.x
My setup is on virtual box as well and uses separate HD for LFS and the build system.
I installed the LFS bootloader to the LFS HD not the hostOS HD, so pressing f12 during boot allows me to choose what HD the system boots from; the hostOS system or LFS.

If you have LFS on a separate partition on the same drive as your hostOS make a new HD image, live-boot an ubuntu iso in your virtual machine and use gparted to clone the LFS partition to the new drive, then install https://help.ubuntu.com/community/Boot-Repair and recover the original system boot.
You would have to set up the linked folders across the HD's shouldn't be too bad, or use this script as a template https://pastebin.com/hbzvxueM . (its a copy and paste out of the 9.0 LFS handbook with a few changes)


I hope you find this useful
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VirtualBox Starter Pack - LFS as a Host For Your LFS Build basica Linux From Scratch 4 11-25-2015 12:02 PM
Forwarding ping packets from one 1st host to 2nd host via 2rd host sachee Linux - Networking 1 09-25-2011 01:51 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
Can't boot LFS ( kernel panic - not syncing ) LFS 6.6 Lyle Linux From Scratch 14 05-15-2010 03:22 AM
try install host ; bind9-host uninstalled , how to undo sudo apt-get install host? shojaru Linux - Newbie 0 06-11-2009 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration