LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 06-23-2008, 05:46 PM   #1
blither
Member
 
Registered: Dec 2002
Location: Ohio
Distribution: LFS, Ubuntu
Posts: 154

Rep: Reputation: 15
LFS-Bootscripts and Harddrive Names


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...
 
Old 06-23-2008, 06:30 PM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 49
"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.
 
Old 06-23-2008, 06:36 PM   #3
jhuntwork
LQ Newbie
 
Registered: Mar 2005
Posts: 15

Rep: Reputation: 0
Quote:
Originally Posted by blither View Post
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 View Post
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...
 
Old 06-24-2008, 07:57 AM   #4
blither
Member
 
Registered: Dec 2002
Location: Ohio
Distribution: LFS, Ubuntu
Posts: 154

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pinniped View Post
"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...?
 
Old 06-24-2008, 08:38 AM   #5
jhuntwork
LQ Newbie
 
Registered: Mar 2005
Posts: 15

Rep: Reputation: 0
Quote:
Originally Posted by blither View Post
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 View Post
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.
 
Old 06-24-2008, 09:23 AM   #6
blither
Member
 
Registered: Dec 2002
Location: Ohio
Distribution: LFS, Ubuntu
Posts: 154

Original Poster
Rep: Reputation: 15
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.
 
  


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
Bootscripts checkroot.sh, bootmisc.sh gunnix Debian 6 01-11-2006 03:00 PM
hotplug-ng-002 + LFS bootscripts 3.2.2 = a complete mess :( ParticleHunter Linux From Scratch 1 07-21-2005 10:27 PM
how does one go about writing and implementing sysvinit bootscripts? behmjoe Linux - Software 2 05-02-2005 05:30 PM
SAMBA: display of share names is OK but files names are wrong superandrzej Linux - Software 5 02-02-2004 10:14 AM
Bootscripts - pause at init 3? Andrew Benton Linux From Scratch 6 01-28-2004 09:00 PM


All times are GMT -5. The time now is 06:11 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
Open Source Consulting | Domain Registration