4

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 ?

3
  • 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.
    – user111228
    Jun 11, 2013 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, 2013 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. Jun 12, 2013 at 10:57

2 Answers 2

7

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).

2
  • 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.
    – user
    Jun 11, 2013 at 18:43
  • I think you are right there Michael and I had an episode for false memory syndrome! I'll edit accordingly. Jun 12, 2013 at 10:21
2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .