LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2008, 01:04 AM   #1
East
Member
 
Registered: Jan 2008
Posts: 84

Rep: Reputation: 15
Question Help in kernel booting


hi all

I am a Linux newbie. Whne linux gets booted, it showing some messages, like Mounting root file system, Welcome to Redhat8.0, Press 'I' to interactive startup INIT: Entering runlevel 5 etc.
whether the above specified messages are in kernel code base or not. If not where it will be ?
Can anyone help me?
 
Old 02-07-2008, 02:18 AM   #2
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
These are all part of initscripts and are completely separate from the linux kernel. The linux kernel comes on line relatively quickly and once fully up, the kernel passes control off to a process called init, which then runs the initscripts. The initscripts files are in /etc/rc.d. How familiar are you with the linux file system structure and with shell scripts?

Last edited by xode; 02-07-2008 at 02:21 AM.
 
Old 02-07-2008, 02:21 AM   #3
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Welcome to Redhat8.0
There's your problem right there. This is an extreme legacy OS - 2000% unsupported. It is amazing that anything works.

But you want to know about the startup messages.

When the computer boots, it runs a string of startup scripts. The messages come from them, or from programs that they run.

start with "man boot" and work your way up.
 
Old 02-07-2008, 05:58 AM   #4
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks for the replies.
Quote:
Originally Posted by xode View Post
How familiar are you with the linux file system structure and with shell scripts?
I am new to linux. Started working in Linux environment.

Can i edit the shell scripts?
 
Old 02-07-2008, 06:41 AM   #5
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
Question

Thanks xode!

I can view the message when linux boots up in /etc/rc.d folder.
can anyone clarify the below?
In linux we have two things.
1. Kernel image
2. RAM disk image.(has the modules for booting)

a)can anyone explain what are all the things the kernel image, and RAM disk image will have?
b)can i view the modules added up in RAM disk image?
I have seen in kernel upgradation, when we type #make menuconfig, a window will be opened. Some options may selected as[*] and some options selected as [M]. SO all[*] are together as Kernel image and all [M] are together as RAM disk image. am i right?
c)Can i put the two things as a whole kernel image?
 
Old 02-07-2008, 06:58 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Here is one of many articles on initrd (the RAM-disk image). The purpose is to help the process of booting up. Some distros do not use it.

I'm sure it would be technically **possible** to create one file with the kernel and the initrd image, but WHY??????? What swamp are you trying to drain?
 
Old 02-07-2008, 07:40 AM   #7
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks pixellany!.

The reason for making all stuff into one is,
I was trying to boot a external hard disk with Linux by copying the vmlinuz-version and initrd-version.img file (these were taken from my internal hard disk). I have copied the stage1 and stage2 files and fused the grub into hard disk by using grub command.(ie root and setup)
When i was trying to boot getting error as,
kernel panic: No init found. Try Passing init= option to kernel.
What i thought is the modules are not properly loaded. If keep the both the stuffs, i think i can solve my problem. I have tried by make install_modules command to load the modules into specfied path using export command.
 
Old 02-07-2008, 08:19 AM   #8
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Let's make a couple things clear.
Drivers marked with a star * in make menuconfig will be built into the kernel image;
Drivers marked with an M will be built as modules, that is, separate files, residing in /lib/modules/... and loaded on request by the modprobe command into the running kernel;
The initrd image is somewhat of a crutch, used in situations when some driver is needed very early in the booting process, before /lib/modules is accessible, but the driver is available as a module only. And not included into the kernel image. A typical example of that is the driver for the root filesystem. If you format your / partition, say, as reiserfs, and reiserfs support is modularized in your kernel (not included into the kernel image), then to mount / you need the module, but the module is on the root filesystem, which you don't have access to before it's mounted. To avoid this, you make an initrd, that includes the necessary modules to just get your system up and running. Initrd does not have to include all modules. And the make modules_install commnad has nothing to do with the initrd image.

Now, to your specific question. Could you show the content of your menu.lst and /etc/fstab files? The problem you describe might be caused by an incorrect root= option passed to the kernel.

Last edited by Uncle_Theodore; 02-07-2008 at 08:21 AM.
 
Old 02-07-2008, 08:42 AM   #9
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
The contents of /etc/fstab file is,

LABEL=/ / ext2 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda2 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/sda1 /mnt/flash auto noauto,owner,kudzu 0 0

The menu.lst is,

# grub.conf generated by anaconda
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /boot/initrd-2.4.18-14.img


I haven't copied the menu.lst to my external hard disk. I just fused grub by typing the following commands.
#root (hd1,0)
#setup(hd1)

When reboot my system, i will unplug my internal HDD and type the below,

#kernel (hd0,0)/boot/vmlinuz-version root=/dev/hda1
#initrd (hd0,0)/boot/initrd-version.img
#boot
 
Old 02-07-2008, 11:37 AM   #10
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
Quote:
Originally Posted by East View Post
Thanks for the replies.

I am new to linux. Started working in Linux environment.

Can i edit the shell scripts?
Actually, yes. All are plain text files. But you definitely don't want to until you thoroughly know all of the internals of the linux distribution that you are using. From what you are trying to do, it might work out better for you if you just did an install of a linux distribution on your external hard drive. If space is at a premium, there are linux distributions that are quite small. Damnsmalllinux comes to mind at only 50 MB.

Regarding upgrading, I have found that it is the computer hardware and specifically the motherboard that, for the most part, drives that. The older motherboards simply aren't available anymore and the older linux distributions can't install on the newer motherboards since they can't recognize the hardware. Therefore, when an older motherboard gives out, you're pretty much forced to upgrade. I can understand why you want to continue to use an older distribution. You're familiar with its features, like its layout and so forth. You don't want to have to keep reinventing the wheel every year or so by constantly switching distributions. But, there's a way to head that off also which is run the older distribution as a virtual machine under the newer distribution. The software that I have found works best for this is vmware. For example, I still use Mandrake 9.0 and I am getting ready to fold that entire computer into a virtual machine under the new FC8 computer that I just built.
 
Old 02-07-2008, 04:53 PM   #11
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Interesting... RH8 (stated in first post) does not use a menu.lst, it uses grub.conf. Which distro is this? (I think fedora 8 uses menu.lst as a link to grub.conf.)

Anyway, if the listed file is the menu.lst from the external drive, the lines:
Code:
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
root (hd0,0)
are pointing at the wrong drive. I guess you noticed huh?
Quote:
I haven't copied the menu.lst to my external hard disk. I just fused grub by typing the following commands.
#root (hd1,0)
#setup(hd1)
# grub
grub> root (hd1,0)
grub> setup (hd1)
grub> boot

Of course, this assumes one primary partition on the external drive and only two drives overall.

It is probably simpler just to boot from the install disk with the external drive plugged in, then select it to install to. When you hit grub installation, make sure you get the right disk.
 
Old 02-07-2008, 11:15 PM   #12
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks Simon.
If i boot the system with external disk plugged in, then i do see the linux boots up from my internal disk. There i edited the grub.conf as below,

#root (hd1,0)
#setup (hd1)
#kernel (hd1,0)/boot/vmlinuz-version ro root=/dev/hdb1
#initrd (hd1,0)/boot/initrd-version.img
#boot

When the system starts boot, getting the same error as stated previously.
Currently /dev/hdb1 is mounted as /. Having /boot and /boot/grub folders into it.
/boot is having vmlinuz, inird, system.map files.
/boot/grub is having stage1 and stage2 files only.
Any other files has to be copied?
 
Old 02-07-2008, 11:32 PM   #13
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks xode.

Currently everything i am doing with VMware.(ie) i have created two virtual machine. In one i have installed the redhat 8.0 and added the another virtual machine. By copying the kernel image files only i was trying to boot the another (ie empty) virtual machine.
 
Old 02-08-2008, 03:47 AM   #14
East
Member
 
Registered: Jan 2008
Posts: 84

Original Poster
Rep: Reputation: 15
When i type make modules_install in kernel upgradation, the modules which i selected during the make menuconfig (ie selected as [M] ) are loaded into the default path (/lib/modules). By using mkinitrd command i can create a initial ramdisk image.
For eg,
mkinitrd (image file name).img kernel-version

The kernel-version what i have specified must be in lib/modules. am i right?
If i removed any of the option already selected, that module will not be loaded?
Can anyone clears my doubt?
 
Old 02-08-2008, 04:12 AM   #15
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
By copying the kernel image files only i was trying to boot the another (ie empty) virtual machine.
Oh... you are trying to store VM images on an external drive. Why not just do that?

How you do this depends on the VM software you use.
The instructions I gave you were on the assumption you wanted to boot the external drive as a native linux drive.

At this point you really need to rethink your approach. What are you trying to actually achieve by doing this? It sounds like you are trying something in a way that is far more complicated than it needs to be.

If you still want to stay with the VM approach, make sure you use the language of VMs to describe it.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Audit Support Unavaible error when booting after kernel upgrade abefroman Red Hat 2 03-21-2013 08:32 AM
Kernel Booting Slow - initramfs - Ubuntu 7.04 Kernel 2.6.20 bench Linux - Kernel 3 09-11-2007 05:14 AM
Freeze booting kernel - mdk 9.2, kernel 2.4.22-10mdk, Acer TM252LC thekro Linux - Laptop and Netbook 19 03-25-2006 04:56 AM
smp kernel: uncompressing Linux ..ok booting the kernel krissb Linux - General 1 11-16-2005 06:31 PM
booting new kernel. Booting new kernel dies with INIT: VFS issue, really mus335 Linux - General 0 04-21-2004 11:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:45 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration