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.
Hi I have just put together my first LFS system with 6.3. I got it all worked out with just a last minute kink on the first boot and my root not being found. However I read all the stuff and it still didn't work so I checked and my drives where getting flip-flopped from my install disk.
When I put in the LFS6.3 LiveCD my harddrive/partition I wrote it all to was sda5...however when I go to boot up my system it is sdb5. Can someone come up with any explanation as to why this would be? Because I would prefer to have the operating system on device sda. I know it is just a name and that it all works but it makes me feel better knowing what actually happened there you know.
Then what do the LFS-Bootscripts actually do for me? What do I gain from them and what would I loose from them without having them? Does it just make for a pretty boot sequence? Or does it actually serve a deeper purpose? I see from the short description in the LFS boot that it actually does some loading at the boot sequence but what all is lost if it is not there?
Thank you and sorry since I put two questions into one topic...
"When I put in the LFS6.3 LiveCD my harddrive/partition I wrote it all to was sda5...however when I go to boot up my system it is sdb5."
That is the BIOS - it will attempt to find a boot disk and call it '0x80' (== hda, sda ..) This is because manufacturers assume people want to boot WinDuhs, and all versions of WinDuhs have a defective bootloader which must boot from disk #0x80. So when your other device becomes the boot device, things are swapped about. You need to take this into account when creating your bootable system and edit 'fstab' as appropriate; you may also need to use some of the lilo switches. I haven't been able to boot lfs from 'grub' yet - never have time to really learn to use grub well.
"Then what do the LFS-Bootscripts actually do for me?"
Not an awful lot, and that's one deficiency of LFS - it doesn't really discuss the boot sequence well and personally I don't like their boot scripts. To learn more, I'd suggest taking a bootable *.iso image apart. My favorite is the Debian installer CD. What you really want to look carefully at is the "initrd" image. Look at what the "init" does (it is a bash script which does any necessary tweaking of the virtual filesystem and then invokes the REAL 'init' which is a binary executable - in the case of the Debian installer it is 'busybox'). The real init will process the inittab file - compare the installer's inittab with an installed system's inittab.
When I put in the LFS6.3 LiveCD my harddrive/partition I wrote it all to was sda5...however when I go to boot up my system it is sdb5. Can someone come up with any explanation as to why this would be? Because I would prefer to have the operating system on device sda. I know it is just a name and that it all works but it makes me feel better knowing what actually happened there you know.
Something else must be snatching up sda before your intended hard drive is found. I'd say boot up and then do 'dmesg | grep sda' for info on which device the kernel is finding.
Quote:
Originally Posted by blither
Then what do the LFS-Bootscripts actually do for me? What do I gain from them and what would I loose from them without having them? Does it just make for a pretty boot sequence? Or does it actually serve a deeper purpose? I see from the short description in the LFS boot that it actually does some loading at the boot sequence but what all is lost if it is not there?
One of the main things end-users usually use bootscripts for is to start various daemons. However, more important than that, the bootscripts setup various necessary filesystems like /proc and /sys, start up udev (which populates your /dev directory), check your filesystems for errors, mount your root filesystem and then they open up a login prompt that dumps you to a shell upon successful login.
If you can manage doing all that in your own custom scripts or via another tool, by all means go for it. In fact, I believe there are LFS hints written on how to use alternative bootscripts or init methods. Have fun...
"When I put in the LFS6.3 LiveCD my harddrive/partition I wrote it all to was sda5...however when I go to boot up my system it is sdb5."
That is the BIOS - it will attempt to find a boot disk and call it '0x80' (== hda, sda ..) This is because manufacturers assume people want to boot WinDuhs, and all versions of WinDuhs have a defective bootloader which must boot from disk #0x80. So when your other device becomes the boot device, things are swapped about. You need to take this into account when creating your bootable system and edit 'fstab' as appropriate; you may also need to use some of the lilo switches. I haven't been able to boot lfs from 'grub' yet - never have time to really learn to use grub well.
But see the disk I am using is the boot disk, and it is in the first place on my motherboard. What does not make sense is that when I boot from a LiveCD the harddrive that has my OS is on is labeled as sda. But when I boot that disk from the bootloader it then is labeled as sdb. To make the situation even more out there there is what my grub config looks like.
Code:
root (hd0,4)
kernel /boot/lfs.... root=/dev/sdb5
So if I have been understanding my grub setup, and it does work, grub sees the harddrive as the first one however right after it boots my system sees it as the second one. Is this correct? And if I change the /dev/sdb5 to sda5 i get the message about how it could not mount root....
Quote:
Originally Posted by jhuntwork
Something else must be snatching up sda before your intended hard drive is found. I'd say boot up and then do 'dmesg | grep sda' for info on which device the kernel is finding.
But how would I fix this? I know that my other harddrive is taking the name, but how can I resolve this issue?
------
Where would I abouts to find a boot image to mess with and modify? And is there a way to have a graphic over everything my entire boot sequence, unless an error pops up of course...?
But how would I fix this? I know that my other harddrive is taking the name, but how can I resolve this issue?
Do you know what drivers are being used for each device? And have you built them as modules or into the kernel itself?
Quote:
Originally Posted by blither
Where would I abouts to find a boot image to mess with and modify? And is there a way to have a graphic over everything my entire boot sequence, unless an error pops up of course...?
Not sure what you mean by the boot image. You could always dissect the LFS LiveCD to see how it is setup. As far as a graphic goes, you're talking about Bootsplash (or something similar). There's an old hint about this in the LFS Hints section. But bootsplash.org is the actual site where development takes place and is likely more up to date than the hint.
Well right now I have a lot of stuff built in that I do not need because at first I was reading about how it could be that I was building stuff in only as a module. So anything scsi related I included, and anything related to my motherboards pci and other features I also included into the kernel. It was only after that, that i found out it was not on sda but b. So I need to rebuild my kernel yet again to take out a lot that I do not need. In short im not sure, and im not sure how to tell which one I am using either.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.