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?

  • Phoenixz@lemmy.ca
    link
    fedilink
    arrow-up
    12
    ·
    12 hours ago

    Yes, you can design your own filesystem format and make a driver for that and use it on your computer

    It would be insanity, but you could.

    Basically: Filesystems are hard to make. Really really hard.

  • rdri@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    10 hours 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
    9
    ·
    19 hours ago

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

  • JumpyWombat@lemmy.ml
    link
    fedilink
    arrow-up
    24
    ·
    1 day 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.

  • StarvingMartist@sh.itjust.worksOP
    link
    fedilink
    English
    arrow-up
    43
    ·
    1 day ago

    This is why I love Lemmy, I can ask this obscure, unrealistic question, and people will still answer it with the “yeah you probably shouldn’t but here’s how you could”

  • Spost@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    94
    ·
    1 day ago

    You can! All of those filesystems you mentioned were created by people, and you can do it just the same way. It is, however, quite a lot of work to get something as good as any of those, let alone better. You’ve also hit on one of the problems - nothing else is going to support your filesystem.

    If you’re interested in trying anyway, just out of curiosity, do a little research into FUSE, Filesystem in Userspace. FUSE is a tool that lets you write a filesystem without needing to integrate with the very low-level parts of the operating system, which takes some burden off of your implementation.

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    1 day ago

    That’s how those filesystems came into existence: someone designed them.

    Yes, you can write your own filesystem, and use it on your own drives.

    Yes, you will continue to be able to use other filesystems, unless you intentionally remove them from the system.

  • zxqwas@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    1 day ago

    Yeah you could. Noone else could would bother to use your usb/hdd/ssd with your file system unless you gave them the drivers.

  • Arthur Besse@lemmy.ml
    link
    fedilink
    English
    arrow-up
    23
    ·
    edit-2
    1 day 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.

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    19
    ·
    edit-2
    1 day 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.

  • Darohan@lemmy.zip
    link
    fedilink
    arrow-up
    18
    ·
    1 day ago

    Yes, but it would probably be a multi-decade, career-defining project if you want it to be any good. It would likely work with all files since it’s all just data once you get to the FS level anyway, but other devices would need an appropriate driver (that you would also need to write) in order to use it.

    Note that I’m not an expert in this field, so others should correct me if I’ve got something wrong here.

    • jonne@infosec.pub
      link
      fedilink
      arrow-up
      10
      ·
      1 day ago

      Also, once you finish your filesystem, don’t murder your wife or otherwise people will stop using it.

    • StarvingMartist@sh.itjust.worksOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      1 day ago

      Oh don’t worry, knowing me, I would create it, use it for a single drive and never touch it again. Its the fun of creation that counts. Also, I quite like my wife.

      • TranquilTurbulence@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        19 hours ago

        Doesn’t have to be world changing or even practical. A project like that would still teach you a ton about storage hardware, how file systems work, programming, mathematics etc. Some of these lessons could even be useful, but above all, a project like this should be fun and interesting.

        Why do you think people install Linux and run Doom on all the weirdest hardware they can find. This is the spirit that drives innovation.

        Don’t let expectations hold you back. Make your own FS, and have fun.