LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 09-01-2012, 05:13 PM   #1
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Rep: Reputation: 0
repair Debian bootloader & GRUB


I'M trying to work my way through the linux from scratch project and I'M on page http://www.linuxfromscratch.org/lfs/...er08/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.
 
Old 09-01-2012, 05:36 PM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debain
Posts: 1,742
Blog Entries: 1

Rep: Reputation: 244Reputation: 244Reputation: 244
Hi

A good place to start, load a live cd, then post the output of
Code:
sudo fdisk -l
and
Code:
sudo blkid
Also the /boot/grub/grub.cfg from host and grub.cfg fom lfs.
I,m not saying I can help but it will be good info to get help from others.
Think that should be enough for now.
 
1 members found this post helpful.
Old 09-01-2012, 05:58 PM   #3
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 484

Rep: Reputation: 133Reputation: 133
One thing you can try right now is to manually boot the Debian system from that boot disk's grub> prompt. Debian has been using GRUB 2 for a long time, so I guess your Debian system has a core.img file. You might be able to manually boot it like this rough example (that will need considerable customizing by you)...
Code:
grub> linux (hdx,y)/boot/grub/core.img
grub> boot
First, you need to change x & y to the drive & partition with the Debian boot files. Use GRUB 2 enumeration for those since the boot disk is GRUB 2.

Next, if your Debian system has a separate boot partition, then omit the "/boot" part of the path in the linux command.

Next, the core.img file may be in a folder named differently. Generically, it usually has been in /boot/grub. But in Fedora as an example, it is now in /boot/grub2/i386-pc. It may be something else again in Debian (I don't use Debian at the moment). Change that part of the path when you know where it is in the Debian system.

When that linux command line is adjusted perfectly, enter the boot command and see if it boots Debian. If it does, then repair the Debian GRUB boot loader with the usual grub-install command in the running Debian system.

If all that worked, it should at least put you back to where you were before. Then continue on with what you want to do next.


P.S.: Just FYI, the Super Grub 2 Disk is a free and popular utility for emergency booting a Linux system with a busted GRUB 2 boot loader. It won't repair the boot loader like the old legacy Super Grub Disk did. But that doesn't really matter much if it boots the system. The boot loader is easy to repair after the system is running..
.
.

Last edited by stoat; 09-01-2012 at 11:19 PM.
 
1 members found this post helpful.
Old 09-01-2012, 11:29 PM   #4
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by spiky0011 View Post
Hi

A good place to start, load a live cd, then post the output of
Code:
sudo fdisk -l
and
Code:
sudo blkid
Also the /boot/grub/grub.cfg from host and grub.cfg fom lfs.
I,m not saying I can help but it will be good info to get help from others.
Think that should be enough for now.
Disk /dev/sda: 250.1 GB, 2500059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sectors size (logical/physical): 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifiers: 0x00006aec

sudo fdisk -l
Device Boot Start End Blocks Id System
/sda1 1 26747 214842368 83 Linux
/sda2 26747 26869 976896 82 Linux swap / Solaris
/sda3 * 26869 30402 28378112 83 Linux


sudo blkid
/dev/sda1: UUID="5cde3219-5770-42b9-9daf-b310870dfcdb" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda2: UUID="3480e36d-9636-4acl-8461-ea1756499Ob4" TYPE="swap"
/dev/sda3: UUID="e4Ob23cl-4127-4575-9902-5ff6f2e5ac32" TYPE="ext4"

There is no /grub/grub.cfg on my debian system, I found a few other grub files I'll try and get on here later, I can't copy and past because it's two different machiens. Thanks.
 
Old 09-01-2012, 11:50 PM   #5
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
grub.cfg

Quote:
Originally Posted by spiky0011 View Post
Hi

A good place to start, load a live cd, then post the output of
Code:
sudo fdisk -l
and
Code:
sudo blkid
Also the /boot/grub/grub.cfg from host and grub.cfg fom lfs.
I,m not saying I can help but it will be good info to get help from others.
Think that should be enough for now.
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd0,2)

menuentry "GNU/Linux, Linux 3.2.6-lfs-71"
{
linux /boot/vmlinuz-3.2.6-lfs-7.1 root=/dev/sda1 ro
}
 
Old 09-02-2012, 03:17 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debain
Posts: 1,742
Blog Entries: 1

Rep: Reputation: 244Reputation: 244Reputation: 244
Hi

So there is only 1 os system on this pc? "lfs"
Try changing
Quote:
set root=(hd0,2)
to
Quote:
set root=(hd0,1)

Last edited by spiky0011; 09-02-2012 at 03:18 AM.
 
Old 09-02-2012, 02:59 PM   #7
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by spiky0011 View Post
Hi

So there is only 1 os system on this pc? "lfs"
Try changing to
No, there are two, a Debian and the LFS system. LFS is on sda1 and I think Debian is on sda3. I was trying to repair the Debian boot system or at leat configure the LFS boot system from a live CD. The live CD was working fine yesterday but now the screen just goes black and the moniture shows no activity after selectin "LIVE" from the debian Live CD. Any thoughts? Could you please explain the syntax of (hd0,2)?

Last edited by Garrett85; 09-02-2012 at 03:16 PM.
 
Old 09-02-2012, 03:23 PM   #8
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debain
Posts: 1,742
Blog Entries: 1

Rep: Reputation: 244Reputation: 244Reputation: 244
Did you just copy the commands in the book I see you used scripts to build.
hd0 is the numbering of the harddrive ,2 the two is the partitions on the drive,
Hope that clears that bit.
So where did you build lfs? sda2 is swap.
I dont use Debain but google says /boot/grub/grub.cfg
I take it you boot and get a screen similar.
I dont know why the live cd wont boot nothing should stop that.
 
Old 09-03-2012, 04:24 AM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,029

Rep: Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559Reputation: 559
Lfs requirements state that you must have a running system along with build tools to install LFS to another partition,so I find it hard to believe that LFS is on sda1 unless you partitioned the drive to have the 3 partitions then installed debian to sda3.
I would say that debian is on sda1. & you'll need to reinstall grub.
 
Old 09-03-2012, 01:45 PM   #10
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by EDDY1 View Post
Lfs requirements state that you must have a running system along with build tools to install LFS to another partition,so I find it hard to believe that LFS is on sda1 unless you partitioned the drive to have the 3 partitions then installed debian to sda3.
I would say that debian is on sda1. & you'll need to reinstall grub.
Your first guess is right, I have Debian installed on sda3. The LFS partitoin is on sda1.
 
Old 09-03-2012, 01:56 PM   #11
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
root:/boot/grub# cat grub.cfg
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
set pager=1

insmod ext2
set root=(hd0,1)

menuentry "GNU/Linux, Linux 3.2.6-lfs-7.1" {
linux /boot/vmlinuz-3.2.6-lfs-7.1 root=/dev/sda1 ro
}
root:/boot/grub#
 
Old 09-03-2012, 02:00 PM   #12
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debain
Posts: 1,742
Blog Entries: 1

Rep: Reputation: 244Reputation: 244Reputation: 244
I take it thats the grub.cfg on lfs
 
Old 09-03-2012, 02:17 PM   #13
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by spiky0011 View Post
I take it thats the grub.cfg on lfs
Yes. I am able to boot the computer now using a boot disk that one of you guys on here suggested. I've also think I've fixed the LFS GRUB anyway but it still will not boot that I don't think it's a grub problem anymore. I've been told I have a Kernel driver problem. Does anyone know where I can find some sort of log created when installed and or configureing the kernel?
 
Old 09-03-2012, 02:31 PM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Centos6.3/Debain
Posts: 1,742
Blog Entries: 1

Rep: Reputation: 244Reputation: 244Reputation: 244
Just a little note when you post if you can show the errors or any relevent msgs you are getting it will help.

What errors are you getting. when you boot from grub.
The config log from the kernel is in /boot config-3.2
 
Old 09-03-2012, 02:33 PM   #15
Garrett85
Member
 
Registered: Jan 2011
Posts: 88

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by spiky0011 View Post
Just a little note when you post if you can show the errors or any relevent msgs you are getting it will help.

What errors are you getting. when you boot from grub.
The config log from the kernel is in /boot config-3.2
2.033750] VFS : Unable to mount root fs via NFS, trying floppy
2.034037] VFS : Cannot open root device "sda2" or unknown-black(2,0)
2.034109] Please append a correct "root=" boot option ; here are the available partitions:
2.034209] Kernel panic - not syncing: VFS : Unable to mount root fs on unknown -block(2,0)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
howto repair GRUB using debian setup CD ? cccc Linux - Distributions 4 11-06-2010 07:00 AM
How to add freebsd to debian grub bootloader cola *BSD 1 02-22-2010 02:47 PM
Debian - What to do with GRUB bootloader? kyothine Linux - Newbie 3 07-04-2009 10:00 AM
Grub bootloader for Debian 4.0 and Win XP error 17 GSX Debian 15 06-11-2007 06:46 AM
SuSE 10.1 GRUB BootLoader how to repair riba43 Suse/Novell 20 02-24-2007 03:41 AM


All times are GMT -5. The time now is 02:54 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration