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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-07-2011, 04:03 PM
|
#1
|
|
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,560
|
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
|
|
|
|
11-07-2011, 08:43 PM
|
#2
|
|
Member
Registered: Oct 2011
Location: Oldham, UK
Distribution: Arch, Debian, LFS (debian and LFS relegated to backups)
Posts: 250
Rep:
|
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.
|
|
|
|
11-08-2011, 04:23 AM
|
#3
|
|
LQ Veteran
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
|
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"
|
|
|
|
11-08-2011, 03:22 PM
|
#4
|
|
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,560
Original Poster
|
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.
|
|
|
|
11-08-2011, 03:37 PM
|
#5
|
|
Member
Registered: Oct 2011
Location: Oldham, UK
Distribution: Arch, Debian, LFS (debian and LFS relegated to backups)
Posts: 250
Rep:
|
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?
|
|
|
|
11-08-2011, 03:49 PM
|
#6
|
|
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,560
Original Poster
|
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.
|
|
|
|
11-08-2011, 06:34 PM
|
#7
|
|
Member
Registered: Oct 2011
Location: Oldham, UK
Distribution: Arch, Debian, LFS (debian and LFS relegated to backups)
Posts: 250
Rep:
|
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.
|
|
|
|
11-09-2011, 05:53 AM
|
#8
|
|
LQ Veteran
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
|
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.
|
|
|
|
11-13-2011, 12:52 PM
|
#9
|
|
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,560
Original Poster
|
Problem solved I added rootdelay to the grub.cfg
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:26 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|