NTFS, fat32, exfat, could I theoretically create my own filesystem? If so would my computer even be able to work with most files or connect to other devices?

  • JumpyWombat@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    Building a filesystem essentially means linking a directory of filenames to physical blocks and handling CRUD operations. It’s not that hard. The hard part comes when you go beyond the basics to build something efficient with useful features. For example, fast access, journaling and fragmentation are all challenging topics. You can try without messing with the kernel by creating an in-memory filesystem (essentially a block of RAM) and playing with the I/O.

  • Arthur Besse@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    16 days ago

    NTFS, fat32, exfat, could I theoretically create my own filesystem?

    Yes. There are many different file systems and you can absolutely create your own. Making one that is reliable and performs well, and/or is something you can actually use for the disk that you boot from, generally involves low-level kernel programming and years of work - and is not exactly a beginner’s programming project.

    However, you can also more easily play with implementing filesystems in a high-level language using FUSE.

    If so would my computer even be able to work with most files or connect to other devices?

    Your computer can use many different filesystems at the same time. You can also store a filesystem in a file on another filesystem, rather than dedicating a partition of a physical disk to it. So, yes, you can use a filesystem of your own design at the same time you are using other storage devices formatted with more common filesystems.

  • FreedomAdvocate@lemmy.net.au
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    15 days ago

    Of course you theoretically could - someone made those existing ones, didn’t they? Now getting something else to read it, that’s the bigger issue.

    The bigger issue still is you having the knowledge and ability to do it.

  • Xatolos@reddthat.com
    link
    fedilink
    arrow-up
    0
    ·
    14 days ago

    Everyone answered the first part, so as for connecting to other devices, that’s a part of communication protocols which doesn’t concern about what file system you use.

    Bluetooth will work with others as long as you have Bluetooth connection protocols, Internet uses TCP/IP, LANs use Ethernet, etc…

  • rdri@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    While you are at it, might concentrate on defects of certain fs you don’t like. Personally I hate the NTFS path length limit. XFS handles it much better overall but individual file names are much more limited because nobody thought about Unicode.

    Also you could probably fork some fs like XFS.

  • stoly@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    People have and do, but the effort is ridiculous and requires some very high-level computer science or computer engineering skills.

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    15 days ago

    Lots of good answers, especially using FUSE for experimentation. One thing I’ll add is that if you just didn’t want to use any filesystem at all … you don’t have to!

    At least in the Unix realm, a disk drive is just a bunch of contiguous blocks, and you can put whatever you want in them. Of course, Unix itself famously needs a filesystem for itself, but if you want to just store all your giant binary blobs – cryptocurrency block chain? – directly onto a drive without the pesky overhead or conveniences of a filesystem, that’s doable.

    It’s not generally a useful idea to treat a disk drive as though it’s a tape drive, but it does work. And going further into that analogy, you can use “tar” to collect multiple files and fit them onto the drive, since a tarball preserves file metadata and the borders between files, but not much else. This is the original use of tar – “tape archive” – for storing Unix files onto tape, because the thought of using tape as working storage with a filesystem was – and still is – a terrible idea. And that’s basically the original impetus for a filesystem: it’s better than linear access media.

  • FuglyDuck@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    15 days ago

    I mean, short answer is… yes…

    But, eh, like. That’s a technicality. Chances are the task is something beyond typical individuals these days.

    • TranquilTurbulence@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      15 days ago

      But we’re on Lemmy, and that comes with a huge selection bias. In fact, you don’t really find that many typical individuals here. A significant part of the population here uses Linux as a hobby, does something technical for a living. Possibly both!

      I really don’t think it’s that far fetched to imagine that it’s possible to find someone in here who has the time, energy, enthusiasm, patience knowledge and intelligence to build a new file system. I’m pretty sure you can also find more than one person capable of writing their own drivers or libraries.

      • FuglyDuck@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        15 days ago

        sure. But it’s a task that usually takes entire teams of highly competent and experienced people. Computer science, software engineering. Database management, lots of math.

        Like ext4 took contributions from several orgs and numerous individuals over the course of years to develop. if a single person can do it, it’s the work of a lifetime.

        • litchralee@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          0
          ·
          15 days ago

          I wish to advocate in the name of DIY minimalism. That is to say, it’s true that none of us – Linus Torvalds is not in the room, right? – can hope to churn out anything approaching a full-blown filesystem on the order of ext4 or NTFS if we worked our entire lives. But if those filesystems were the end-all-be-all of innovation in those spaces, the richness and intrigue of computer science would have died out long ago, relegated to only the pinnacle of engineers and no one else.

          But I feel like that can’t quite be the case, because all engineering is about achieving careful balances. And as fine as ext4 is, it must be said that it’s anything but minimal. It’s full-featured, which also implies that it might have more than what any one person requires. If OP wants to write a very compact filesystem designed for 8-bit microprocessors, I can’t badger them with ext4’s existence, because that’s not going to be usable on an 8 bit machine.

          Much like how Python includes a really tiny HTTP server, and we can all agree that it’s order of magnitudes less sophisticated than nginx, such implementations can have their time in the sun. And I think a tiny, absurdly minimal, almost code-golf of a filesystem, might have a place in this world, if OP really wants to undertake that effort.

          Computer science, I wish to believe, still has doors awaiting exploration.

          • FuglyDuck@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            ·
            15 days ago

            Computer science, I wish to believe, still has doors awaiting exploration.

            There was a time where you could grab a walking stick, a cloak, and a pack and go see things no other human has ever recorded seeing; and then that exploration was done and we needed boats or whatever vehicle to get there. Then the boats had to get bigger, and had to be powered by wind rather than oar, then we had to go down, into the depths of the oceans, or up into the vastness of space. We still haven’t explored all of the ocean, seen everything this world has to see.

            with each new horizon, there is a new place to explore. a new richness to discover.

            This is true, also, of computer science; and all sorts of other frontiers.

            I’m not trying to disuade the OP or anyone else. Even if they’re never even close to successful; it’s their time to spend. if they enjoy the work; then by all means. It’s more of a warning… it’s not the kind of thing that’s going to be a weekend project. (“There be dragons,”)

            • TranquilTurbulence@lemmy.zip
              link
              fedilink
              English
              arrow-up
              0
              ·
              15 days ago

              Reminds me of something a coworker once told me. If you had a time machine and went back to the year 1825, there would be an absurd amount of basic chemistry you could discover. Some of it doesn’t even require any fancy equipment, but if you had a proper lab at your disposal, you could become famous in no time.

                • TranquilTurbulence@lemmy.zip
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  edit-2
                  14 days ago

                  Don’t introduce anything too radical, so no tunneling electron microscopes just yet. However, you should be able to use empirical science to debunk BS ideas and move things along that way.

                  For example, the phlogiston idea was proven wrong in the 1770s when people started burning metals and realized their mass increased in the process. Also, certain compounds can release oxygen, which can maintain a flame in an otherwise empty container. Sounds simple to us now, but back in those days, it was revolutionary.

                  The idea is that you have to work within the framework available at the time.

        • FooBarrington@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          15 days ago

          A guy is currently doing this with bcachefs.

          He’s also making life very hard for himself by being arrogant and terrible at communication, but that’s a different story.

          • a Kendrick fan@lemmy.ml
            link
            fedilink
            arrow-up
            0
            ·
            15 days ago

            He’s also making life very hard for himself by being arrogant and terrible at communication

            Isn’t he just trying to do things his ways?

  • black_flag@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    If you just want to do it for the fuck of it look at how old simple filesystems like FAT12 work and implement them in whatever high-level programming language you’re most comfortable, maybe with FUSE as others have suggested since there are beginner-level tutorials for that.

  • Agent641@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    15 days ago

    A guy on YouTube literally made a physical floppy disk from scratch so I dont see why not.

    Someone make the Lolcats programming language for a laugh.