LinuxQuestions.org
Register a domain and help support LQ
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 12-10-2009, 06:50 PM   #1
Couling
Member
 
Registered: Oct 2007
Posts: 30

Rep: Reputation: 15
Requiremenets for a minimal Linux system


Hi. As a learning exercise I'm trying to piece together a very minimal Linux system. At the moment I keep getting a kernel panic suggesting that it can't load the root file system. I've been trying various different suggestions on which drivers I need and no joy.

It's occurred to me that some of the supporting system may be to blame and I was hoping someone might run their eyes over the following and let me know if there is anything missing or wrong with it:
(I know I will need to add more to make a useful system, I'm just after one that boots for now)


I'm using grub as the boot loader, installed in /boot/grub on the root file system. This is my menu.lst
Code:
default		0
timeout		10

title		Test Kernel build
UUID		21d65db5-00a1-4b97-1e4c-665f20a0887e
kernel		/boot/bzImage root=UUID=21d65db5-00a1-4b97-1e4c-665f20a0887e noinitrd

The Root file system itself contains very little:
Code:
/boot ... containing the kernel (bzImage)
/boot/grub ... containg the grub files
/sbin ... containing "init" (a static build of bash)
/dev ... containing the device files "null" and "console"

... and nothing else.
Any advice welcome.
Thanks
 
Old 12-10-2009, 07:19 PM   #2
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Code:
root=UUID=21d65db5-00a1-4b97-1e4c-665f20a0887e
WTF?
Surly that is wrong. Did you try root=/dev/hda1 ?
 
Old 12-11-2009, 03:04 AM   #3
Couling
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by smeezekitty View Post
WTF?
Surly that is wrong. Did you try root=/dev/hda1 ?
Yup tried that, the UUID thing was copied from Ubuntu. I switched to it in an attempt to fix this problem. But given your response it's most likely specific to the Ubuntu kernel.

For my understanding, am I right to think that "root=/dev/hda1" doesn't need me to actually have "/dev/hda1" created on my system?

Last edited by Couling; 12-11-2009 at 03:07 AM.
 
Old 12-11-2009, 03:31 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Yes, you'll need to have the hard drive devices available or you're not going to get very far (I think even if you specify the patitions by their UUID, you still need the device files). You'll probably need a few more like mem and kmem too...
 
1 members found this post helpful.
Old 12-11-2009, 10:02 AM   #5
the trooper
Senior Member
 
Registered: Jun 2006
Location: England
Distribution: Debian Jessie Amd64
Posts: 1,477

Rep: Reputation: Disabled
Is there a reason you are not using an initrd?.
 
Old 12-11-2009, 10:28 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
Quote:
At the moment I keep getting a kernel panic suggesting that it can't load the root file system.
-- Is the hardware supported by the kernel?
-- Is the memory capable enough without initrd?
-- grub>
root (hd0,0)
kernel /boot/name-of-bzImage root=/dev/sda
initrd /boot/"if-you-have".gz

Hope this helps.
 
Old 12-11-2009, 07:24 PM   #7
Couling
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by btmiller View Post
Yes, you'll need to have the hard drive devices available or you're not going to get very far ... You'll probably need a few more like mem and kmem too
Right will give that a shot then.

How does the kernel use them since the device files won't be available unti the root file system has been loaded ... wont it?

Thanks for all your help
 
Old 12-11-2009, 07:53 PM   #8
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by smeezekitty View Post
WTF?
Surly that is wrong. Did you try root=/dev/hda1 ?
Not necessarily. This is called persistent device naming. Type blkid to find out yours
 
1 members found this post helpful.
Old 12-13-2009, 05:45 AM   #9
Couling
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks that's really helpful.
Quote:
Originally Posted by ~sHyLoCk~ View Post
Not necessarily. This is called persistent device naming. Type blkid to find out yours
That page states that you need to be using initrd for persistent device naming to work so...

As suggested I've created some extra devices and used root=/dev/sda1.
This has got me one step closer but still not there. I'm now getting a panic "Attempt to kill init" but with no message from bash about why...

I replaced bash(sbin/init) with a program which simply prints out numbers starting at 0 and counting up (statically compiled). This doesn't die but doesn't print anything either.



Before I dive into kernel config again, does anyone have any suggestions about what else I've missed to cause this.

My new grub menu.lst is
Code:
default		0
timeout		10

title		Test Kernel build
root		(hd0,0)
kernel		/boot/bzImage root=/dev/sda1 ro noinitrd
My new /dev/ now contains:
Code:
brwxrwxrwx root 5, 1 console
crwxrwxrwx root 1, 2 kmem
crwxrwxrwx root 1, 1 mem
brwxrwxrwx root 1, 3 null
brwxrwxrwx root 1, 1 ram
brwxrwxrwx root 8, 0 sda
brwxrwxrwx root 8, 1 sda1
crwxrwxrwx root 5, 0 tty
crwxrwxrwx root 4, 1 tty1
crwxrwxrwx root 4, 2 tty2
crwxrwxrwx root 4, 3 tty3
crwxrwxrwx root 4, 4 tty4
crwxrwxrwx root 1, 5 zero
Thanks a lot for your time
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to build a minimal linux system leihsun Linux - Software 15 11-12-2012 05:40 PM
minimal system to run ddd 3.3.1 on a 2.4.18 linux kernel powah Linux - Software 0 01-22-2007 04:32 PM
minimal system partition sizes linmix Linux - Software 9 11-17-2004 11:48 AM
Basic (Minimal) System adriandaz Linux - Software 6 06-13-2004 03:18 PM
Minimal Linux system from current system tgardner Linux - Software 1 04-07-2003 09:37 PM


All times are GMT -5. The time now is 04:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration