Does the Linux kernel need a file system to run?How pipes work in LinuxDoes Android really use the same kernel as Linux?How to configure Linux to cache file metadata in preference to contents?File system that never breaks (data loss acceptable)When do I need to specify add_efi_memmap as kernel argument in UEFI/EFI boot?What files does the Linux kernel access?Root file system vs partition's file systemWhat parts of the Linux kernel I do not need?Linux/Embedded Linux - Understanding the Kernel and additional BSP specific componentsHow do I run the Linux kernel?Why does the Linux kernel build system use incremental linking or ar T thin archives?

Is it possible to do 50 km distance without any previous training?

Adding span tags within wp_list_pages list items

strToHex ( string to its hex representation as string)

What do you call a Matrix-like slowdown and camera movement effect?

Why, historically, did Gödel think CH was false?

How does one intimidate enemies without having the capacity for violence?

What typically incentivizes a professor to change jobs to a lower ranking university?

Is this a crack on the carbon frame?

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Mathematical cryptic clues

What do the dots in this tr command do: tr .............A-Z A-ZA-Z <<< "JVPQBOV" (with 13 dots)

tikz: show 0 at the axis origin

Have astronauts in space suits ever taken selfies? If so, how?

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

Prove that NP is closed under karp reduction?

Did Shadowfax go to Valinor?

Font hinting is lost in Chrome-like browsers (for some languages )

Why do I get two different answers for this counting problem?

Minkowski space

Why does Kotter return in Welcome Back Kotter?

Modeling an IPv4 Address

Why do falling prices hurt debtors?

"to be prejudice towards/against someone" vs "to be prejudiced against/towards someone"

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?



Does the Linux kernel need a file system to run?


How pipes work in LinuxDoes Android really use the same kernel as Linux?How to configure Linux to cache file metadata in preference to contents?File system that never breaks (data loss acceptable)When do I need to specify add_efi_memmap as kernel argument in UEFI/EFI boot?What files does the Linux kernel access?Root file system vs partition's file systemWhat parts of the Linux kernel I do not need?Linux/Embedded Linux - Understanding the Kernel and additional BSP specific componentsHow do I run the Linux kernel?Why does the Linux kernel build system use incremental linking or ar T thin archives?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








19















My opinion is yes, it does, because all useful exposure to the outside world (non-priviledged processor mode) would first require a process running in the outside world. That would require a file system, even a temporary, in-RAM, file system.



Another engineer disagrees with me, but I can't seem to prove this beyond all (unknown to me) cases.



Does the answer to this question depend on the definition of 'running'?










share|improve this question

















  • 4





    i think that a running kernel does not "require" useful exposure to the outside world

    – jsotola
    Mar 21 at 23:28







  • 19





    Brings to mind the old halted Linux firewall (circa 2002)

    – Jeff Schaller
    Mar 22 at 0:50






  • 1





    If you add new code to the kernel, you can do anything. If you can't, it will initialize fine up to the point where it tries to run init (the first user-space process), and that will fail.

    – immibis
    Mar 22 at 6:44






  • 1





    Define "run"...

    – Thorbjørn Ravn Andersen
    Mar 22 at 11:49











  • Read operating system: three easy pieces

    – Basile Starynkevitch
    Mar 22 at 12:03

















19















My opinion is yes, it does, because all useful exposure to the outside world (non-priviledged processor mode) would first require a process running in the outside world. That would require a file system, even a temporary, in-RAM, file system.



Another engineer disagrees with me, but I can't seem to prove this beyond all (unknown to me) cases.



Does the answer to this question depend on the definition of 'running'?










share|improve this question

















  • 4





    i think that a running kernel does not "require" useful exposure to the outside world

    – jsotola
    Mar 21 at 23:28







  • 19





    Brings to mind the old halted Linux firewall (circa 2002)

    – Jeff Schaller
    Mar 22 at 0:50






  • 1





    If you add new code to the kernel, you can do anything. If you can't, it will initialize fine up to the point where it tries to run init (the first user-space process), and that will fail.

    – immibis
    Mar 22 at 6:44






  • 1





    Define "run"...

    – Thorbjørn Ravn Andersen
    Mar 22 at 11:49











  • Read operating system: three easy pieces

    – Basile Starynkevitch
    Mar 22 at 12:03













19












19








19


4






My opinion is yes, it does, because all useful exposure to the outside world (non-priviledged processor mode) would first require a process running in the outside world. That would require a file system, even a temporary, in-RAM, file system.



Another engineer disagrees with me, but I can't seem to prove this beyond all (unknown to me) cases.



Does the answer to this question depend on the definition of 'running'?










share|improve this question














My opinion is yes, it does, because all useful exposure to the outside world (non-priviledged processor mode) would first require a process running in the outside world. That would require a file system, even a temporary, in-RAM, file system.



Another engineer disagrees with me, but I can't seem to prove this beyond all (unknown to me) cases.



Does the answer to this question depend on the definition of 'running'?







filesystems linux-kernel






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 22:43









Peter L.Peter L.

20126




20126







  • 4





    i think that a running kernel does not "require" useful exposure to the outside world

    – jsotola
    Mar 21 at 23:28







  • 19





    Brings to mind the old halted Linux firewall (circa 2002)

    – Jeff Schaller
    Mar 22 at 0:50






  • 1





    If you add new code to the kernel, you can do anything. If you can't, it will initialize fine up to the point where it tries to run init (the first user-space process), and that will fail.

    – immibis
    Mar 22 at 6:44






  • 1





    Define "run"...

    – Thorbjørn Ravn Andersen
    Mar 22 at 11:49











  • Read operating system: three easy pieces

    – Basile Starynkevitch
    Mar 22 at 12:03












  • 4





    i think that a running kernel does not "require" useful exposure to the outside world

    – jsotola
    Mar 21 at 23:28







  • 19





    Brings to mind the old halted Linux firewall (circa 2002)

    – Jeff Schaller
    Mar 22 at 0:50






  • 1





    If you add new code to the kernel, you can do anything. If you can't, it will initialize fine up to the point where it tries to run init (the first user-space process), and that will fail.

    – immibis
    Mar 22 at 6:44






  • 1





    Define "run"...

    – Thorbjørn Ravn Andersen
    Mar 22 at 11:49











  • Read operating system: three easy pieces

    – Basile Starynkevitch
    Mar 22 at 12:03







4




4





i think that a running kernel does not "require" useful exposure to the outside world

– jsotola
Mar 21 at 23:28






i think that a running kernel does not "require" useful exposure to the outside world

– jsotola
Mar 21 at 23:28





19




19





Brings to mind the old halted Linux firewall (circa 2002)

– Jeff Schaller
Mar 22 at 0:50





Brings to mind the old halted Linux firewall (circa 2002)

– Jeff Schaller
Mar 22 at 0:50




1




1





If you add new code to the kernel, you can do anything. If you can't, it will initialize fine up to the point where it tries to run init (the first user-space process), and that will fail.

– immibis
Mar 22 at 6:44





If you add new code to the kernel, you can do anything. If you can't, it will initialize fine up to the point where it tries to run init (the first user-space process), and that will fail.

– immibis
Mar 22 at 6:44




1




1





Define "run"...

– Thorbjørn Ravn Andersen
Mar 22 at 11:49





Define "run"...

– Thorbjørn Ravn Andersen
Mar 22 at 11:49













Read operating system: three easy pieces

– Basile Starynkevitch
Mar 22 at 12:03





Read operating system: three easy pieces

– Basile Starynkevitch
Mar 22 at 12:03










3 Answers
3






active

oldest

votes


















25














That's rather an odd question because you don't run the kernel like you run a program. The kernel is a platform to run programs on. Of course there is setup and shutdown code but it's not possible to run the kernel on its own. There must always be a main "init" process. And the kernel will panic if it's not there. If init tries to exit the kernel will also panic.



These days the init process is something like systemd. If not otherwise specified the kernel will try to run a program from a list of locations starting with /sbin/init. See the init Param here http://man7.org/linux/man-pages/man7/bootparam.7.html in an emergency you can boot Linux with init=/bin/bash . But notice how you always specify a file on the file system to run.



So the kernel will panic if it starts up an has no file system because without one there is no way to load init.



Some confusion may arise because of a chicken and egg situation where the kernel must load drivers to access it's file system. To get round this an initial ramdisk is loaded from an image on disk containing vital drivers and setup scripts. These are executed before the file system is loaded. But make no mistake the initial ramdisk is itself a file system. With an initial ramdisk /init is called (which is stored on the initial ramdisk). In many distributions it is ultimately this which calls /sbin/init. Again without a file system, this is impossible.






share|improve this answer

























  • Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

    – Peter L.
    Mar 22 at 0:40






  • 1





    @PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

    – muru
    Mar 22 at 2:04






  • 3





    Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

    – forest
    Mar 22 at 5:37











  • @forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

    – Uncle Billy
    Mar 22 at 8:48






  • 1





    @IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

    – Charles Duffy
    Mar 22 at 17:23



















14














The answer is going to depend on whether you literally mean without a file system or if the question is intended to be interpreted a little different from how it is actually stated. The answers for slight variations in how the question is interpreted are:



  • Running Linux without any block devices is entirely feasible and useful for some specialized use cases.

  • Running Linux without any file system is going to require rewriting some parts of the kernel code and it's unlikely to be a useful effort.

  • Running Linux without using any file descriptors is going to require a lot of effort. I'm pretty sure that's not going to be worth the effort.

The reasons you'd have to rewrite parts of the kernel code to make a working system without a file system are:



  • Every thread has a root directory and a current working directory which must point to some file system.

  • Programs are started by the execve system call which needs an executable from a file system.

  • The kernel creates a memory based file system during the boot process.

After a program has been started using execve it is possible for it to unmap the executable from which it was started, though in order to do so it without immediately crashing it first have to create an executable memory mapping which isn't backed by a file, and it has to initialize that with some useful code before jumping to it and unmapping the executable.



Thus a running user mode program can exist in a state where it has no memory mappings backed by files and it can close all file descriptors backed by files. It cannot stop having a root directory and current working directory, but it can refrain from those.



So though in this state you could implement kernel code to rip the file system away from under the program and have it keep running, it doesn't sound like it's useful. And getting into that final state without going through an intermediate state of using a file system is going to be even more work for no useful benefit.



A useful setup for some specialized use cases



Avoiding the use of block devices can be useful. During boot the kernel creates a memory file system, and it can also populate that file system with contents from a cpio archive before executing init. That way you can run a system entirely from a memory based file system without any block device to back it.



This can be useful for systems where you don't want to preserve any state and like the system to start from a clean slate upon rebooting.



Of course the kernel and cpio archive have to get somehow exist in memory before the kernel is given control. How they got there is a job for the boot loader. The boot loader could have loaded those from a block device even though the final running system doesn't use block devices. But it's also possible for the boot loader to acquire the kernel and cpio archive without using a block device for example by booting over the network.






share|improve this answer


















  • 1





    The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

    – Peter L.
    Mar 22 at 14:58







  • 1





    @PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

    – kasperd
    Mar 22 at 22:11


















3














In Linux, every device is a file, so you have to have a filesystem to run it.






share|improve this answer


















  • 8





    But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

    – Philip Couling
    Mar 22 at 0:09






  • 6





    Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

    – Ruslan
    Mar 22 at 4:35






  • 1





    This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

    – forest
    Mar 22 at 5:34












  • @forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

    – Uncle Billy
    Mar 22 at 9:11






  • 1





    Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

    – pmf
    Mar 22 at 14:47











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507837%2fdoes-the-linux-kernel-need-a-file-system-to-run%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









25














That's rather an odd question because you don't run the kernel like you run a program. The kernel is a platform to run programs on. Of course there is setup and shutdown code but it's not possible to run the kernel on its own. There must always be a main "init" process. And the kernel will panic if it's not there. If init tries to exit the kernel will also panic.



These days the init process is something like systemd. If not otherwise specified the kernel will try to run a program from a list of locations starting with /sbin/init. See the init Param here http://man7.org/linux/man-pages/man7/bootparam.7.html in an emergency you can boot Linux with init=/bin/bash . But notice how you always specify a file on the file system to run.



So the kernel will panic if it starts up an has no file system because without one there is no way to load init.



Some confusion may arise because of a chicken and egg situation where the kernel must load drivers to access it's file system. To get round this an initial ramdisk is loaded from an image on disk containing vital drivers and setup scripts. These are executed before the file system is loaded. But make no mistake the initial ramdisk is itself a file system. With an initial ramdisk /init is called (which is stored on the initial ramdisk). In many distributions it is ultimately this which calls /sbin/init. Again without a file system, this is impossible.






share|improve this answer

























  • Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

    – Peter L.
    Mar 22 at 0:40






  • 1





    @PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

    – muru
    Mar 22 at 2:04






  • 3





    Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

    – forest
    Mar 22 at 5:37











  • @forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

    – Uncle Billy
    Mar 22 at 8:48






  • 1





    @IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

    – Charles Duffy
    Mar 22 at 17:23
















25














That's rather an odd question because you don't run the kernel like you run a program. The kernel is a platform to run programs on. Of course there is setup and shutdown code but it's not possible to run the kernel on its own. There must always be a main "init" process. And the kernel will panic if it's not there. If init tries to exit the kernel will also panic.



These days the init process is something like systemd. If not otherwise specified the kernel will try to run a program from a list of locations starting with /sbin/init. See the init Param here http://man7.org/linux/man-pages/man7/bootparam.7.html in an emergency you can boot Linux with init=/bin/bash . But notice how you always specify a file on the file system to run.



So the kernel will panic if it starts up an has no file system because without one there is no way to load init.



Some confusion may arise because of a chicken and egg situation where the kernel must load drivers to access it's file system. To get round this an initial ramdisk is loaded from an image on disk containing vital drivers and setup scripts. These are executed before the file system is loaded. But make no mistake the initial ramdisk is itself a file system. With an initial ramdisk /init is called (which is stored on the initial ramdisk). In many distributions it is ultimately this which calls /sbin/init. Again without a file system, this is impossible.






share|improve this answer

























  • Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

    – Peter L.
    Mar 22 at 0:40






  • 1





    @PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

    – muru
    Mar 22 at 2:04






  • 3





    Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

    – forest
    Mar 22 at 5:37











  • @forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

    – Uncle Billy
    Mar 22 at 8:48






  • 1





    @IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

    – Charles Duffy
    Mar 22 at 17:23














25












25








25







That's rather an odd question because you don't run the kernel like you run a program. The kernel is a platform to run programs on. Of course there is setup and shutdown code but it's not possible to run the kernel on its own. There must always be a main "init" process. And the kernel will panic if it's not there. If init tries to exit the kernel will also panic.



These days the init process is something like systemd. If not otherwise specified the kernel will try to run a program from a list of locations starting with /sbin/init. See the init Param here http://man7.org/linux/man-pages/man7/bootparam.7.html in an emergency you can boot Linux with init=/bin/bash . But notice how you always specify a file on the file system to run.



So the kernel will panic if it starts up an has no file system because without one there is no way to load init.



Some confusion may arise because of a chicken and egg situation where the kernel must load drivers to access it's file system. To get round this an initial ramdisk is loaded from an image on disk containing vital drivers and setup scripts. These are executed before the file system is loaded. But make no mistake the initial ramdisk is itself a file system. With an initial ramdisk /init is called (which is stored on the initial ramdisk). In many distributions it is ultimately this which calls /sbin/init. Again without a file system, this is impossible.






share|improve this answer















That's rather an odd question because you don't run the kernel like you run a program. The kernel is a platform to run programs on. Of course there is setup and shutdown code but it's not possible to run the kernel on its own. There must always be a main "init" process. And the kernel will panic if it's not there. If init tries to exit the kernel will also panic.



These days the init process is something like systemd. If not otherwise specified the kernel will try to run a program from a list of locations starting with /sbin/init. See the init Param here http://man7.org/linux/man-pages/man7/bootparam.7.html in an emergency you can boot Linux with init=/bin/bash . But notice how you always specify a file on the file system to run.



So the kernel will panic if it starts up an has no file system because without one there is no way to load init.



Some confusion may arise because of a chicken and egg situation where the kernel must load drivers to access it's file system. To get round this an initial ramdisk is loaded from an image on disk containing vital drivers and setup scripts. These are executed before the file system is loaded. But make no mistake the initial ramdisk is itself a file system. With an initial ramdisk /init is called (which is stored on the initial ramdisk). In many distributions it is ultimately this which calls /sbin/init. Again without a file system, this is impossible.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 26 at 22:53

























answered Mar 22 at 0:08









Philip CoulingPhilip Couling

2,5211123




2,5211123












  • Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

    – Peter L.
    Mar 22 at 0:40






  • 1





    @PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

    – muru
    Mar 22 at 2:04






  • 3





    Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

    – forest
    Mar 22 at 5:37











  • @forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

    – Uncle Billy
    Mar 22 at 8:48






  • 1





    @IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

    – Charles Duffy
    Mar 22 at 17:23


















  • Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

    – Peter L.
    Mar 22 at 0:40






  • 1





    @PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

    – muru
    Mar 22 at 2:04






  • 3





    Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

    – forest
    Mar 22 at 5:37











  • @forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

    – Uncle Billy
    Mar 22 at 8:48






  • 1





    @IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

    – Charles Duffy
    Mar 22 at 17:23

















Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

– Peter L.
Mar 22 at 0:40





Isn't there a condition where the kernel gives up trying to initialize hardware and load a known file system (not initrd passed into the kernel via init params), then drops into a very limited shell (without init=/bin/bash)? Also, since you bring up /bin/bash, would the kernel always have that minimal file system available, even if it was built with other .config options that could potentially eliminate this?

– Peter L.
Mar 22 at 0:40




1




1





@PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

– muru
Mar 22 at 2:04





@PeterL. that limit shell is some shell from the initrd/initramfs/whatever that kernel booted with, IIRC.

– muru
Mar 22 at 2:04




3




3





Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

– forest
Mar 22 at 5:37





Note that you can build the initramfs (a CPIO archive that is extracted into a ramfs or tmpfs filesystem) into the kernel. Whether or not that counts as the kernel "needing a filesystem" is up to you, since it means you can boot the kernel and nothing but the kernel and have a functional (if a bit limited) system. Also note that, even if you patch the kernel to no longer require an init, it will still create internal virtual filesystems that are never exposed.

– forest
Mar 22 at 5:37













@forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

– Uncle Billy
Mar 22 at 8:48





@forest The system doesn't have to be "limited" -- you can pack systemd and gnome into your initrd (together with stuff which is actually useful ;-)). One limitation of initramfs was (still is?) that it wasn't supporting extended attributes -- I did work around it on android by including an ext4 image in the initrd cpio archive which was then mounted as a loop device from the init.$DEV.rc script.

– Uncle Billy
Mar 22 at 8:48




1




1





@IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

– Charles Duffy
Mar 22 at 17:23






@IsmaelMiguel, nope, an initramfs as such is a cpio archive. Squashfs is a good choice for embedded filesystems, and one could make an initrd (vs an initramfs) that uses it (the terms are often used interchangably but they're not quite the same thing), but it's not the format Linux unpacks into its initramfs. (Indeed, a squashfs image doesn't need to be unpacked before it can be used at all; it's properly indexed).

– Charles Duffy
Mar 22 at 17:23














14














The answer is going to depend on whether you literally mean without a file system or if the question is intended to be interpreted a little different from how it is actually stated. The answers for slight variations in how the question is interpreted are:



  • Running Linux without any block devices is entirely feasible and useful for some specialized use cases.

  • Running Linux without any file system is going to require rewriting some parts of the kernel code and it's unlikely to be a useful effort.

  • Running Linux without using any file descriptors is going to require a lot of effort. I'm pretty sure that's not going to be worth the effort.

The reasons you'd have to rewrite parts of the kernel code to make a working system without a file system are:



  • Every thread has a root directory and a current working directory which must point to some file system.

  • Programs are started by the execve system call which needs an executable from a file system.

  • The kernel creates a memory based file system during the boot process.

After a program has been started using execve it is possible for it to unmap the executable from which it was started, though in order to do so it without immediately crashing it first have to create an executable memory mapping which isn't backed by a file, and it has to initialize that with some useful code before jumping to it and unmapping the executable.



Thus a running user mode program can exist in a state where it has no memory mappings backed by files and it can close all file descriptors backed by files. It cannot stop having a root directory and current working directory, but it can refrain from those.



So though in this state you could implement kernel code to rip the file system away from under the program and have it keep running, it doesn't sound like it's useful. And getting into that final state without going through an intermediate state of using a file system is going to be even more work for no useful benefit.



A useful setup for some specialized use cases



Avoiding the use of block devices can be useful. During boot the kernel creates a memory file system, and it can also populate that file system with contents from a cpio archive before executing init. That way you can run a system entirely from a memory based file system without any block device to back it.



This can be useful for systems where you don't want to preserve any state and like the system to start from a clean slate upon rebooting.



Of course the kernel and cpio archive have to get somehow exist in memory before the kernel is given control. How they got there is a job for the boot loader. The boot loader could have loaded those from a block device even though the final running system doesn't use block devices. But it's also possible for the boot loader to acquire the kernel and cpio archive without using a block device for example by booting over the network.






share|improve this answer


















  • 1





    The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

    – Peter L.
    Mar 22 at 14:58







  • 1





    @PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

    – kasperd
    Mar 22 at 22:11















14














The answer is going to depend on whether you literally mean without a file system or if the question is intended to be interpreted a little different from how it is actually stated. The answers for slight variations in how the question is interpreted are:



  • Running Linux without any block devices is entirely feasible and useful for some specialized use cases.

  • Running Linux without any file system is going to require rewriting some parts of the kernel code and it's unlikely to be a useful effort.

  • Running Linux without using any file descriptors is going to require a lot of effort. I'm pretty sure that's not going to be worth the effort.

The reasons you'd have to rewrite parts of the kernel code to make a working system without a file system are:



  • Every thread has a root directory and a current working directory which must point to some file system.

  • Programs are started by the execve system call which needs an executable from a file system.

  • The kernel creates a memory based file system during the boot process.

After a program has been started using execve it is possible for it to unmap the executable from which it was started, though in order to do so it without immediately crashing it first have to create an executable memory mapping which isn't backed by a file, and it has to initialize that with some useful code before jumping to it and unmapping the executable.



Thus a running user mode program can exist in a state where it has no memory mappings backed by files and it can close all file descriptors backed by files. It cannot stop having a root directory and current working directory, but it can refrain from those.



So though in this state you could implement kernel code to rip the file system away from under the program and have it keep running, it doesn't sound like it's useful. And getting into that final state without going through an intermediate state of using a file system is going to be even more work for no useful benefit.



A useful setup for some specialized use cases



Avoiding the use of block devices can be useful. During boot the kernel creates a memory file system, and it can also populate that file system with contents from a cpio archive before executing init. That way you can run a system entirely from a memory based file system without any block device to back it.



This can be useful for systems where you don't want to preserve any state and like the system to start from a clean slate upon rebooting.



Of course the kernel and cpio archive have to get somehow exist in memory before the kernel is given control. How they got there is a job for the boot loader. The boot loader could have loaded those from a block device even though the final running system doesn't use block devices. But it's also possible for the boot loader to acquire the kernel and cpio archive without using a block device for example by booting over the network.






share|improve this answer


















  • 1





    The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

    – Peter L.
    Mar 22 at 14:58







  • 1





    @PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

    – kasperd
    Mar 22 at 22:11













14












14








14







The answer is going to depend on whether you literally mean without a file system or if the question is intended to be interpreted a little different from how it is actually stated. The answers for slight variations in how the question is interpreted are:



  • Running Linux without any block devices is entirely feasible and useful for some specialized use cases.

  • Running Linux without any file system is going to require rewriting some parts of the kernel code and it's unlikely to be a useful effort.

  • Running Linux without using any file descriptors is going to require a lot of effort. I'm pretty sure that's not going to be worth the effort.

The reasons you'd have to rewrite parts of the kernel code to make a working system without a file system are:



  • Every thread has a root directory and a current working directory which must point to some file system.

  • Programs are started by the execve system call which needs an executable from a file system.

  • The kernel creates a memory based file system during the boot process.

After a program has been started using execve it is possible for it to unmap the executable from which it was started, though in order to do so it without immediately crashing it first have to create an executable memory mapping which isn't backed by a file, and it has to initialize that with some useful code before jumping to it and unmapping the executable.



Thus a running user mode program can exist in a state where it has no memory mappings backed by files and it can close all file descriptors backed by files. It cannot stop having a root directory and current working directory, but it can refrain from those.



So though in this state you could implement kernel code to rip the file system away from under the program and have it keep running, it doesn't sound like it's useful. And getting into that final state without going through an intermediate state of using a file system is going to be even more work for no useful benefit.



A useful setup for some specialized use cases



Avoiding the use of block devices can be useful. During boot the kernel creates a memory file system, and it can also populate that file system with contents from a cpio archive before executing init. That way you can run a system entirely from a memory based file system without any block device to back it.



This can be useful for systems where you don't want to preserve any state and like the system to start from a clean slate upon rebooting.



Of course the kernel and cpio archive have to get somehow exist in memory before the kernel is given control. How they got there is a job for the boot loader. The boot loader could have loaded those from a block device even though the final running system doesn't use block devices. But it's also possible for the boot loader to acquire the kernel and cpio archive without using a block device for example by booting over the network.






share|improve this answer













The answer is going to depend on whether you literally mean without a file system or if the question is intended to be interpreted a little different from how it is actually stated. The answers for slight variations in how the question is interpreted are:



  • Running Linux without any block devices is entirely feasible and useful for some specialized use cases.

  • Running Linux without any file system is going to require rewriting some parts of the kernel code and it's unlikely to be a useful effort.

  • Running Linux without using any file descriptors is going to require a lot of effort. I'm pretty sure that's not going to be worth the effort.

The reasons you'd have to rewrite parts of the kernel code to make a working system without a file system are:



  • Every thread has a root directory and a current working directory which must point to some file system.

  • Programs are started by the execve system call which needs an executable from a file system.

  • The kernel creates a memory based file system during the boot process.

After a program has been started using execve it is possible for it to unmap the executable from which it was started, though in order to do so it without immediately crashing it first have to create an executable memory mapping which isn't backed by a file, and it has to initialize that with some useful code before jumping to it and unmapping the executable.



Thus a running user mode program can exist in a state where it has no memory mappings backed by files and it can close all file descriptors backed by files. It cannot stop having a root directory and current working directory, but it can refrain from those.



So though in this state you could implement kernel code to rip the file system away from under the program and have it keep running, it doesn't sound like it's useful. And getting into that final state without going through an intermediate state of using a file system is going to be even more work for no useful benefit.



A useful setup for some specialized use cases



Avoiding the use of block devices can be useful. During boot the kernel creates a memory file system, and it can also populate that file system with contents from a cpio archive before executing init. That way you can run a system entirely from a memory based file system without any block device to back it.



This can be useful for systems where you don't want to preserve any state and like the system to start from a clean slate upon rebooting.



Of course the kernel and cpio archive have to get somehow exist in memory before the kernel is given control. How they got there is a job for the boot loader. The boot loader could have loaded those from a block device even though the final running system doesn't use block devices. But it's also possible for the boot loader to acquire the kernel and cpio archive without using a block device for example by booting over the network.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 22 at 11:28









kasperdkasperd

2,66011129




2,66011129







  • 1





    The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

    – Peter L.
    Mar 22 at 14:58







  • 1





    @PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

    – kasperd
    Mar 22 at 22:11












  • 1





    The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

    – Peter L.
    Mar 22 at 14:58







  • 1





    @PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

    – kasperd
    Mar 22 at 22:11







1




1





The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

– Peter L.
Mar 22 at 14:58






The question is if a Linux kernel in any built configuration (without re-writing anything) can 'run' without any file system. It does not have to do anything useful or preserve a state. From all of the answers, I'm understanding that some sort of file system is provided and assumed within the kernel itself, at least until shutdown. Even '/' is a file system. So, I think to simplify the answer it is 'yes'.

– Peter L.
Mar 22 at 14:58





1




1





@PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

– kasperd
Mar 22 at 22:11





@PeterL. Yes, if you don't rewrite anything Linux will require a file system. When people talk about practical uses for Linux without a file system they would usually be referring to those backed by a block device and you can run Linux without a file system backed by a block device. You'd still have some sort of file system.

– kasperd
Mar 22 at 22:11











3














In Linux, every device is a file, so you have to have a filesystem to run it.






share|improve this answer


















  • 8





    But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

    – Philip Couling
    Mar 22 at 0:09






  • 6





    Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

    – Ruslan
    Mar 22 at 4:35






  • 1





    This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

    – forest
    Mar 22 at 5:34












  • @forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

    – Uncle Billy
    Mar 22 at 9:11






  • 1





    Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

    – pmf
    Mar 22 at 14:47















3














In Linux, every device is a file, so you have to have a filesystem to run it.






share|improve this answer


















  • 8





    But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

    – Philip Couling
    Mar 22 at 0:09






  • 6





    Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

    – Ruslan
    Mar 22 at 4:35






  • 1





    This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

    – forest
    Mar 22 at 5:34












  • @forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

    – Uncle Billy
    Mar 22 at 9:11






  • 1





    Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

    – pmf
    Mar 22 at 14:47













3












3








3







In Linux, every device is a file, so you have to have a filesystem to run it.






share|improve this answer













In Linux, every device is a file, so you have to have a filesystem to run it.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 21 at 22:45









K7AAYK7AAY

1,0221028




1,0221028







  • 8





    But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

    – Philip Couling
    Mar 22 at 0:09






  • 6





    Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

    – Ruslan
    Mar 22 at 4:35






  • 1





    This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

    – forest
    Mar 22 at 5:34












  • @forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

    – Uncle Billy
    Mar 22 at 9:11






  • 1





    Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

    – pmf
    Mar 22 at 14:47












  • 8





    But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

    – Philip Couling
    Mar 22 at 0:09






  • 6





    Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

    – Ruslan
    Mar 22 at 4:35






  • 1





    This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

    – forest
    Mar 22 at 5:34












  • @forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

    – Uncle Billy
    Mar 22 at 9:11






  • 1





    Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

    – pmf
    Mar 22 at 14:47







8




8





But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

– Philip Couling
Mar 22 at 0:09





But of course the device drivers exist inside the kernel irrespective of whether or not a device file points to them.

– Philip Couling
Mar 22 at 0:09




6




6





Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

– Ruslan
Mar 22 at 4:35





Not every device is a file. Network interfaces (eth0, wlan0 etc.) aren't, for example.

– Ruslan
Mar 22 at 4:35




1




1





This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

– forest
Mar 22 at 5:34






This is a common misconception. While in theory, everything is a file in UNIX and UNIX-like systems, it is only completely true for highly specialized systems like Plan 9 (though it is far more true than for Windows). For Linux, quite a few things are not files. This is getting more and more true as many drivers have begun to use netlink rather than ioctls on character devices (which are files).

– forest
Mar 22 at 5:34














@forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

– Uncle Billy
Mar 22 at 9:11





@forest Plan 9 is not a "highly specialized" system -- it was supposed to be a general purpose system like Unix or windows (why it failed at replacing Unix and remained a research system is a completely different story). Anyways, just as Linux, plan9 is exposing virtualized interfaces to its hardware (and doesn't have any ioctls -- I don't see how using netlink vs ioctls factor in all this), even if it strives to be more consistent (eg. the network interfaces are accessible via the filesystem). With the introduction of namespaces, Linux is already more like plan9 than classic unix.

– Uncle Billy
Mar 22 at 9:11




1




1





Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

– pmf
Mar 22 at 14:47





Very nice argument: either there's devfs, which is a filesystem per definition, or there's no devfs, in which case you need a filesystem to host device nodes ...

– pmf
Mar 22 at 14:47

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507837%2fdoes-the-linux-kernel-need-a-file-system-to-run%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Lowndes Grove History Architecture References Navigation menu32°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661132°48′6″N 79°57′58″W / 32.80167°N 79.96611°W / 32.80167; -79.9661178002500"National Register Information System"Historic houses of South Carolina"Lowndes Grove""+32° 48' 6.00", −79° 57' 58.00""Lowndes Grove, Charleston County (260 St. Margaret St., Charleston)""Lowndes Grove"The Charleston ExpositionIt Happened in South Carolina"Lowndes Grove (House), Saint Margaret Street & Sixth Avenue, Charleston, Charleston County, SC(Photographs)"Plantations of the Carolina Low Countrye

random experiment with two different functions on unit interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Random variable and probability space notionsRandom Walk with EdgesFinding functions where the increase over a random interval is Poisson distributedNumber of days until dayCan an observed event in fact be of zero probability?Unit random processmodels of coins and uniform distributionHow to get the number of successes given $n$ trials , probability $P$ and a random variable $X$Absorbing Markov chain in a computer. Is “almost every” turned into always convergence in computer executions?Stopped random walk is not uniformly integrable

How should I support this large drywall patch? Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How do I cover large gaps in drywall?How do I keep drywall around a patch from crumbling?Can I glue a second layer of drywall?How to patch long strip on drywall?Large drywall patch: how to avoid bulging seams?Drywall Mesh Patch vs. Bulge? To remove or not to remove?How to fix this drywall job?Prep drywall before backsplashWhat's the best way to fix this horrible drywall patch job?Drywall patching using 3M Patch Plus Primer