Linux From ScratchThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.