[Plugin] Snapshots


Recommended Posts

  • 3 weeks later...

Hi - I'm quite tech savvy but please could I get a retards explanation of how this works?

 

Does it only take snapshots of a specific share not the whole drive or is the sub-volume just the place it stores the snapshots of that drive?

 

I've created 3x subfolders on each drive & run a snapshot but if I browse the share manually there's nothing in it other than empty folders?

 

Thanks

Edited by dopeytree
Link to comment
1 hour ago, dopeytree said:

Hi - I'm quite tech savvy but please could I get a retards explanation of how this works?

 

Can you expand on what you mean (what the "this" part is)? How the plugin works, or snapshots? Or maybe the filesystem itself and how snapshots work within that filesystem? Not sure.

 

If you're unfamiliar specifically with advanced filesystems, or just havent worked with them previously, the first post in the zfs plugin support page has some handy reference links towards the bottom that should help as a primer.

Link to comment
5 hours ago, dopeytree said:

Hi - I'm quite tech savvy but please could I get a retards explanation of how this works?

 

Does it only take snapshots of a specific share not the whole drive or is the sub-volume just the place it stores the snapshots of that drive?

 

I've created 3x subfolders on each drive & run a snapshot but if I browse the share manually there's nothing in it other than empty folders?

 

Thanks

This only works with BTRFS subvolumes or drives that are formatted to BTRFS. You create as many subvols(Dir) as you want, each can have a snapshot schedule set, but creates on the same disk. Send function can be used to transfer to another disk/pool or another machine and supports incrementals.

 

 

Link to comment
  • 1 month later...

Thanks for this great plugin :D

 

In order to create snapshots I'm converting some of my "Cache: prefer" shares to subvolumes in the cache pool (which is btrfs, my array is XFS), but now I wonder if this may interfere with Mover.

 

I don't _think_ it'll be an issue, but am interested in hearing if my reasoning is correct.

 

When the cache fills up, Mover will eventually move data from the cached shares to the array. These files will (obviously) not be snapshotted anymore, but this won't be an issue because my whole goal with snapshotting is for backing up those shares to the array anyway.

 

The only issue I can foresee is Mover somehow having an issue with subvolumes in general that I'm not aware of?

Link to comment
12 minutes ago, trurl said:

These are not moved to the array. 

 

Hmm perhaps I misunderstood how "Cache: prefer" works (only installed Unraid a few days ago), but I thought that if the cache pool fills up, eventually files gets moved to the array?
 

12 minutes ago, trurl said:

Unclear, do you mean other shares? They would need to be cache:yes to get moved 


No, I meant subvolumes. I would think that those look like regular directories to Mover and hence won't be problematic.

To give a bit more background: I have an `appdata` share which is set to "Cache: prefer". On my cache pool mountpoint (`/mnt/nvme-cache/`) I converted it from a regular directory to a subvolume so I can snapshot it.

Link to comment
Just now, robertklep said:

I thought that if the cache pool fills up, eventually files gets moved to the array?

Not quite.   If the cache pool fills up then NEW files overflow to the array (and are later moved to the cache if space becomes available).  Files already on the cache are left there.

Link to comment
Just now, robertklep said:

perhaps I misunderstood how "Cache: prefer" works

You did. Prefer means prefer to keep the files on cache, and if any are on the array, move them to cache.

 

1 minute ago, robertklep said:

I meant subvolumes

Still don't know what you mean. If you mean subfolders, any folder at the top level of array or pool is automatically a user share.

Link to comment
1 hour ago, robertklep said:

 

Ah thanks for the explanation! (you too, @itimpi)

Which makes my whole question moot, so I won't bother you with any more details :)

Dont forget to check the shares after you re create as subvol as you may need to set as cache prefer after you recreate

Link to comment
1 minute ago, SimonF said:

Dont forget to check the shares after you re create as subvol as you may need to set as cache prefer after you recreate

 

Good to know (although in my case the correct cache settings were kept) 👍🏻

 

One other question: there's no option to run a script after a scheduled snapshot has been created, is there? Ideally I'd like to create a symlink that points to the latest snapshot.

Link to comment
1 minute ago, robertklep said:

 

Good to know (although in my case the correct cache settings were kept) 👍🏻

 

One other question: there's no option to run a script after a scheduled snapshot has been created, is there? Ideally I'd like to create a symlink that points to the latest snapshot.

No not at present.

Link to comment
  • 3 weeks later...

Hey guys, i noticed, that my automatic snapshots arent working anymore. I get the following error in the logs
 

snapshots: btrfs subvolume snapshot -r '/mnt/cache/lxc/AMP' ' /mnt/cache/snaps/AMP-20221028170521' Error  ERROR: not a btrfs filesystem:  /mnt/cache/snaps

/mnt/cache/snaps is the folder i use for the snapshots to store. That directory was working once, but now it doesnt anymore. It is on my cache, which is 100% a btrfs filesystem, and even if it where on my array, thats btrfs aswell, so shouldnt matter.
I already tried to recreate the share normally and also created it as a subvolume. Both times i can see it in my cache, but it still doesnt work.

Link to comment
33 minutes ago, JorgeB said:

That's very strange, and the snaps folder doesn't need to be a snapshot, please post the output of :

btrsf sub list /mnt/cache

If it's very large you can attach it as a txt file.

You have a typo in your command and i had to filter out docker subvolumes, but here is the output

grafik.png

Link to comment
54 minutes ago, Joly0 said:

Hey guys, i noticed, that my automatic snapshots arent working anymore. I get the following error in the logs

snapshots: btrfs subvolume snapshot -r '/mnt/cache/lxc/AMP' ' /mnt/cache/snaps/AMP-20221028170521' Error  ERROR: not a btrfs filesystem:  /mnt/cache/snaps

You have a leading space in the path to `/mnt/cache/snaps` 😅

Edited by robertklep
  • Like 1
Link to comment
4 minutes ago, robertklep said:

You have a leading space in the path to `/mnt/cache/snaps` 😅

Wait. Wat??.... You are right... How on earth did this happen???
Thats quite awkward, i am certain i havent changed anything regarding the path, as i havent changed it since setting this up half a year ago.

Well, thx

Link to comment

Wow, just found this plugin and I just want to say that it looks AMAZING!

 

Gonna turn off my plugin script and try this plugin out!

 

A few things as a first time user and a prior user of the script method that stand out to me, just in the order I am finding them while exploring.

 

1: The ability to convert a folder to a subvolume in the GUI would be very nice

 

2: Easy button to delete all snapshots from a drive / everything with 1 button, for example when needing to free up space on a share/drive you have to remove all snapshots with the deleted data to get the space back. Manually clicking hundreds of snapshots is not really an easy option lol.

 

The easiest option for this would be an extra checkbox at the "root snapshots folder" where it is blank now.

 

3: Along the same lines as above, easy button to take snapshot of everything at once on demand would be fantastic

 

4: while trying to setup everything from scratch I desperately could use a way to apply settings to multiple volumes at once. Maybe like the way it is done in the shares section of unraid? Or at least some "global" options that could use some generic relative options like {SUBVOLUMENAME} in the path that could use the same relative paths for all the snapshots.

 

For example I find I prefer my snapshots in the root dir under the same snapshot dir ordered by date.

 

EG

/mnt/cache/.snapshots/Snap-{D-m-d-Y}/temp

/mnt/cache/.snapshots/Snap-{D-m-d-Y}/data

/mnt/cache/.snapshots/Snap-{D-m-d-Y}/pictures

 

and the same structure for all drives.

 

5: Ability to save all subvolumes of a particular drive under the same snapshot folder like the script did. easier to sort through a bunch of dated folders to find the snapshot you want and then drill down then having to see all the subvolumes listed for each snapshot. Means a ton of folders to sort through.

 

6: How does the send snapshot work? I am guessing this is for backup purposes to send the updated data to another drive / server? I knew this was possible but never looked into it. It would be super cool if the plugin could be expanded to include a backup section that would make backups a simple process of connecting an unassigned drive, mounting it and then sending over the snapshots, verifying they are correct etc. This would save a ton of time and make backups way smoother.

 

Gonna keep using the script for the time being I think, kinda daunting to go individually edit all the hundreds of subvolumes manually to set everything up.

 

Keep up the good work, this was the biggest shock to me when moving to unraid, the lack of any kind of snapshot system!

Link to comment
59 minutes ago, TexasUnraid said:

Wow, just found this plugin and I just want to say that it looks AMAZING!

 

Gonna turn off my plugin script and try this plugin out!

 

A few things as a first time user and a prior user of the script method that stand out to me, just in the order I am finding them while exploring.

 

1: The ability to convert a folder to a subvolume in the GUI would be very nice

 

2: Easy button to delete all snapshots from a drive / everything with 1 button, for example when needing to free up space on a share/drive you have to remove all snapshots with the deleted data to get the space back. Manually clicking hundreds of snapshots is not really an easy option lol.

 

The easiest option for this would be an extra checkbox at the "root snapshots folder" where it is blank now.

 

3: Along the same lines as above, easy button to take snapshot of everything at once on demand would be fantastic

 

4: while trying to setup everything from scratch I desperately could use a way to apply settings to multiple volumes at once. Maybe like the way it is done in the shares section of unraid? Or at least some "global" options that could use some generic relative options like {SUBVOLUMENAME} in the path that could use the same relative paths for all the snapshots.

 

For example I find I prefer my snapshots in the root dir under the same snapshot dir ordered by date.

 

EG

/mnt/cache/.snapshots/Snap-{D-m-d-Y}/temp

/mnt/cache/.snapshots/Snap-{D-m-d-Y}/data

/mnt/cache/.snapshots/Snap-{D-m-d-Y}/pictures

 

and the same structure for all drives.

 

5: Ability to save all subvolumes of a particular drive under the same snapshot folder like the script did. easier to sort through a bunch of dated folders to find the snapshot you want and then drill down then having to see all the subvolumes listed for each snapshot. Means a ton of folders to sort through.

 

6: How does the send snapshot work? I am guessing this is for backup purposes to send the updated data to another drive / server? I knew this was possible but never looked into it. It would be super cool if the plugin could be expanded to include a backup section that would make backups a simple process of connecting an unassigned drive, mounting it and then sending over the snapshots, verifying they are correct etc. This would save a ton of time and make backups way smoother.

 

Gonna keep using the script for the time being I think, kinda daunting to go individually edit all the hundreds of subvolumes manually to set everything up.

 

Keep up the good work, this was the biggest shock to me when moving to unraid, the lack of any kind of snapshot system!

Thanks for the feedback will look over weekend

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.