| Post Reply | RetroFed Forum Forum Index » linuxmemes |
| Author | Message | ||
|---|---|---|---|
Potato Lover 💾 No brain found
lemmy.sdf.org
user224@lemmy.sdf.orgJoined: 2023-06-17 |
I feel like an idiot realizing block devices are just... block devices. But with multiple files it starts to become a problem. A-ha! I can just write files to partitions just the same to make reading them simpler.
I don't know if it's the limitation of GPT, but fdisk let's me theoretically get up to 2^32^ partitions (default is 2^7^). In practice, this will be lower.
Right now I just did it manually. Check file size, divide by sector size, add one if remainder, make partition of that number of sectors, name partition, write partition table, copy file with dd and repeat. But I should try to automate this. It could be a bash script, but I want to learn C beyond basics, so I guess I should try writing it in that. Anyway, hundreds of files and partitions can't be processed by hand any easier. |
||
| 271 Original | |||
Skullgrid
lemmy.world
Skullgrid@lemmy.worldJoined: 2023-06-29 |
|
||
| 64 | |||
|
UnfortunateShort
lemmy.world
UnfortunateShort@lemmy.world Joined: 2023-06-19 |
Sooooo... File systems are really just a large file, huh? I could just put a JSON with byte arrays there instead and no one would know... It is kinda obvious, but I never thought about generalizing it this way either |
||
| 26 | |||
|
Spice Hoarder
lemmy.zip
spicehoarder@lemmy.zip Joined: 2025-06-29 |
Hmm very interesting. That makes sense, but now I have more questions. Like what the fuck is file a system actually? Like I know what it is, and I know the features of a lot of the popular ones, but like what is it ACTUALLY? |
||
| 16 | |||
|
BartyDeCanter
piefed.social
BartyDeCanter@piefed.social Joined: 2026-05-02 |
Hmm very interesting. That makes sense, but now I have more questions. Like what the fuck is file a system actually? Like I know what it is, and I know the features of a lot of the popular ones, but like what is it ACTUALLY?
If you really want to know, I highly recommend reading Piratical File System Design with the Be FS - Dominic Giampalo as a free PDF. It goes into enough detail that you absolutely can write a modern filesystem based on just what is in it, including good diagrams and code snippets, but it doesn't just have page after page of code to wade through. It's a surprisingly enjoyable read. If you don't know, Dominic is the author of the Be FS (obviously) but ended up at Apple and was a lead in their filesystem team for two decades. He also has the most perfect minimal personal webpage I've seen in a long time. I've developed two filesystems, and am working on a third. I wish I had read that book before I started on my first one. |
||
| 28 | |||
|
BartyDeCanter
piefed.social
BartyDeCanter@piefed.social Joined: 2026-05-02 |
Sooooo... File systems are really just a large file, huh? I could just put a JSON with byte arrays there instead and no one would know... It is kinda obvious, but I never thought about generalizing it this way either
A drive is just an addressed linear memory space, like RAM, though with physical characteristics that you need to be aware of if you're designing a useful file system. The real difficulty is that the address space is huge, and you can't trust that data that you write it won't get cut off in mid write or get some bits flipped while it's just sitting there. That makes designing the data structures that make up a "file" difficult. |
||
| 25 | |||
|
Spice Hoarder
lemmy.zip
spicehoarder@lemmy.zip Joined: 2025-06-29 |
If you really want to know, I highly recommend reading Piratical File System Design with the Be FS - Dominic Giampalo as a free PDF. It goes into enough detail that you absolutely can write a modern filesystem based on just what is in it, including good diagrams and code snippets, but it doesn't just have page after page of code to wade through. It's a surprisingly enjoyable read. If you don't ...
Awesome! I will certainly give that a read. I've always wanted to make a file system. |
||
| 5 | |||
Akatsuki Levi
lemmy.world
AkatsukiLevi@lemmy.worldJoined: 2023-06-05 |
Sooooo... File systems are really just a large file, huh? I could just put a JSON with byte arrays there instead and no one would know... It is kinda obvious, but I never thought about generalizing it this way either
All the way down, it is just a giant array |
||
| 8 | |||
|
BartyDeCanter
piefed.social
BartyDeCanter@piefed.social Joined: 2026-05-02 |
Awesome! I will certainly give that a read. I've always wanted to make a file system.
Go for it! If you like designing low level data structures it's a lot of fun, and a userspace RAM or file backed filesystem via FUSE is surprisingly approachable. |
||
| 5 | |||
e0qdk
reddthat.com
e0qdk@reddthat.comJoined: 2023-11-27 |
I don't know if the GUID Partition Table fuckery is better or worse than what I was originally expecting when I thought your title meant you'd replaced your filesystem with ChatGPT and just let it hallucinate files in and out of existence for you. 🫠️ |
||
| 94 | |||
queerlilhayseed
piefed.blahaj.zone
queerlilhayseed@piefed.blahaj.zoneJoined: 2025-09-27 |
If you really want to know, I highly recommend reading Piratical File System Design with the Be FS - Dominic Giampalo as a free PDF. It goes into enough detail that you absolutely can write a modern filesystem based on just what is in it, including good diagrams and code snippets, but it doesn't just have page after page of code to wade through. It's a surprisingly enjoyable read. If you don't ...
Wow, that textbook looks great. Thanks for dropping some knowledge! ❤️ |
||
| 2 | |||
|
nibbler
discuss.tchncs.de
nibbler@discuss.tchncs.de Joined: 2025-03-07 |
Just implement a proper partfs driver then. Metadata might be a challenge. Also I believe dd is overused. cat with redirection or just cp (I guess) can do the same. |
||
| 6 | |||
|
nomad
infosec.pub
Nomad@infosec.pub Joined: 2023-06-16 |
Realized that years ago. Only problem is with dual boot to windows, so be careful if you run that eternal sin of a system. Usually run luks directly on disk. Sadly windows asked to initialize an unformatted disk when I added a new ssd and I clicked yes. Fortunately it just formatted the backup drive, but that could have been worse. |
||
| 12 | |||
|
RheumatoidArthritis
mander.xyz
RheumatoidArthritis@mander.xyz Joined: 2025-06-04 |
Hmm very interesting. That makes sense, but now I have more questions. Like what the fuck is file a system actually? Like I know what it is, and I know the features of a lot of the popular ones, but like what is it ACTUALLY?
Well it's a program that turns a huge array of bytes into a directory tree by allocating some of these bytes for data structures holding directory structure, metadata etc. The simplest to understand example would be FAT16 or floppy formats from 80s home computers. These had a lot of shortcomings, which were solved by more and more complex data structures. You can write a Python script that reads /dev/sda byte by byte and displays the directory tree. That would be a simple file system driver. |
||
| 9 | |||
|
Err(()).unwrap()
Moderator
rtxn@lemmy.world Joined: 2023-06-24 |
You get closer to true nirvana when you realize that "everything is a file on Linux" is a lie for children. |
||
| 73 | |||
|
diaphragmwp
discuss.tchncs.de
diaphragmwp@discuss.tchncs.de Joined: 2026-06-03 |
Only now you discovered that? Amazing for you, actually. Wait until you see Plan9. No, I have not (majorly) used it, but imagine it's stuff being files and filesystem drivers everywhere. The internet is a couple of filesystems. To download stuff from a website, you use the TCP filesystem to mount an HTTP filesystem. |
||
| 30 | |||
BeelzebubEiNukuKoskaan
piefed.social
BeelzebubEiNukuKoskaan@piefed.socialJoined: 2026-09-04 |
If you really want to know, I highly recommend reading Piratical File System Design with the Be FS - Dominic Giampalo as a free PDF. It goes into enough detail that you absolutely can write a modern filesystem based on just what is in it, including good diagrams and code snippets, but it doesn't just have page after page of code to wade through. It's a surprisingly enjoyable read. If you don't ...
I'm rather disappointed that there wasn't any pirates involved. |
||
| 8 | |||
|
Mongostein
lemmy.ca
Mongostein@lemmy.ca Joined: 2023-06-14 |
You get closer to true nirvana when you realize that "everything is a file on Linux" is a lie for children.
Oh is that why all my folders are 14kb? |
||
| 9 | |||
|
MonkderVierte
lemmy.zip
MonkderVierte@lemmy.zip Joined: 2025-05-30 |
Well it's a program that turns a huge array of bytes into a directory tree by allocating some of these bytes for data structures holding directory structure, metadata etc. The simplest to understand example would be FAT16 or floppy formats from 80s home computers. These had a lot of shortcomings, which were solved by more and more complex data structures. You can write a Python script that read...
But what if we left the tree building away and add tags and groups and metadata instead? |
||
| 1 | |||
|
MonkderVierte
lemmy.zip
MonkderVierte@lemmy.zip Joined: 2025-05-30 |
If you really want to know, I highly recommend reading Piratical File System Design with the Be FS - Dominic Giampalo as a free PDF. It goes into enough detail that you absolutely can write a modern filesystem based on just what is in it, including good diagrams and code snippets, but it doesn't just have page after page of code to wade through. It's a surprisingly enjoyable read. If you don't ...
My ISP classified this site as bad.
Edit: and the pdf link shows the "disconnected :o" page. Maybe for the same reason. |
||
| 2 | |||
Potato Lover 💾 No brain found
lemmy.sdf.org
user224@lemmy.sdf.orgJoined: 2023-06-17 |
Just implement a proper partfs driver then. Metadata might be a challenge. Also I believe dd is overused. cat with redirection or just cp (I guess) can do the same.
I am more worried about dealing with files increasing in size, file deletions, and dealing with fragmentation. |
||
| 5 | |||
|
RheumatoidArthritis
mander.xyz
RheumatoidArthritis@mander.xyz Joined: 2025-06-04 |
But what if we left the tree building away and add tags and groups and metadata instead?
I think this all has been tried and didn't get traction. Although it has been before everyone had devices that hide the filesystem from you. |
||
| 1 | |||
|
RheumatoidArthritis
mander.xyz
RheumatoidArthritis@mander.xyz Joined: 2025-06-04 |
I think this all has been tried and didn't get traction. Although it has been before everyone had devices that hide the filesystem from you.
https://stackoverflow.com/questions/3263036/file-system-that-uses-tags-rather-than-folders#3263550 but I remember reading elsewhere about actual file systems done this way, not overlays above hierarchical ones |
||
| 1 | |||
|
MonkderVierte
lemmy.zip
MonkderVierte@lemmy.zip Joined: 2025-05-30 |
I think this all has been tried and didn't get traction. Although it has been before everyone had devices that hide the filesystem from you.
Haiku does. Partly. And yeah, our (desktop) software ecosystrms are actually still in the client-server mode, with a set of patches and workarounds. Not purpose-built for desktop or mobile. |
||
| 1 | |||
rbos
lemmy.ca
rbos@lemmy.caJoined: 2023-06-08 |
You get closer to true nirvana when you realize that "everything is a file on Linux" is a lie for children.
IMO it's one of those bell curve meme things, with 'everything is a file' on both ends. I've come back around to it. |
||
| 40 | |||
|
BartyDeCanter
piefed.social
BartyDeCanter@piefed.social Joined: 2026-05-02 |
But what if we left the tree building away and add tags and groups and metadata instead?
The closest production system to that I've seen is IBM i libraries, or maybe the failed WinFS. The problem is that without namespacing, how do you tell one |
||
| 2 | |||
|
roundabout
feddit.org
roundabout@feddit.org Joined: 2026-08-12 |
Sooooo... File systems are really just a large file, huh? I could just put a JSON with byte arrays there instead and no one would know... It is kinda obvious, but I never thought about generalizing it this way either
Ooh, JSON! The Electron crowd can now extend to the FS! |
||
| 3 | |||
devfuuu
lemmy.world
devfuuu@lemmy.worldJoined: 2023-06-17 |
Before gpt partitioning we were limited to 8 partitions total. It was hell. Kids these days... |
||
| 23 | |||
|
MonkderVierte
lemmy.zip
MonkderVierte@lemmy.zip Joined: 2025-05-30 |
The closest production system to that I've seen is IBM i libraries, or maybe the failed WinFS. The problem is that without namespacing, how do you tell one README from another? And once you have a unique namespacing system, you're basically back to a tree with extra steps. Sure, from the FS POV, you could keep everything in a flat space with uniqueness determined by inode or a UUID but those ar...
Grouping? Which is directories, except not in a fixed place. Ok, maybe then we'll get sub-groups or nested groups and then we're back to fixed paths again. I just thought of grouped tags as a nice (partial) way around link rot in servers. A tree breaks a lot with a changed name inbetween, while file-bound attributes are more robust. |
||
| 2 | |||
|
Natanael
infosec.pub
Natanael@infosec.pub Joined: 2025-01-18 |
You get closer to true nirvana when you realize that "everything is a file on Linux" is a lie for children.
When plan 1-8 are over, you have Plan 9 in the file cabinet |
||
| 14 | |||
Forester
pawb.social
Forester@pawb.socialJoined: 2024-12-06 |
Oh is that why all my folders are 14kb?
Yes, actually! Your folder is a text file attached to an inode. |
||
| 14 | |||
|
Alper Çelik
lemmy.world
alper_celik@lemmy.world Joined: 2023-09-24 |
now write a fuse filesystem that automaticaly creates new partitions on gpt when used, |
||
| 10 | |||
|
BartyDeCanter
piefed.social
BartyDeCanter@piefed.social Joined: 2026-05-02 |
Grouping? Which is directories, except not in a fixed place. Ok, maybe then we'll get sub-groups or nested groups and then we're back to fixed paths again. I just thought of grouped tags as a nice (partial) way around link rot in servers. A tree breaks a lot with a changed name inbetween, while file-bound attributes are more robust. Also, the Unix tooling still crawling trees just doesn't align...
I spent a few months researching and trying to come up with a non-tree based approach for the FS I'm currently working on and just could not come up with anything that didn't end up back at the equivalent of a directory tree. I do think tags are very useful though, so I'm working on a richer version of the BeFS attribute and query system that should have better performance on SSDs as well a few other nifty features. |
||
| 2 | |||
|
NotEasyBeingGreen
slrpnk.net
NotEasyBeingGreen@slrpnk.net Joined: 2026-03-30 |
Yes, actually! Your folder is a text file attached to an inode.
It depends on the file system, doesn't it? |
||
| 4 | |||
|
Natanael
infosec.pub
Natanael@infosec.pub Joined: 2025-01-18 |
It depends on the file system, doesn't it?
Technically yes, but that's a pretty common design |
||
| 3 | |||
|
a_non_monotonic_function
lemmy.world
a_non_monotonic_function@lemmy.world Joined: 2025-10-22 |
I don't know if the GUID Partition Table fuckery is better or worse than what I was originally expecting when I thought your title meant you'd replaced your filesystem with ChatGPT and just let it hallucinate files in and out of existence for you. 🫠️
That would make for a rad experimental os. GPT fuckery just imagines up everything. Web browser, video games, file browsers and systems... You never know what clicking something will actually do. |
||
| 6 | |||
|
ggtdbz
lemmy.dbzer0.com
ggtdbz@lemmy.dbzer0.com Joined: 2024-04-17 |
IMO it's one of those bell curve meme things, with 'everything is a file' on both ends. I've come back around to it.
I had this realization when I thought of disk images. A disk image is a file ergo everything that can be on a disk necessarily has to be a file of some kind. It’s more like data is data is data to me but that’s so far from descriptive it’s like saying matter is matter. |
||
| 5 | |||
| Post Reply |
Back to top |