Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Why we need a filesystem. Can we use OS without file system because our kernel has already in build module. For example if we doesn't need /lib/modules directory .So why we need file system

share|improve this question

closed as unclear what you're asking by Hauke Laging, jasonwryan, slm, Anthon, jlliagre Mar 7 at 19:56

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I will answer your question with another: How does the boot loader know where to find the kernel to load it if there is no file system? –  h3rrmiller Mar 7 at 18:14
1  
@h3rrmiller man lilo –  Hauke Laging Mar 7 at 18:32
2  
Even the most simplistic disk organisation can be assimilated to a filesystem ... and *nix systems are based on files ! –  Ouki Mar 7 at 18:34
    
You seem to be asking unrelated things. Even if you build your kernel with filesystems builtin (i.e. not as a module), you will need a file system for the operating system itself. –  Renan Mar 7 at 18:35

2 Answers 2

Why we need a filesystem .Can we use OS without file system bacuese our kernel has already in build module. For example if we does't need /lib/modules directory .So why we need file system

Even if you could get it to work this way, it would be pointless. What would the kernel do and why/how would it be doing it?

The first thing the kernel does is start init, which is a userland executable residing on a filesystem, even if that filesystem is just from a compressed ramdisk. After that, the kernel waits to take directions from userspace. If init never starts, then the kernel will be waiting for instructions that never come.

share|improve this answer

The concept of a file is core to the way Linux/Unix works, many things which are not files in the classic sense that perhaps a document is considered to be. A file has a much broader sense under Unix/Linux in that in represent a range of hardware devices and other system internals which can be read from and/or written to. It allows programs to create file descriptors to have communication with such internals using the same read and write system calls, instead of the array of different calls found on other systems.

An example of the system internals include files under /proc (proc is considered a type of filesystem), many of the files here allow processes to get information on themselves or other running processes. Another (on Linux) is /sys (filesystem type sysfs), where files are more orientated toward hardware/driver states etc. Also the is /dev (on linux this is usually a devtmpfs filesystem) where files allow direct read/write communication with hardware such as disks and serial ports.

That said there are various ways that a system can run without a filesystem on disk. it is possible to have a diskless system where the everything that is needed to boot comes from a network. Application binaries can be stored in a temporary filesystem in memory, rather than on disk, just as all the filesystems previously mentioned can be purely in memory (this is always the case for /proc and /sys. Still however the concept of a filesystem is a necessary for Unix/Linux as the concept of a file itself.

share|improve this answer

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