LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-21-2003, 11:09 AM   #16
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0

and how do i edi the init? is that using the GRUB?

when i next get my init not found problem then i will try this.

I know it will happen, just a matter of when.

BTW in the above post, that is the details of my WORKING system. If & When it goes down, no doubt i will be back here.
 
Old 03-21-2003, 12:50 PM   #17
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
When you see the grub menu (just after switching on), select the entry (linux) and press 'e'. With the cursor, select the line where the kernel entry is (probably the first line) and press 'e' again and you'll be able to write stuff on this line. Move the cursor to the end of the line and type the init=/dev/hdx entry.

Grub may complain as it boots but it will certainly stop the append init message and kernel panic and will boot as normal.

Actually, if you recompile the kernel (which I recommend when you feel more confident), you have to append init= because most people don't use the initrd image.

This happened to me because one day, for no reason my system wouldn't boot and just hung after this init message. The solution is easy enough when you know what it means and what to do about it.

If you really don't like grub, you can use lilo but this problem is not about grub, it really about the way redhat 8.0 boots.

Q*Bert
 
Old 03-21-2003, 06:20 PM   #18
hiren_a
LQ Newbie
 
Registered: Mar 2003
Location: London
Distribution: Rehat 8.0 - latest pkgs.
Posts: 12

Original Poster
Rep: Reputation: 0
ahh finaly a solution i understand, thankyou kindly.
 
Old 03-21-2003, 06:25 PM   #19
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
You're welcome

tecchie point: BTW, the swap partition doesn't get 'corrupted'. The term 'corrupted' means different things to different people, but if it means 'unusable', well that's a hardware issue and nothing to do with linux. The swap space is just a temporary holding space for "pages" of memory which don't need to be handled straight away by RAM, and Windows uses it too (albeit not as well).

Last edited by Q*Bert; 03-21-2003 at 06:43 PM.
 
Old 03-21-2003, 10:00 PM   #20
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
Q*Bert,

I think you have the kernel parameters a little reversed. The parameter that you are looking for is root=/dev/hdax, not init=. It shouldn't screw up your machine, and may even boot, but it definately won't do what you want.

root= is the device to mount as / when you are done booting the kernel.

initrd= "initial RAM disk" is a boot loader (GRUB, LILO) parameter that loads a special filesystem into memory for the kernel, that is mounted before / (root=) is mounted. This allows kernel modules to be loaded before we mount /.

init= is the parameter that tells the kernel what program to load to start all the other programs you expect of Linux. The default is /sbin/init, but others are tried as well. init is a special program.

See BootPrompt HOWTO, specifically section 3. It probably explains it better. Redhat also has a description of the boot process that may help hiren_a understand the boot process a little.

hiren_a,
Hopefully your filesystem won't get borked again, but you can try a 'init=/bin/sh' to boot to a shell. You'll need a bunch of incantations to fix the system, but you get guru points

Hope that helps,
chris

P.S. If you have a decent knowledge of Linux, read what Al Viro did to recover a running system: http://www.sekure.net/docs/alviro.html. Scary indeed.
 
Old 03-22-2003, 02:02 AM   #21
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Ok i had had enough
Q*bert telling that init=/dev/hdax works!!
and bastard23 telling about swap what i exactly said before
ok
i will add only one or two things
thanks bastard23 for telling about the init
i will add here what does this init means
when your kernel boots up
it looks at the file /etc/inittab and load up the bootup scripts
(usually /etc/rc.sysinit)
so as said you can boot into a minimum system
with init=/bin/bash
or init=/bin/sh
or if you prefer to go to a particular runlevel
append the number of the runlevel
example to go to runlevel one(single user)
kernel vmlinuz root=/dev/hdax single(securitywise you should not allow other users to boot into your system with a different runlevel ;it is unsafe;example:you can change your root password with this)
for safe boot (example you have devfsd but devfsd=mount and devfsd=nomount does not work or you accidently destroyed your inittab file)
just use init=/bin/sh
and manually add these files
I hope that this is the last post in this thread

Last edited by rch; 03-22-2003 at 02:43 AM.
 
Old 03-22-2003, 03:38 AM   #22
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
Quote:
Originally posted by bastard23
Q*Bert,

I think you have the kernel parameters a little reversed. The parameter that you are looking for is root=/dev/hdax, not init=. It shouldn't screw up your machine, and may even boot, but it definately won't do what you want.

root= is the device to mount as / when you are done booting the kernel.

initrd= "initial RAM disk" is a boot loader (GRUB, LILO) parameter that loads a special filesystem into memory for the kernel, that is mounted before / (root=) is mounted. This allows kernel modules to be loaded before we mount /.

init= is the parameter that tells the kernel what program to load to start all the other programs you expect of Linux. The default is /sbin/init, but others are tried as well. init is a special program.

See BootPrompt HOWTO, specifically section 3. It probably explains it better. Redhat also has a description of the boot process that may help hiren_a understand the boot process a little.

hiren_a,
Hopefully your filesystem won't get borked again, but you can try a 'init=/bin/sh' to boot to a shell. You'll need a bunch of incantations to fix the system, but you get guru points

Hope that helps,
chris
No. This won't help at all. You've obviously never actually tried appending root=/dev/hdx. Go on. Try it. That will work with LILO but not grub because GRUB counts drives differently.

If you append root (hd0,x) that will work but please look these things up or try them out first without confusing everyone. The init= is not a GRUB command but the kernel needs it, if the initrd (hd0,x) parameter is missing.

GRUB and LILO are different!

rch, you've not tried that either! You have to tell GRUB which disk and which partition and the only way GRUB understands that is the (hd0,x) notation.

Come on guys, look this stuff up first. I know you know this already.

Q*Bert
 
Old 03-22-2003, 09:11 AM   #23
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Quote:
No. This won't help at all. You've obviously never actually tried appending root=/dev/hdx. Go on. Try it. That will work with LILO but not grub because GRUB counts drives differently.
Q*bert I have been using Linux since 1999 and i have appended root=/dev/hdax (or hdb,c,d)x hundreds if not thousand of times
Quote:
If you append root (hd0,x) that will work but please look these things up or try them out first without confusing everyone. The init= is not a GRUB command but the kernel needs it, if the initrd (hd0,x) parameter is missing.
GRUB and LILO are different!
Agreed!
when you append init to the boot cmdline
you are not appending thinking it is lilo/loadlin or grub
if you are interested check out /var/log/dmesg
do a less dmesg|grep cmdline
Quote:
rch, you've not tried that either! You have to tell GRUB which disk and which partition and the only way GRUB understands that is the (hd0,x) notation.
see info grub
for grub notation
grub does not understand hda(b,c,d)x notation but the kernel only understands this
to check this
do a
cat /boot/grub/menu.lst
or
cat /boot/grub/grub.conf
there the entries must be something like this
title blah blah
root (hd0,x) ;this is for grub
kernel /boot/vmlinuz root=/dev/hdax <options>;this is for the kernel; you can append something here like init=/bin/bash
similarly you can append your kernel option by presssing a in the grub screen
it shows you the kernel command line
Quote:
Come on guys, look this stuff up first. I know you know this already.
Q*Bert
Q*Bert plz read the documentation of grub
ie
either
info grub
or
pinfo grub
 
Old 03-23-2003, 01:38 PM   #24
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
Quote:
Originally posted by rch
Q*bert I have been using Linux since 1999 and i have appended root=/dev/hdax (or hdb,c,d)x hundreds if not thousand of times
Then you might not know that the way you have done it won't boot on many systems.
Quote:
Originally posted by rch
grub does not understand hda(b,c,d)x notation but the kernel only
I never said it does understand this. You made that up. I said it understands hd(0,x). Please don't misquote me.
Quote:
Originally posted by rch
root (hd0,x)
kernel /boot/vmlinuz root=/dev/hdax <options>
Unless you tell grub specifically where the kernel is, as follows:
root hd(0,2)
kernel hd(0,1)/boot/vmlinuz root hd(0,1) init=/dev/hda2
then it won't work on many systems. (or is your logic "well it works on mine") ... ?
Quote:
Q*Bert plz read the documentation of grub
No. You go and read the online documentation on this topic and get back to me.
I really don't care about who is right or wrong, but you're not happy about being wrong in this case.
Please go away, do a masters degree in computing, get Linux certification and then tell me I'm wrong. But not before then.

Oh, and quit gracefully.

Q*Bert
 
Old 03-24-2003, 12:55 AM   #25
rch
Member
 
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 909

Rep: Reputation: 48
Q*Bert I may be wrong and i accept that using linux since 1999 means nothing at all,neither the fact that i have been using linux in my all university projects (i don't have linux certification and will never go for those stupid things)
i may have made mistakes
you asked me to "quit gracefully"
maybe you are wrong (give a thought)
see a sample grub.conf file here
http://www.linux.org/docs/ldp/howto/...OWTO/proc.html
as far as init is concerned i know about init
see man bootparam
or try this page
http://man.linuxquestions.org/index....ction=0&type=2
anyway as i said i don't know many things and i agree that i may have made mistakes but i know that i am right this time
ok now i "quit gracefully"

Last edited by rch; 03-24-2003 at 05:30 AM.
 
Old 03-24-2003, 01:44 AM   #26
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
you can use..

mkswap

to format a swap partition
 
Old 03-24-2003, 09:25 AM   #27
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
Well, if I'm wrong as you say then so is the GNU documentation. And they wrote the software. I can appreciate that only some people would consider getting certification, yes. My solution is more concise and works on all platforms, with all disk configurations, but yours works only on some, rch, which is why the solution to hiren_a's (remember hiren_a?) problem was exactly what I offered.

Maybe you're not happy that your solution didn't work, but it really doesn't matter and bickering gives the forum and Linux a bad name, so I'm not entertaining you any more.

Q*Bert
 
Old 03-24-2003, 05:06 PM   #28
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
Sorry to keep this thread alive, but 'init=/dev/hdax' is just the wrong thing, use 'root=/dev/hdax'. I believe that everything in my previous post is correct. I was talking about the kernel parameters, and only mentioned the boot loaders in respect to 'initrd='. (I'm now pretty sure that the kernel ignores initrd= and will only look at the 'noinitrd' option for kernels that support using an initrd image).

Here are some code snippets that process the kernel options. I've change the indentation a little and will use ... to mark where I've cut the code.
Code:
linux-2.4.19/init/main.c: about line 254, where init= gets processed by parse_options().
        ...
        if (!strncmp(line,"init=",5)) {
              line += 5;
              execute_command = line;
              /* In case LILO is going to boot us with default command line,
              * it prepends "auto" before the whole cmdline which makes
              * the shell think it should execute a script with such name.
              * So we ignore all arguments entered _before_ init=... [MJ]
              */
              args = 0;
              continue;
        }
        if (checksetup(line))
               continue;
        ...
So we are saving the 'init=' argument to execute_command. checksetup(line) processes all the other options. These are setup by the __setup(char *, * function) macro. Browse around to see the other options, especially do_mounts.c.

Then at the end of main.c, the last thing done by the kernel while booting is execute the "init" process (pid 1).
Code:
linux-2.4.19/init/main.c:init(): about line 565.
...
        /*
         * We try each of these until one succeeds.
         *
         * The Bourne shell can be used instead of init if we are
         * trying to recover a really broken machine.
         */

        if (execute_command)
              execve(execute_command,argv_init,envp_init);
        execve("/sbin/init",argv_init,envp_init);
        execve("/etc/init",argv_init,envp_init);
        execve("/bin/init",argv_init,envp_init);
        execve("/bin/sh",argv_init,envp_init);
        panic("No init found.  Try passing init= option to kernel.");
}
Here is where the init=/sbin/init (or /bin/bash, or /root/myinit.pl, or such) gets used to execute the first userland program. Since init=/dev/hda1 will fail (unless it contains a valid executable, not a filesystem), it tries the default "/sbin/init".

Q*Bert,
I don't understand what you are trying to do with these GRUB commands.

root hd(0,2)

What is on /dev/hda3? Has GRUB stopped using 0 based partition numbers? (It has been awhile since I used it.) It doesn't look like you need the root command, because you explicitly tell GRUB where the kernel is below. I have never booted a "Multiboot" OS on my PC, but I think that the GRUB "root" command has more significance there, not Linux.

kernel hd(0,1)/boot/vmlinuz root hd(0,1) init=/dev/hda2

'root hd(0,1)' on the kernel cmdline is not valid for the Linux kernel. I don't think that GRUB cleanses this command line, but like I said, it's been awhile. The kernel is probably ignoring this. Since you don't seem to be using a boot partition (could be wrong here, is /boot/boot/vmlinuz around once you boot.), nor INITRD , you could try this instead:

find /boot/vmlinuz # This will verify that the kernel is on hd(0,1) aka /dev/hda2, or not.
root hd(0,1)
kernel /boot/vmlinuz root=/dev/hda2
--or if you root partition is really /dev/hda3 (you're using a boot partition)--
root hd(0,1)
kernel /boot/vmlinuz root=/dev/hda3
-- or not use root hd(x,x) at all --
kernel (0,1)/boot/vmlinuz root=/dev/hda2

Quote:
No. This won't help at all. You've obviously never actually tried appending root=/dev/hdx. Go on. Try it. That will work with LILO but not grub because GRUB counts drives differently.
"The rest of the line is passed verbatim as the kernel command-line." From http://www.gnu.org/manual/grub/html_...el.html#kernel. Grub understands hd(0,1), but doesn't understand /dev/hda2. Yes, root= is on the kernel command line, not GRUB's. The kernel doesn't understand hd(0,1), but does understand /dev/hda2.

Hopefully this gives more detail/explicitness on my previous explaination of the kernel command options. I can go over the processing of root= as well, but my post is long enough, and all of this is documented else were, or the source is easy to read.
More references:
'man 4 initrd'
<kernel src>/Documentation/kernel-parameters.txt
<kernel src>/Documentation/i386/boot.txt
<kernel src>/init/*.c
http://www.gnu.org/manual/grub/html_...ml#GNU%2fLinux and the commands section of the manual.

Have fun,
chris
 
Old 03-24-2003, 06:15 PM   #29
Q*Bert
Member
 
Registered: Feb 2003
Location: Birmingham, UK
Distribution: Redhat 8.0, Immunix 7.0 a few others
Posts: 222

Rep: Reputation: 30
Grub definitely understands (hdx,y) where x is the IDE disk and y is the partition on the IDE disk.

Grub definitely doesn't understand root=/dev/hdx where hdx is the location of the root partition, although the kernel might use it if you append it (just like the kernel understands hdb=ide-scsi which is also not a grub command). If you look at the kernel documentation, it is always assumed that you're using LILO in which case it's unimportant.

If your initrd, boot or root partition are different you have to tell grub explicitly where they are and the only way grub understands partitions is the (hdx,y) - I think we're saying the same thing there though.

I have too much fun that's my trouble.
 
Old 03-24-2003, 06:40 PM   #30
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
Yup,
my only quibble has been the 'init=' stuff. 'root=' definately works. If you build your own kernel, the build tools will setup / to be what ever it is currently. Use 'rdev /boot/vmlinuz' to see.

Oops, in my post above
kernel (0,1)/boot/vmlinuz root=/dev/hda2
should be
kernel hd(0,1)/boot/vmlinuz root=/dev/hda2

May the Force (R) be with you,
chris
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd happenings after Kernel Compile on Fedora claudius753 Linux - Software 3 12-31-2004 11:24 PM
Kernel panic puts me in a panic theeeg Linux - Software 2 07-31-2004 04:46 PM
ALSA, KDE 3.2, Kernel 2.6 and a wierd problem cccc828 Slackware 2 03-05-2004 07:21 AM
kernel panic (narius panic) narius Linux - Newbie 3 06-20-2002 03:56 PM
Kernel panic making me panic! Linux_N0oby Linux - Software 19 05-29-2002 12:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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