Hi guys, i need a bit help, maybe this could get a great tutorial for others later:
Goal:
- Creating an ZFS Dataset
- mount it inside an LXC Container that runs Samba with vfs shadowcopy
- Create Snapshot Retention Plan
Preword:
I know how to make this basically with whole Pools.
But i have no Disks left sadly. Additionally snapshotting only Datasets is quite comfortable, because you can create simply Datasets for every need without wasting space and snapshot only the specific Data, not the whole Pool.
This is actually amazing if you have one gigantic Pool with raid10/5/1/z1/z2 with vdefs/caches/l2arc etc... and you run everything on that single pool.
So snapshotting that gigantic pool is quite uncomfortable.
Hardware:
zfs pool -->
Consists of 4 Drives raid 10 / 32gb raid1 optane as vdef / (2x Firecuda120 in raid1) splitted up to 60gb log drive and 60gb cache drive
Todo:
1. Creating Dataset:
2. Create an Priviliged LXC Container, set it up with Samba
--- Doesn't matter auctually if Priviliged or unpriviliged, just keep in mind with unpriviliged containers the files in the dataset will have shifted UID/GID above 100k, while priviliged containers keep usually almost the same user uid/gid numbers as the host.
3. Mount the ZFS Dataset:
--- Open the lxc config:
--- Small Help/Hint:
4. Adjust Samba config to share that folder [Later to that]
Now at this point im struggling and thats where i need help:
create dataset:
create snapshot:
delete snapshot:
list snapshots:
1. Do i need to add the dataset to the proxmox gui? Is there any reason/need/benefit?
-->
2. Is there any script/gui/anything that let me setup stupidly an snapshot retention plan?
--> It would be a pain in the ass to setup that as cronjobs.
3. Is it actually possible or anyone tryed to make snapshots inside an LXC Container?
--> But this would require some sort of zfs passthrough of the whole pool to the container?
--> Im just asking, because probably there is any gui/docker whatever available to manage zfs pools/datasets/snapshots, i just don't want to install that crap directly on the host.
Thats basically it, mainly i need basically recommendations what you guys are using to manage snapshots.
I mean i know, we can do it via cli, but thats just so uncomfortable.. xD
When i got everything running, i will convert this thread simply into an how-to.
Basically i have everything running since 2 years or so, just without snapshots
And slowly its getting critical, if some virus or other crap deletes/encrypts my samba share data.
Thats why i want shadowcopy xD
Cheers and Thanks!
Goal:
- Creating an ZFS Dataset
- mount it inside an LXC Container that runs Samba with vfs shadowcopy
- Create Snapshot Retention Plan
Preword:
I know how to make this basically with whole Pools.
But i have no Disks left sadly. Additionally snapshotting only Datasets is quite comfortable, because you can create simply Datasets for every need without wasting space and snapshot only the specific Data, not the whole Pool.
This is actually amazing if you have one gigantic Pool with raid10/5/1/z1/z2 with vdefs/caches/l2arc etc... and you run everything on that single pool.
So snapshotting that gigantic pool is quite uncomfortable.
Hardware:
zfs pool -->
DATA
Consists of 4 Drives raid 10 / 32gb raid1 optane as vdef / (2x Firecuda120 in raid1) splitted up to 60gb log drive and 60gb cache drive
Todo:
1. Creating Dataset:
zfs create DATA/SMB-DATA
2. Create an Priviliged LXC Container, set it up with Samba
--- Doesn't matter auctually if Priviliged or unpriviliged, just keep in mind with unpriviliged containers the files in the dataset will have shifted UID/GID above 100k, while priviliged containers keep usually almost the same user uid/gid numbers as the host.
3. Mount the ZFS Dataset:
--- Open the lxc config:
/etc/pve/lxc/1XX.conf
and add mp0: /DATA/SMB-DATA,mp=/smb_storage
, then save and start the container again.--- Small Help/Hint:
mp0: /source/folder,mp=/destination/folder
4. Adjust Samba config to share that folder [Later to that]
Now at this point im struggling and thats where i need help:
create dataset:
zfs create DATA/SMB-DATA
create snapshot:
zfs snapshot DATA/SMB-DATA@test1
/2/3/4/etc...delete snapshot:
zfs destroy DATA/SMB-DATA@test1
list snapshots:
zfs list -t snapshot
1. Do i need to add the dataset to the proxmox gui? Is there any reason/need/benefit?
-->
pvesm add zfspool samba_files -pool DATA/SMB-DATA
2. Is there any script/gui/anything that let me setup stupidly an snapshot retention plan?
--> It would be a pain in the ass to setup that as cronjobs.
3. Is it actually possible or anyone tryed to make snapshots inside an LXC Container?
--> But this would require some sort of zfs passthrough of the whole pool to the container?
--> Im just asking, because probably there is any gui/docker whatever available to manage zfs pools/datasets/snapshots, i just don't want to install that crap directly on the host.
Thats basically it, mainly i need basically recommendations what you guys are using to manage snapshots.
I mean i know, we can do it via cli, but thats just so uncomfortable.. xD
When i got everything running, i will convert this thread simply into an how-to.
Basically i have everything running since 2 years or so, just without snapshots
And slowly its getting critical, if some virus or other crap deletes/encrypts my samba share data.
Thats why i want shadowcopy xD
Cheers and Thanks!