Could someone explain how different folders in linux are connected?

There a lot of interesting stuff like /arch, /security, /samples, /crypto and etc.
Where do this files "go" after compilation?
For example I use Ubuntu. If there any chance to find them in /usr or /sys folders?


Most of it ends up in the kernel, vmlinuz-... typically in /boot, or in modules in /lib/modules, with one sub-directory per kernel version. Some of the tools in the tools directory end up elsewhere, e.g. perf. Most of the directories you mention are simply parts of the kernel, organised in various ways: architecture-specific code in arch, crypto code in crypto, etc. There's also build infrastructure which is only used during the build.

  • I have never compiled linux from source that's probably why I don't understand kernel structure... So. Linux starts not in the 'kernel' folder, but in the root folder of git repo, right? But I still can't understand why there so many folders. Is there any need to add filesystems like xfs and ufs (in the fs folder)? – shegeley Dec 3 '16 at 18:28
  • @ГригорийШепелев Yes there's a need for xfs and ufs, people do use those filesystems. UFS, for example, is widely used on *BSD systems, so it is useful for Linux to be able to read UFS partitions. When you compile Linux from source you can disable any filesystems you don't think you'll need. – DepressedDaniel Dec 3 '16 at 18:42
  • @DepressedDaniel ok. But there is no ZFS. Is that because it's not like «the classical one»? – shegeley Dec 3 '16 at 19:13
  • That's because ZFS isn't part of the Linux kernel. Some kernel "drivers" (or modules) are separate projects: ZFS, proprietary GPU drivers such as AMD's Catalyst and NVIDIA's drivers, exFAT... – Stephen Kitt Dec 3 '16 at 19:26
  • @ГригорийШепелев It's because the (Open)ZFS license is not compatible with GPLv2 (or, at least, because the folks at the FSF say so). However, Ubuntu includes ZFS as of 16.04. – DepressedDaniel Dec 3 '16 at 20:49

You didnt find any linux kernel files on /usr and /sys.You should extract linux kernel source code in /usr/src After compiled linux kernel.You should make modules and install it.config, sysmap,vmlinuz and initrd stored in /boot and all modules stored in .. /lib/modules based on linux kernel release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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