'What is the exact relationship between partitions, fiel systems and the kernel in Linux?
I'm coming from the Windows world and trying understand how exactly partitions, file systems and the kernel in Linux work together. If someone can tell me if my understanding is correct, that would be awesome:
- A partition can contain one or no Linux kernel, but never multiple kernels
- The bootloader decides which kernel from which partition will be loaded and what will be the root file system (= partition mounted at "/")
Now lets assume we have a PC with one disk, containing two partitions (partition A and partition B). Each partition stores another Linux kernel (kernel A and kernel B), and each partition uses another file system (file system A and file system B):
- After loading one kernel, Linux can always see and access both partitions (e.g. by using fdisk -l).
- If kernel A is loaded, file system A will be the root file system, if kernel B is loaded, file system B will be the root file system.
- If kernel A is loaded with root file system A, it is possible to mount partition B with file system B into file system A.
Additional questions:
What actually tells the kernel which file system is the root fs? Is this information stored in the bootloader section of the disk, or even the kernel itself?
Generally spoken, how does Linux know which file system belongs to which partition on the disk?
Thanks for your help!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
