LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
 
LinkBack Search this Thread
Old 11-07-2011, 04:03 PM   #1
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,611
Blog Entries: 1

Rep: Reputation: 226Reputation: 226Reputation: 226
setup grub


Ok I need to setup grub I,m building on sdc I want this to boot all on it,s own, not affect the other drives/OS. I can change the drive to boot from bios.

fdisk -l from host
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1275    10241406    7  HPFS/NTFS
/dev/sda2            1276        2491     9764864   83  Linux
/dev/sda3            2491       14594    97212417    5  Extended
/dev/sda5            2491        2613      975872   82  Linux swap / Solaris
/dev/sda6            2613       14594    96235520   83  Linux

Disk /dev/sdb: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x414d8374

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1912    15358108+  83  Linux
/dev/sdb2            1913        2039     1020127+  82  Linux swap / Solaris
/dev/sdb3            2040        5864    30720612+  83  Linux
/dev/sdb4            5864       12162    50585601    5  Extended
/dev/sdb5            5864        7776    15360000   83  Linux
/dev/sdb6            7777        7904     1024000   82  Linux swap / Solaris
/dev/sdb7            7904       12162    34199552   83  Linux

Disk /dev/sdc: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2bd28d09

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1913    15360000   83  Linux
/dev/sdc2            1913        2043     1048576   82  Linux swap / Solaris
/dev/sdc3            2043        4864    22660096   83  Linux
The device map from lfs
Code:
cat device.map
(hd0)	/dev/disk/by-id/ata-Hitachi_HTS541612J9SA00_SB2D01E4GKEVWB
(hd1)	/dev/disk/by-id/usb-FUJITSU_MHV2100AH-0:0
(hd2)	/dev/disk/by-id/usb-Generic_External_37364A503332363853202020-0:0
Do I set grub to
grub-install /dev/sdc or /dev/hd2

The reason for this is I,m going to copy as an image then maybe used on a single drive in a computor hope this made sense

Last edited by spiky0011; 11-07-2011 at 04:16 PM. Reason: added a bit more info
 
Old 11-07-2011, 08:43 PM   #2
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 251

Rep: Reputation: 40
You can still use your existing grub to boot LFS while you build. Simply add an entry to /etc/grub.d/40_custom and sudo update_grub to add your boot entry whilst you build, and remove it when finished. There's nothing to prevent you building grub in LFS, just don't install it yet. It's unlikely that grub.cfg would be portable to another machine anyway.

When you have your build ready to move to CD, I assume you will include an installation script, in which case you can install grub from the LFS disk on the new machine at that point anyway. To get rid of the boot entry on your build system simply remove the entries from /etc/grub.d/40_custom and sudo update_grub again.
 
Old 11-08-2011, 04:23 AM   #3
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
When installing the distro to your /dev install the mbr to / of sdc.

To select, this applies to most distros - when you come to the partitioning of the hd you need to select the 'expert' or 'custom' and somewhere there you should see grub option or boot.

Do not panic if you overwrite your mbr. Keep a live cd with the grub you are wanting to use legacy or 2.

If you are going to use grub 2 here is one of the best tutorials I have found

grub2

Check item 12 "Reinstalling grub2"
 
Old 11-08-2011, 03:22 PM   #4
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,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
Ok i,m having a problem booting lfs. I would like this to be a stand alone system that when switched to in bios it will boot on it,s own, NOT from another grub. so I can pick which harddrive to boot from I,e it will be the 3rd 1 then grub would show up with that as the only OS.
my grub.cfg
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod ext2
set root=(hd2,1)

menuentry "GNU/Linux, Linux 3.1-lfs-7.0" {
        linux   /boot/vmlinuz-3.1-lfs-7.0 root=/dev/sdc1 ro
}
I ran this grub-install /dev/sdc
I,m thinking the set root should be (hd0,1) But I dont want it to interfere with the other grubs, so was looking for some advice.
I know this might not seem right but it,s wot i would like.
 
Old 11-08-2011, 03:37 PM   #5
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 251

Rep: Reputation: 40
On the face of it, your grub.cfg should work as it is. I assume that grub is providing an error, in which case, what is it?
 
Old 11-08-2011, 03:49 PM   #6
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,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
I get error: file not found.
I,m thinking as I switch to that harddrive is it looking at it as hd0?
I built lfs on Ubuntu host /dev/sda somethingwhich makes lfs on sdc when switch to lfs harddrive dose it look at it differently.
 
Old 11-08-2011, 06:34 PM   #7
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 251

Rep: Reputation: 40
No - I could be wrong, but I'm almost certain that, provided you have the drive assignments correct (which you appear to have) your vmlinuz entry may be a little wrong.

ls /boot | grep vmlinuz will confirm for you.

If it's any help, I made a rookie mistake originally and called it vmlinux so may be worth checking.
 
Old 11-09-2011, 05:53 AM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
When changing boot order your device mapping may change also. Try using uuid # instead of '/dev/sdc1'.

Quote:
I,m thinking the set root should be (hd0,1)
Try this after changing uuid if that does not fix, just keep a live cd around in case you need to use to boot back.

Last edited by Larry Webb; 11-09-2011 at 02:53 PM.
 
Old 11-13-2011, 12:52 PM   #9
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,611
Blog Entries: 1

Original Poster
Rep: Reputation: 226Reputation: 226Reputation: 226
Problem solved I added rootdelay to the grub.cfg
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] GRUB: Cannot find list of partitions && /usr/sbin/grub-setup: error w1k0 Linux Mint 26 12-21-2010 03:29 PM
Setup GRUB RiSK *BSD 1 02-26-2005 04:49 PM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM
grub setup linuxnube Linux - General 3 12-19-2003 03:26 PM
grub setup flump Linux - Software 1 08-05-2003 05:00 PM


All times are GMT -5. The time now is 04:36 AM.

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