r/selfhosted • u/Onward-Upword • 5d ago
Need Help Storage Directory Structure
This is the structure of my NAS storage that I've come up with and tweaked over the years. I would love to hear any feedback of ways it could be better, or discussions on alternatives and pros/cons. I'm very passionate about this and love nerding out over small directory improvements and little (or sometimes, big) tweaks that improve my storage organization!
Here are the objectives that have shaped this structure:
- Private vs Public Data: Separate data into "private" (my personal data which is irreplaceable) and "public" (data produced by others and publicly available to acquire). This allows me to easily back up data that is irrecoverable and limit access for specific apps to only public data.
- Temporary vs Permanent Data: Keep temporary data, download, and staging areas separate from curated data libraries.
- Application Independence: Organize data by content type rather than by the application that manages it, allowing applications to be replace without changing the underlying data.
- Balance Directories: Balance categories and sub-directories to allow good organization without too much directory depth or path lengths.
- Consistent Naming Conventions: Use lowercase with directories for simplicity in navigation and scripting, and use consistent naming conventions for each data type.
- Human-Readable Organization: File and directory names should be human-readable and self-descriptive, allowing data to be located, identified, and accessed without relying on a specific application or its database
- Single Authoritative Copy: Maintain a single authoritative copy of each file, avoiding unnecessary duplication. Multiple apps can access the same file, with read-only access where possible.
- Hardlinks: Downloads and media should be in the same share and file system so the Arr stack can use hardlinks which saves space and disk writes. Also, since not all downloads are media, the downloads directory should remain separate from the media directory.
542
Upvotes
•
u/asimovs-auditor 5d ago
Expand the replies to this comment to learn how AI was used in this post/project.
19
u/Aide_Sea 5d ago
Looks solid :) I'd maybe add a separate spot for app state (docker volumes, databases). It's not really private or public but it hurts to lose, and DBs don't like being copied while running, so I just dump them before the backup runs.
36
u/SimpleTeacher5046 5d ago
Stash mentioned. I see you buddy
4
u/dannytbone 4d ago
How did you make the picture?
3
u/prutprit 5d ago
r/datacurator
Not very active, but full of interesting posts and a nice wiki
8
u/Yann39 5d ago
Personally, I prefer to organise my folders by theme/category rather than by type.
For example, if you have
images,videosanddocumentsfolders, when you go on a trip and take photo/videos, do you split the travel documents in thedocumentsfolder, the photos in thephotosfolder and the videos in thevideosfolder with 3 dedicated subfolders (/images/trip1,/videos/trip1,/documents/trip1) ?I prefer to have a
tripsfolder, with a sub-folder for each trip (/trips/trip1,/trips/trip2, etc.), each containing everything related to that trip, the same goes for other categories likecars,games,eventsand so on.2
u/Ok-Comfortable6371 5d ago
I thought it was really cool, even using CasaOS which already has its own file structure. I hope to be able to build another one using this. Thank you.
2
u/psylenced 5d ago
It's similar to what I planning on doing.My other idea is to use an OverlayFS style system.
So public/purchased and private/downloaded sit over the top of each other and it gets shared and appears as one single file system while using it. But still keeping the physical separation.
2
u/abandonedsaints 4d ago
I’m curious - how do people who download videos from YouTube/Instagram/X/etc. have them organized?
49
u/Asstronaut-Uranus 5d ago
Looks good, love the public private part
3
u/TheFumingatzor 5d ago edited 5d ago
Johnny•Decimal, bruv. Trust me.
5
u/kbd65v2 5d ago
stash 👀
1
u/Dangerous_Joke_1380 5d ago
So, do Sonarr and Radarr get passed the whole public folder root? To take advantage of hardlinks? Or do you pass them the downloads then just the movies/tv shows folders separately
1
u/sustemlentrum 5d ago
When is you music public and when is it private?
1
u/No-Signature-918 5d ago
Looks pretty thought through, the private/public split is the part I'd keep for sure. The one thing that'd trip me up is having music in both private/media and public/media — with your single-copy rule I'd want one of them to be the real library and just point everything else at it, otherwise the two drift apart and you forget which side a file went to. Only other habit that's saved me is a quick sweep for strays, files that landed directly in a folder that should only hold subfolders:
find /data/public/media -maxdepth 1 -type f
It catches the odd file that missed its folder before it piles up. Otherwise the layout looks solid.
1
u/m1kemahoney 5d ago
Is the stash folder just a holding folder, or is it really Stash-Linux?
1
u/____-_---___--_____- 5d ago
Why emulation and games are private?
1
u/OverallLifeguard6265 5d ago
I’m curious what’s in that stash folder
1
u/ecnahc515 4d ago
Store books in a folder, rather than top level as files. It works better for audiobooks that are multiple mp3s and I believe audiobookshelf requires it too.
1
u/tombo12354 3d ago
The nzbget, qbittorrent, and docker makes me think you use the arr stack. If so, how do you manage those programs interacting and having very specific requirements about how they see mounted folders.
I assume you have to expose the Public folder into them, and then set the downloads and media folders. Any issues with configuration there?
1
u/talentedfingers 23h ago
Is \data a single filesystem? Just curious if you split them up with different blocksizes or snapshot schedules. That was something I wrestled with myself. Having \download and \media on the same filesystem seems important to make file sorting easier with simple filesystem directory changes instead of copying data blocks between filesystems.
1
u/superslow_jerry 4d ago
We get it, you goon
1
u/davidjimenez75 3d ago
SDIRS - Alias (Samsung DIRS) = easy sync Windows + Linux + Mobile Phone + Tablet with Beyond Compare 5
```
├───Alarms
├───Audiobooks
│ ├───audiobooks
│ │ ├───audiobooks--2025
│ │ └───audiobooks--2026
│ └───audiolibros
├───Books
│ ├───ebooks
│ │ ├───ebooks--2025
│ │ └───ebooks--2026
│ └───libros
│ ├───libros--2025
│ └───libros--2026
├───DCIM
├───Documents
├───Download
├───Movies
│ ├───4K Video Downloader+
│ ├───MTV
│ ├───Videos
│ │ ├───videos--2025
│ │ └───videos--2026
│ └───Videoteca
├───Music
├───Notifications
├───Pictures
│ ├───pictures--2025
│ ├───pictures--2026
│ └───wallpapers
├───Podcasts
└───Recordings
````
1
u/capilarenerviioptice 1d ago
This is a nice approach. Thanks for sharing.