[SOLVED] [AMA] PVE 6.3-6 + zfs host storage pool + LXC + turnkey file server + SMB + shadow_copy2

ukro

Member
May 16, 2021
104
9
18
37
Greetings,
i manage to make it work so AMA if somebody need help.
And i would also like to ask is it possible to allow open the shadow copy but dont allow to full restore?
I am thinking that some not trained users might just missclick ooops..... and its gone, what, its gone, its all gone ,what's all gone,all the files in the directory ref. It's gone
 

ukro

Member
May 16, 2021
104
9
18
37
Okay i sorted it out.
Make a skynet.reg file put this
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PreviousVersions]
"DisableBackupRestore"=dword:00000001
"DisableRemoteRestore"=dword:00000001
"DisableLocalRestore"=dword:00000001
Run as administrator & reboot
 

Melvin_XIII

New Member
Aug 29, 2022
2
0
1
Hi,
If I understand correctly, then you managed to do what I am hoping to achieve.
My ZFS is managed by my proxmox host system. I exposed this to a Debian container which manages the SMB share. This works for me.
What I am wanting to achieve is that the Proxmox Host does snapshots which I can also pass to the container in order to be able to b able to access previous versions of files and directories from the client.
How did you go about configuring this?
 

ukro

Member
May 16, 2021
104
9
18
37
Hi,
sorry i didn't went with it but it was working. I was able to add PCI card for host os ssd, and passed the motherboard sata controller to truenas VM. On one site i am testing ZFS host mirror pool, made a raw disk on it and passed strip one drive to Truenas VM. I don't know if it will work correctly in the future.
I have some saved notes on regards CT samba that i tested,
I remember that important was setting the userID and groupID with 10000 or something like that:
Code:
cd .zfs/
cd snapshot/
zfs snapshot hoax_bck@test
zfs snap hoax_bck/hoax_bck_data
zfs snapshot hoax_bck/hoax_bck_data@zfs-auto-snap_frequent-2021-5-25-2242
zfs list -t snapshot

In the container!!! IMPORTANT !!! apt-get install samba-vfs-modules


samba conf:
Code:
[storage]
    valid users = LOCALUSER
    browseable = yes
    comment = Public Share
    force group = root
    directory mode = 0755
    create mode = 0755
    path = /srv/storage
    force user = root
    write list = LOCALUSER
    writeable = yes
    vfs objects = shadow_copy2
    shadow: snapdir = .zfs/snapshot
    shadow: sort = desc
    shadow: format = -%Y-%m-%d-%H%M
    shadow: snapprefix = ^zfs-auto-snap_\(frequent\)\{0,1\}\(hourly\)\{0,1\}\(daily\)\{0,1\}\(monthly\)\{0,1\}
    shadow: delimiter = -20
    veto files = /.zfs/
    delete veto files = yes
 

ukro

Member
May 16, 2021
104
9
18
37
Hi,
If I understand correctly, then you managed to do what I am hoping to achieve.
My ZFS is managed by my proxmox host system. I exposed this to a Debian container which manages the SMB share. This works for me.
What I am wanting to achieve is that the Proxmox Host does snapshots which I can also pass to the container in order to be able to b able to access previous versions of files and directories from the client.
How did you go about configuring this?
How are you automating the snapshots? You have any scripts? please share :>
I think this would be the best solution for proxmox. But i need more time to do it.
 

UdoB

Renowned Member
Nov 1, 2016
457
132
68
Germany
https://github.com/bashclub/zamba-lxc-toolbox offers a bash script to create a Container, install Samba and prepare several things like Snapshots. Those are visible as "Previous versions" from inside Windows and are also accessible in a Linux client below `.zfs/snapshots/`.

You might use that script or just peek into it to learn how they did this trick; the magic consists of a few lines in the generated smb.conf.
 
  • Like
Reactions: ukro

Melvin_XIII

New Member
Aug 29, 2022
2
0
1
Hi,
Thanks for the replies.
I inherited this system. I need to check how the snapshots are being done. I just know That there are regular snapshots being made.
I am waiting for a new HBA to arrive so I can connect a backup Array. I presume I'll tackle this challenge next week. I'll get back to you.

Thanks again for your help
 

ukro

Member
May 16, 2021
104
9
18
37
I have tryed different option on SMB from ZFShost->ZFSvm and it failed with degraded volume on raw disk file on ZFShost. So i am going back to this solution with samba lxc + AD. When i finish will write here.
 

ukro

Member
May 16, 2021
104
9
18
37
Finally finished the samba share container on Proxmox and i am able to see the shadow copy and restore files with this tutorial
Code:
https://dannyda.com/2022/04/12/how-to-expose-all-zfs-auto-snapshots-to-windows-clients-in-shadow-copy-how-to-show-all-zfs-auto-snapshots-in-shadow-copy-in-microsoft-windows-in-linux-openmediavault-omv-debian-ubuntu-etc/
I have keep hourly 24, daily 7, weekly 4, monthly 12.
Using host only network interface for VMs
For Windows 10 to remove restore button from the menu change this in Local Group Policy Editor:
USER CONFIGURATION > ADMINISTRATIVE TEMPLATES > WINDOWS COMPONENTS > FILE EXPLORER > PREVIOUS VERSIONS > Prevent Restoring Remote Previous Versions [ENABLED]
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!