I've been playing around with ZFS and bind mounting datasets and their sub directories to LXC containers to be able to use my storage directly, to be able to manage data for different services independently of the containers running the actual service, but I'm still struggling to keep everything organized and decide on what's the best way to actually do this.
Are there preferable ways that don't involve directly mounting to the host?
Also, Databases. Usually I would just contain the database within a dataset directly or a sub-directory, and mount that to the lxc, and manually change the dataset, but now I'm thinking should I mount them directory to the lxc's equivalent database directory to simplify it?
Datasets too, Usually I create one when I think it's worthwhile for snapshots, and for large media/data storage like jellyfin and nextcloud (for reservations and quotas generally), but I know each dataset has a lot of individual options. I'm thinking I should not make more than I need, and use sub-datasets pretty much entirely for quotas?
For docker apps, I'd have a dedicated dataset where i'd have sub-directories containing the docker compose and related docker volumes, but some docker apps don't seem to play well with this, and it's awkward mounting them, is there a preferred way to do this, or just in a /mnt/ directory?
After thinking through, Here's what I think might be best for the datasets
zfs/databases - subdirectories for different db types and then database directories. those directories would be directly mounted to the related database directory in the containers to make switching out and putting in those databases just one line of configuration (aswell as creating new ones would be the exact same)
zfs/nextcloud_data
zfs/content_media/tv - media directory would be used to set an overall limit on all of the media, since one zfs is used for all
zfs/content_media/movies
zfs/content_media/music
zfs/service_data/matrix_images - would be default mounted to the default images directory
zfs/service_data/webserver
zfs/service_data/docker - subdirectories would be mounted to LXCS
I'm still quite an amateur, but does this look sensible? Are there things that I'm missing or straight up doing wrong? This also doesn't really account for configuration files, like with matrix, though that I'm less concerned about, as those never change. I do plan on doing more with tools like ansible and terraform, and I would imagine that would be a fine way to set static configurations.
Are there preferable ways that don't involve directly mounting to the host?
Also, Databases. Usually I would just contain the database within a dataset directly or a sub-directory, and mount that to the lxc, and manually change the dataset, but now I'm thinking should I mount them directory to the lxc's equivalent database directory to simplify it?
Datasets too, Usually I create one when I think it's worthwhile for snapshots, and for large media/data storage like jellyfin and nextcloud (for reservations and quotas generally), but I know each dataset has a lot of individual options. I'm thinking I should not make more than I need, and use sub-datasets pretty much entirely for quotas?
For docker apps, I'd have a dedicated dataset where i'd have sub-directories containing the docker compose and related docker volumes, but some docker apps don't seem to play well with this, and it's awkward mounting them, is there a preferred way to do this, or just in a /mnt/ directory?
After thinking through, Here's what I think might be best for the datasets
zfs/databases - subdirectories for different db types and then database directories. those directories would be directly mounted to the related database directory in the containers to make switching out and putting in those databases just one line of configuration (aswell as creating new ones would be the exact same)
zfs/nextcloud_data
zfs/content_media/tv - media directory would be used to set an overall limit on all of the media, since one zfs is used for all
zfs/content_media/movies
zfs/content_media/music
zfs/service_data/matrix_images - would be default mounted to the default images directory
zfs/service_data/webserver
zfs/service_data/docker - subdirectories would be mounted to LXCS
I'm still quite an amateur, but does this look sensible? Are there things that I'm missing or straight up doing wrong? This also doesn't really account for configuration files, like with matrix, though that I'm less concerned about, as those never change. I do plan on doing more with tools like ansible and terraform, and I would imagine that would be a fine way to set static configurations.