LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help in kernel booting (https://www.linuxquestions.org/questions/linux-newbie-8/help-in-kernel-booting-619262/)

East 02-07-2008 01:04 AM

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?

xode 02-07-2008 02:18 AM

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?

Simon Bridge 02-07-2008 02:21 AM

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.

East 02-07-2008 05:58 AM

Thanks for the replies.
Quote:

Originally Posted by xode (Post 3048775)
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?

East 02-07-2008 06:41 AM

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?

pixellany 02-07-2008 06:58 AM

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?

East 02-07-2008 07:40 AM

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.

Uncle_Theodore 02-07-2008 08:19 AM

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.

East 02-07-2008 08:42 AM

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

xode 02-07-2008 11:37 AM

Quote:

Originally Posted by East (Post 3048964)
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.

Simon Bridge 02-07-2008 04:53 PM

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.

East 02-07-2008 11:15 PM

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?

East 02-07-2008 11:32 PM

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.

East 02-08-2008 03:47 AM

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?

Simon Bridge 02-08-2008 04:12 AM

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.


All times are GMT -5. The time now is 01:54 AM.