Accidentally renamed folder to existing ZFS dataset, data inaccessible

trustnotwo

Cadet
Joined
Apr 11, 2022
Messages
1
I made a very dumb mistake last night and potentially lost all the data on my pool. For whatever reason when I had set up my TrueNAS installation over a year ago, I decided to share all of my data in a folder on the pool (not part of a dataset). At some point over the last year, I had made a new dataset titled "Primary", which I didn't end up doing anything with. Last night, I wanted to rename this folder to "Primary" and realized that there was already a folder titled "Primary" on my pool. I didn't realize that this was an existing dataset, and deleted the folder and renamed my folder to "Primary". I ended up restarting for a hardware change, and the next thing I know I am missing all of my files in the "Primary" folder. The files are still taking up space on the pool, but all references to them have disappeared. I realize this is an EXTREMELY dumb mistake and oversight on my part, but is there any way I could recover these files off of my pool?
 
Joined
Oct 22, 2019
Messages
3,641
@blanchet is correct.

When you see an empty "folder", you're actually looking at an empty dataset that is being mounted to the same exact path as your original plain folder. Rebooting the system essentially "re-mounted" the dataset to the same path, which supersedes your folder. Renaming the dataset and rebooting, per @blanchet's post, should "liberate" your existing folder, as it were. :wink:

This is also a good reminder not to save files/folders directly inside the top-level root dataset.
 
Top