Help with Proxmox LXC format to allow Snap shots

Hello all, my Plex install is messed up on my proxmox server. My recordings are all over the place and I keep getting somethings recorded and not others and its is completely random. Plex says they are recorded properly, but nothing is saved and there to view and there are no errors in the logs…

SOOOOOO… I am going to reinstall from scratch on a LXC so I figured it would be a good time to fix an issue I have I haven’t been happy with my current install. The Debian LXC I have setup does not allow “Snap Shots.” Is this inherent of all LXC’s? Do I just need to do backups? I know LXC’x aren’t that big, but with the issues I have had I would like to have a better backup plan.

Sorry that I can’t really give you an answer but one thing that might help is that you can edit the LXC’s .conf file and comment out the bindmounts (using #). You should then be able to snapshot the container.

In regards to files not recording correctly (I assume you mean the PVR functionality)… could it be a permissions issue?

1 Like

We will see, Im reverting to previous version of Plex. The last few distros did not fix the issue, and im not the only one having issues. Dunno if a update didnt work properly or had a werid issue updating. The other thing is out of 10 recordings in a day random ones will not record, without error, tuner is fine and updated its really odd, even logs dont have errors ive seen.

As far as the LXC, its weird I have it on a zfs partition. Id think that would be enough. I’ll try the bind mounts. I was sure it was something dumb…maybe I can write a script (lol never done it but a one liner lol :laughing:) to # em the snapshot then rebind lol just a thought if it works. Ill have to try it later on.

Stop right there.

Snapshots are either a feature of the file system, the virtual disk, or the NAS / SAN. Let’s go into FS first.

Take ZFS, BTRFS and LVM as an example. ZFS and BTRFS have builtin snapshot capabilities. Taking a snapshot of a ZFS file system is easy. LVM is just a logical volume manager (it’s its name, duh), so you can place other file systems on it, like ext4 or xfs. LVM, if the volume group (vg) has enough free space to write new data to an empty space in your volume (copy-on-write, or COW), LVM will allow you to keep the data that is in place (snapping the FS) and it will just keep the data outside the actual partition, but inside the same volume, and point… well… pointers to the new data. Once you delete a snapshot, the volume becomes free for the taking, either by a new logical volume on the volume group, or for a new snapshot.

Let’s get into virtual disks. VMWare’s vmdks and KVM’s qcow2 disk type have builtin support for snapshotting. Much like LVM, these work on the same principle, copying data to another location and pointing to it. qcow2 is literally QEMU Copy on Write (2). Keep in mind KVM also has raw disk types, which basically emulate physical hardware. It has better performance and if you don’t need snapshots, you can select that, but by default Proxmox uses qcow2 in absence of another snap engine. If you use Proxmox builtin storage, it will use LVM(-thin) (which is basically LVM, but only telling the FS on top that it has a certain size, to enable you to basically overprovision a server - I hate overprovisioning).

The last snapshot type would be the NAS / SAN one. To make it easy, imagine that you have another proxmox or a truenas server running ZFS and having an NFS share. You give the NFS share to another server and if you want to take a snapshot of it, you just do a ZFS snapshot on the NAS itself. If you are sharing an entire partition, then you have to snap it in its full. If you have your NFS shares split into multiple smaller chunks, then you may only need to snap that particular one.


Now, to LXC. Proxmox by default, if I’m not mistaken, doesn’t use any of the above for LXC. I believe it’s just a folder inside one of Proxmox partitions. Which is why you cannot take a snapshot of it. It’s not that you are not able to, you can do either an LVM or ZFS snapshot depending on what you installed Proxmox on, but you would have to take a snapshot of the entire Proxmox FS, not just the sole LXC. Looking into Proxmox LXC creation, it seems like you can only select the storage pool (local LVM or your ZFS pool or your NFS share). But you cannot create a virtual disk, like you can with VMs and make it for example qcow2.

This is the reason why you cannot take a snapshot in proxmox. However, interestingly enough, my last proxmox box standing has 2 containers on its internal ZFS pool, and the storage is a subvolume of the main pool. In theory, I should be able to take a snapshot of the LXC container. The GUI doesn’t seem to allow it, but lo and behold:

[email protected]:~# zfs list
NAME                        USED  AVAIL     REFER  MOUNTPOINT
zastoru                    2.93T   595G      112K  /zastoru
zastoru/data                 96K   595G       96K  /zastoru/data
zastoru/subvol-115-disk-0   653M  11.4G      653M  /zastoru/subvol-115-disk-0
zastoru/subvol-116-disk-0  57.1M  7.94G     57.1M  /zastoru/subvol-116-disk-0
zastoru/vm-104-disk-0      22.6G   595G     17.5G  -
zastoru/vm-109-disk-0      74.1G   662G     6.99G  -
zastoru/vm-109-disk-1      1.60T   595G     1.60T  -
zastoru/vm-110-disk-0      31.9G   595G     31.9G  -
zastoru/vm-111-disk-0      1.16T  1.33T      422G  -
zastoru/vm-112-disk-0      10.8G   605G      506M  -
zastoru/vm-114-disk-0      12.3G   605G     1.96G  -
zastoru/vm-117-disk-0      10.3G   598G     6.90G  -
zastoru/vm-118-disk-0      10.3G   599G     5.97G  -
zastoru/vm-119-disk-0      6.19G   598G     2.69G  -
zastoru/vm-119-disk-1      2.06G   597G       60K  -

[email protected]:~# zfs snapshot -r zastoru/[email protected]_10am

[email protected]:~# zfs list -t snapshot
NAME                                        USED  AVAIL     REFER  MOUNTPOINT
zastoru/[email protected]_10am     0B      -      653M  -
zastoru/[email protected]             5.05G      -     16.0G  -

To revert to a snapshot:

[email protected]:~# zfs rollback -r zastoru/[email protected]_10am

And to destroy it:

[email protected]:~# zfs destroy zastoru/[email protected]_10am

All heil ZFS.

3 Likes

Lol, Yeah I installed proxmox as a ZFS partition. I then had the VM drive on another ssd on a zfs partition.

Ill have to see if I can just use zfs via cli.

I can also just use the backups option which has worked fine for me to revert to to see if it fixes my dvr recording problem.

Its still running and I havent been able to check it yet.

1 Like

Problem solved…

Reverting back to PLEX media server version 1.25.6.5577 from 1.27.1.5916 solved my recording issue. So far. I have to wait for a week day to be sure…

1 Like

I recommend using zfs-auto-snapshot if you are using Proxmox with local storage. The package automatically makes snapshots hourly/daily/weekly/monthly of all datasets and zVols. Small package that uses zed and cron and just runs and does stuff so you always have snapshots for everything. I’m always too lazy to dig into crontab myself and Proxmox doesn’t do snapshots by itself.

Here some preview of my laptop home dataset:

1 Like