Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

At boot time root partion is mounted at root(/), and it is known as root filesystem.

http://www.linfo.org/root_directory.html

Does it means copying rootpartition from hardisk to ram ?

Where does this mount point root(/) exists. on RAM or hardisk or swap ?

And when ever we create copy in Ram based root file system same changes will be made to backing storage like hard drive. Have i got it right ?

edit :-----

but where does directory / exist.. ? when root file system is still not mounted when we are booting .. mean to say directory root should exist some where to mount root file system .. where is that place ?

share|improve this question

migrated from stackoverflow.com Jun 11 '13 at 11:40

This question came from our site for professional and enthusiast programmers.

    
This should be asked @ unix.stackexchange.com –  Alex K Jun 11 '13 at 11:39
1  
The partition containing the root file system with all your files and directories is on your hard drive and this partition is mounted at the directory that is /. It is not mounted into RAM. Whenever a process refers to a file in that file system, a system call is made to the kernel and it will talk to the disk through a low level interface that the disk understands. –  Herman Torjussen Jun 11 '13 at 11:44
    
but where does directory / exist.. ? when root file system is still not mounted .. mean to say directory root should exist some where to mount root file system .. where is that place ? –  user6363 Jun 11 '13 at 12:13
    
The mount point / itself exists only in RAM. However, the filesystem mounted there (and thus the contents of the root directory) exist on whatever block device is mounted at that mount point. Nothing is copied into RAM. –  David Schwartz Jun 12 '13 at 10:57

2 Answers 2

up vote 3 down vote accepted

There are actually two root filesystems in most normal Linux boot processes.

The real root filesystem is located in a partition or logical volume on a physical disk - it is not loaded into RAM as a filesystem, though blocks of it will exist in cache in RAM when they have been accessed recently. Updates to this filesystem are written to disk as they happen. The root filesystem may also be on a network resource, though in this case it is usually held in a partition/volume/file on a physical disk somewhere too.

The initial root filesystem is loaded into RAM along with the kernel very early in the boot process. This is a small filesystem found in a file under /boot containing just the kernel modules/drivers, scripts, and other utilities that might be required to find, verify and mount the real root filesystem (RAID and LVM modules for instance, or NFS modules/tools if you mount root over the network). Once the real root filesystem is mounted this special "initial" one is thrown away. The initrd (which stands for INITial Ram Disk) will be rebuilt when significant changes are made, such as installing a new kernel package. It is not (usually) updated by other actions.

The above is true for most Linux installs, though it can be quite different for special cases such as some live systems on writeable CDs/DVDs or USB drives.

but where does directory / exist.. ?

It doesn't physically. Unlike other mount points which are directories in other filesystems (such as directories under /mnt or /media, though they can be practically anywhere) the mount point for / has no physical presence and is a virtual object held only in the kernel's internals. The filesystem mounted as / on the other hand is one of the two listed above - an initrd file in memory during the early boot process or a filesystem on a physical disk or network resource at other times (except, as mentioned above, in some special cases).

share|improve this answer
    
Minor nitpick: I'm pretty sure initrd stands for "initial RAM disk", and Wikipedia seems to agree. That said, this is definitely the better answer of the two thus far IMO. –  Michael Kjörling Jun 11 '13 at 18:43
    
I think you are right there Michael and I had an episode for false memory syndrome! I'll edit accordingly. –  David Spillett Jun 12 '13 at 10:21

file systems are not copied to RAM. The kernel maintains a table of mounted file systems in order to be able to find the elements of a pathname (e.g. /a/b/c) in the correct file system.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.