[PLUG] Linux kernel ties to the filesystem

Derek Loree drl at drloree.com
Sat Nov 15 01:46:01 UTC 2003


On Fri, 2003-11-14 at 10:32, Ed Sawicki wrote:
> The Linux kernel makes certain assumptions about the filesystem
> directory hierarchy. For example, it assumes that there's a
> /dev directory (let's ignore devfs). Obviously it knows about
> the root (/). I'm wondering what other assumptions _it_ makes.
> Note that I'm not talking about daemons or init.

I have to admit, that the line between kernel control and init control
is a little fuzzy in my mind.  But...
> 
> Does the kernel know about /lib or is there another mechanism
> that tells the kernel about it?

Only that the modules are kept there.  If the kernel needs a module to
finish booting (say IDE for instance), it could read it from there. 
>From my understanding though, this is where an initrd image must be
incorporated into the boot cycle.  This image is a compressed file
system of the information that the kernel needs to load modules for
devices that could become the root of the file system.  The boot loader
is responsible for knowing the location of the initrd image.  I haven't
tried to mount an initrd image, so I really don't know what the kernel
sees in them.
> 
> Is there anything in /etc that the kernel is aware of?

Well, if the root designation in /etc/fstab is screwed up, the kernel
will panic and the boot process can not proceed.  Seems like a kernel
dependency to me.

If LVM is enabled in the kernel, it will need to be able to see
/etc/raidtab.  

That is all that I can think of.
> 
> What about /var?

The kernel boot info is written to several files, but I have a feeling
that information is stored in a buffer until something can be done with
it.  On my system, a daemon called "bootlogd" is the first one started,
and then it is stopped at the end of the second runlevel.  Actually, a
start command is used to "stop-bootlogd".
> 
> I know this is a difficult question given all the functionality
> in the Linux kernel these days.

Compared to some other OS's, this is very simple.

I hope that at least sparks some conversation.

Derek Loree






More information about the PLUG mailing list