> -----Original Message----- > From: kernelnewbies-bounce@xxxxxxxxxxxx > [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Manish Regmi > Sent: Thursday, December 02, 2004 9:12 PM > To: sumit sahu > Cc: kernelnewbies@xxxxxxxxxxxx > Subject: Re: Filesystem magic number > > On Wed, 1 Dec 2004 23:31:12 -0800 (PST), sumit sahu > <sahusumit2001@xxxxxxxxxxx> wrote: > > > > Hi People, > > > > It wud be wonderful if someone could explain how the file > system magic > > number works. Reading the book 'Understanding the Linux Kernel' I > > learnt that in order to mount the root file system the > kernel probes > > all the filesystem types which had been registered at build > time. For > > all these FS probed a call to the read_super function > specific to the > > FS is made to read the super block. But it is said that all these > > calls will fail except the one for the FS type which > actually has the > > Root FS. This they say is identified by the Filesystem > specific magic > > number. This went a way above my top floor. > > File System's Magic numbers are simply unique integers. Ext2 > File system has magic number 0xEF53 (AFAIK). > > > > Secondly, can we have the filesystem code for the Root FS > in a module > > or is it to be integrated into the kernel compulsarily? > > > > Cheers > > Sumit > > > > Yes, root file system can be compiled as a module. If the root file system is a module, it generally gets loaded from the initrd image. So when the kernel initializes and before mounting root file system, it will mount the initrd file system and runs /linuxrc ( which has insmod <modules> statements) from the root of the initrd file system which then loads the modules required for system boot inluding root file system. All the required modules will stored in the initrd image itself. Then kernel can mount root and continue booting ... Any comments ? > > -- > Manish Regmi > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/