LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 12-30-2011, 05:19 PM   #1
ubuntudude12
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Rep: Reputation: Disabled
Arrow Booting LFS 7.0 with grub2


Hi,

I am currently using Ubuntu 11.10. I have just finished my first Linux From Scratch build, and now I am trying to make it bootable. My system currently has Grub2 installed. I am trying to figure out how to add an entry for Linux from Scratch to Grub2. The partitions I am using are /dev/sd5 (the root partition), /dev/sda6 (the boot partition), /dev/sda7 (the home partition), and /dev/sda8 (the swap partition). Does anyone know how to do this?

-Aaron
 
Old 12-30-2011, 05:30 PM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,614
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Hi

The 1st thing can you post your /etc/fstab file and grub.cfg also the output of
Code:
sudo fdisk -l
.
It also depends on how you want to boot the system, mine is kept seperate from ubuntu
 
Old 12-30-2011, 06:13 PM   #3
ubuntudude12
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
Arrow

Hi,

The output of sudo fdisk -l is:
Code:
Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00003f4a


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   207154828   103576390+  83  Linux
/dev/sda2       207157246   253292543    23067649    5  Extended
/dev/sda5       207157248   228128767    10485760   83  Linux
/dev/sda6       228130816   228325375       97280   83  Linux
/dev/sda7       228327424   249098239    10385408   83  Linux
/dev/sda8       249100288   253292543     2096128   82  Linux swap / Solaris
The /ect/fstab file for my host system (Ubuntu) is the following:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=2b04dc66-c2b2-4e25-ac01-5a3936372264 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda8 during installation
UUID=6067c5ee-0a8e-4c79-ad79-fd9743808f1f none            swap    sw              0       0
My LFS's /ect/fstab file is as follows:
Code:
# Begin /etc/fstab

# file system  mount-point  type  options         dump  fsck
#                                                       order

/dev/sda5      /            ext3 defaults         1     1
/dev/sda6      /boot        ext3 defaults         0     0
/dev/sda8      swap         swap pri=1            0     0
proc           /proc        proc defaults         0     0
sysfs          /sys         sysfs defaults        0     0
devpts         /dev/pts     devpts gid=4,mode=620 0     0
tmpfs          /run         tmpfs defaults        0     0
# End /ect/fstab
-Aaron
 
Old 12-30-2011, 06:16 PM   #4
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 252

Rep: Reputation: 40
I had to add an entry to /etc/grub.d/40_custom for grub 2:

Code:
menuentry "Linux 3.1-roken" {
	savedefault
	insmod ext2
	set root='(hd0,1)'
        linux   /vmlinuz-3.1.roken root=/dev/sdb3 ro radeon.modeset=0 vga=795
}
You would obviously need to change the "linux" line to fit your system and make sure that root is set correctly.

Then

Code:
sudo update-grub
 
Old 12-30-2011, 08:22 PM   #5
ubuntudude12
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
I tried your suggestion, modifying the linux line to the proper settings for my system. When I try to boot using Grub2, I receive an error saying that the disk was not found, Do you know what could cause this?

-Aaron

Last edited by ubuntudude12; 12-30-2011 at 08:22 PM. Reason: I forgot my signature
 
Old 12-30-2011, 09:02 PM   #6
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 252

Rep: Reputation: 40
It may be your set root= line - double and triple check that. There can also be problems if you built the kernel incorrectly. Does it get so far into the boot before it bombs, and if so what is the actual text of the error produced?
 
Old 12-31-2011, 01:08 AM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: Ubuntu 12.04/12.10/13.04/LFS/Centos6.3/Debain/PCBSD/Mageia 3
Posts: 1,614
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
Post your grub.cfg how you set it up this time, and the error message you get
 
Old 12-31-2011, 02:31 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Hi,

Am I assuming correctly that you are using the grub that came with Ubuntu and not the one mewntioned/build/configured in LFS?

With that assumption in mind: Doesn't running a grub-update from Ubuntu find the new LFS system?

One of my other systems runs Debian (very related to Ubuntu) and running grub-update does find other OS's installed. On Debian this is the way to do it. If you manually add entries to grub (grub.cfg to be exact) they might be removed when the grub package is updated.

Have a look here (especially 6 Adding Entries to Grub 2): Ubuntu - the Grub 2 guide

If you do need to do this manually I believe the entry should look like this:
Code:
menuentry "LFS 7.0 - linux 3.1.5" {
   insmod ext2
   set    root=(hd0,6)
   linux  /vmlinuz-3.1.5-lfs-7.0  root=/dev/sda5  ro
}
- the set root=(...) entry should point to your boot partition,
- the root=/dev/... entry points to your root partition.

Hope this helps.
 
1 members found this post helpful.
Old 12-31-2011, 07:19 AM   #9
ubuntudude12
LQ Newbie
 
Registered: Dec 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thank you druuna! I tried out your suggestion, and it worked! Thank you for all of the help you provided me.
 
Old 12-31-2011, 07:23 AM   #10
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 252

Rep: Reputation: 40
Quote:
Originally Posted by druuna View Post
If you manually add entries to grub (grub.cfg to be exact) they might be removed when the grub package is updated.
Just as a matter of interest, this is why I suggested in including the entry in 40_custom, which ensures that it gets added back in after a grub update.
 
Old 12-31-2011, 07:36 AM   #11
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Hi,
Quote:
Originally Posted by ubuntudude12 View Post
Thank you druuna! I tried out your suggestion, and it worked! Thank you for all of the help you provided me.
You're welcome
 
  


Reply

Tags
boot, grub, lfs


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
[SOLVED] booting Live .iso from Grub2 qrange Linux - Software 16 03-14-2012 09:40 PM
[SOLVED] Booting grub2 from grub. tekra Linux - Software 3 03-30-2011 04:55 PM
[SOLVED] Is it possible to configure GRUB2 booting time? darthpinguim Linux - Newbie 5 02-11-2011 06:32 AM
Booting FreeBSD iso grub2 jmc1987 Linux - Newbie 3 01-20-2011 08:03 PM
booting remastersys iso using grub2 anandogc Linux - Software 5 08-27-2010 07:39 AM


All times are GMT -5. The time now is 12:33 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