LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 01-25-2012, 09:55 AM   #1
Mayurapriyan
LQ Newbie
 
Registered: Jan 2012
Posts: 12

Rep: Reputation: Disabled
Path of root file system


Hi,
In the process of booting up of linux system,my understanding is root file system is loaded on the top of kernel.Is this understanding correct? If so, how kernel knows where the root file system is? Can we change the path where it takes the root file system from?

Any help will be appreciated.

thanks and regards
nishanth
 
Old 01-25-2012, 10:20 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,533
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
The root file system is not loaded on top of the kernel, it is mounted by the kernel according to the entry for / in /etc/fstab
 
Old 01-25-2012, 10:36 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,517
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
Quote:
Originally Posted by catkin View Post
The root file system is not loaded on top of the kernel, it is mounted by the kernel according to the entry for / in /etc/fstab
Not quite right, if I understand it right. The kernel is not mounting the / partition. The bootloader gives the root= option to the kernel, which determines the partition where the kernel is looking for init. Then init takes over and, after loading the necessary kernel modules if needed, does the mounting stuff.
 
Old 01-25-2012, 11:24 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,533
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Thanks for the correction TobiSGD

More specifically init reads /etc/inittab which directs it to run boot scripts. The first boot script runs mount which uses /etc/fstab to determine what to mount at /

AFAIK (not sure) the kernel root option tells the kernel where to find the file system containing the files it needs during boot including /etc/inittab, the mount command and /etc/fstab. Normally the same as define in /etc/fstab but may not need to be?
 
Old 01-25-2012, 03:02 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,517
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
Quote:
Originally Posted by catkin View Post
AFAIK (not sure) the kernel root option tells the kernel where to find the file system containing the files it needs during boot including /etc/inittab, the mount command and /etc/fstab. Normally the same as define in /etc/fstab but may not need to be?
No. The kernel will run no other program than init at boot time. The root= option has two purposes:
1. Tell the kernel were to find init (in fact it seeks on several places in the specified filesystem for init or initrc). This is not needed when using an initrd.
2. Tell init which is the root partition. Without that info init wouldn't either be able to find /etc/inittab nor to mount the partitions specified in /etc/fstab, since it wouldn't find those files. This is at least needed when using an initrd, I am not sure if it is needed when running without it.

SInce you are running Slackware, just have a look at the init-script in /boot/init-tree after making a initrd for your generic kernel. This will give you a basic idea what actually happens before the / partition and all others are mounted and the init-script invokes the "real" init from the harddisk to do the stuff like starting services, etc.

Last edited by TobiSGD; 01-25-2012 at 03:06 PM.
 
1 members found this post helpful.
Old 01-26-2012, 07:23 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,533
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Thanks TobiSGD

I should have been more explicit and written "the kernel root option tells the kernel's init process where to find ...", yes?
 
  


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
i cannot copy a file to a folder in file system with my root account realbezo Linux - Newbie 4 03-03-2009 10:45 PM
how to add a file to a zip, without including the entire path from root marvelade Linux - Newbie 6 02-19-2009 05:32 AM
System hangs on boot - "Mounting root file system" fails with Via VT6410 enabled Eagleorn Linux - Hardware 3 09-21-2006 12:58 PM
System envoirment (for exampe DISPLAY, PATH) originated from which file in linux ? stewchcken Linux - General 1 08-07-2005 12:46 PM
Boot Error: Root file system /dev/root adtomar Linux - Networking 0 12-27-2004 10:50 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration