What am I doing wrong with Snapshots?

Ok, so I thought I had a grasp on Snapshots but I am clearly doing something wrong. I made a mistake on a file and to my surprise when I went to previous version the folder showed empty. This is my setup. Raidz2 has “Users”. Inside Users is people’s names (lets just call it 1,2,3,and 4 for simplicity).

I want everything in here to have snapshots taken. I thought I had it set up that every 5 minutes it will take a snapshot and keep them for an hour.

Then take one every hour and keep them for a week.

And every one day take one and keep it for 3 months.

When I go to previous versions of User 1 I am met with this.

When I go to previous versions on the Users folder I see a bunch of snapshot had been taken but…

All of them just show as empty.

Can anyone explain exactly where I am going wrong like you are talking to a 5 year old. Thanks :joy:

Hiya,

This is just a guess but I wonder if the issue here is that you have one share ‘Users’ and a few datasets underneath it.

As a test why not try sharing out the specific users dataset and see if you can mount that and access the previous versions.

So you are saying add “1” to the smb thing as a new share? If so, just tried that and same results as going to the “Users” share first and then “1”.

So you created a new share and pointed it at dataset ‘1’?

Yep. Same results.

Ah ok worth a shot.

What version you running?

Have you used the default share parameters and not done anything funky?

Version I’m on is ElectricEel-24.10.2.4

This server was originally setup on Core 12 I think and I could have sworn everything was working properly at the time when I set it up years ago. I don’t remember changing anything. I’ve been following mission critical roadmap of what version to update to and when and didn’t notice any issues. I honestly rarely ever screw up a file to use snapshots so I’m not sure if I’m misremembering that it was working and it’s setup wrong, or if this is something that broke somewhere along the way updating. :man_shrugging:

For now to get your data back you should be able to go via the CLI and cd to the dataset in question. Then cd .zfs and in there should be all your snapshots and files. You can then simply cp the file required back to the dataset.

PS: You will need to elevate first with sudo -s

1 Like

So you don’t see anything wrong with how I have the snapshot tasks set?

No that all looks good to me. Like I say the only alarm bells are the nested datasets shared out via one share which isn’t the end of the world but generally discouraged.

Can you share a screenshot of your share config.

and also permissions on one of the datasets.

1 Like

Here is everything from the share section…



and this is the permission on “1” which is the user account I’m using.

Come to think of it, :thinking: I noticed another oddity involving the snapshots a month or two back. I have a second Truenas machine I replicate to and for some reason I needed to keep “replicate from scratch” checked or I run into issues. Not sure if related but I had it unchecked for however long they’ve both been setup. It’s not a ton of stuff and the network is fast enough so I just checked the box and ignored the problem but since they both involve snapshots I figured I mention it in case it’s related.

This command can help you understand where does your files actually stored

zfs list -t snapshot -o name,used,referenced | grep Raidz2/Users

Open Windows File Explorer. Press CTRL + L.

Type this into the address field: \\serverip\sharename\.zfs\snapshot

Replace serverip with the server’s IP address and replace sharename with the SMB share’s name for user “1”.

Does you see the snapshots presented as folders? If you visit one, is it empty?

Something is beyond messed up. I restarted the system at about 8:30am just to see if it would fix anything and nothing seemed to have changed or so I thought. Doing your “.zfs\snapshot” in user “1” however is now listing 5 snapshots starting at 8:40am which is after the restart time. No sign of what happened to the 3 months of previous snapshots.

Doing .zfs\snapshot in “users” shows a ton of snapshots dating back to June as expected but every single one opens up to “this folder is empty”.

This keeps getting stranger :joy:

Can you confirm this in the command-line over SSH on the server itself?

Can you verify that your snapshots were not indeed destroyed?

Something definitely changed after the restart. I think I unknowingly stumbled across a bug because I changed no settings before or since. I basically only log into the interface to update. Somehow I’m getting all the new snapshots that I would expect to see doing “.zfs\snapshot” in places but only after 8:30am when I restarted. Really weird. I just retyped what I was going to bring up the previous version to get so I guess consider the issue solved. I’m going to keep checking that I see new snapshots made and I’ll report back if anything odd happens again.

There is a possibility that one task (hourly expiry) is inadvertently pruning the snapshots of the other tasks (weekly and three-monthly expiry).

I don’t want to jump to conclusions, but it might be related to this. I’m thinking I need to rewrite that post for the new forums and make it easier to read.

There’s just not enough information and confirmation to go by to know if this is what is happening or if the issue is less severe, such as nested snapshots not presenting themselves through Windows File Explorer properly.

1 Like

This had crossed my mind also. Perhaps try staggering the periodic snapshot schedules so they don’t overlap. For example make your hour for a week snapshot happen at 1 minute past the hour etc.

Also I modify the naming schema with just a simple -1d or -1w on the end to denote the length of time the snapshot will last. Makes sorting easier if you ever have to manually prune. Can also be useful in complex three-way replication setups.

Everything has been working fine since the restart a couple weeks ago until Friday I got this error:

Snapshot Task For Dataset “RaidZ2/Users” failed: cannot create snapshot ‘RaidZ2/Users@auto-2025-09-26_14-55’: dataset already exists cannot create snapshot ‘RaidZ2/Users/user2@auto-2025-09-26_14-55’: dataset already exists no snapshots were created…

I’m going to change the naming and see what happens. What you say makes sense.