My setup:
I have two ReServers thanks to Wendell’s vode " The Ideal Home Server! Is it Possible?". One is Alpha-NAS (local), and the other is Omega-NAS (remote). Both have 2x10GB HDDs.
On Alpha-NAS, I have a dataset called ALPHA that contains one ZVOL also named ALPHA. It’s shared to Windows over iSCSI. The volume is protected by daily snapshots with a 100-day retention policy. All snapshots are replicated to Omega-NAS over a VPN. That part works fine.
The problem:
I deleted a single file and need to recover it. Here’s what I did:
Logged into Alpha-NAS → Data Protection → Snapshots
Selected the appropriate snapshot → Clone to New Dataset
Navigated to Datasets → the cloned dataset appears in the list
Went to Shares → created a new iSCSI target → went through the wizard
Then on Windows:
Opened iSCSI Initiator
Went to Discovery → clicked Refresh
The new target appeared in the list → clicked Connect
It connected successfully
Windows Disk Management, does not recognize partitions. And data in that volume is not even close to what is in the original volume.
After some digging i came to a conclusion, correct me if I’m wrong.
Cloned snapshot doesn’t contain all blocks (no relation to unchanged blocks) only changed ones. I need to Rollback to that snapshot, to be enable to get the data. I don’t have enough free space in that Dataset (ALPHA) that contains this ZFS volume, to fit in it recovered version.
Condense option:
Can I use zfs promote but recover the ZFS to another Dataset (BETA)? How to format the command?
You can zfs send that snapshot e.g. over SSH to a different system and the stream will contain the entire zvol data at the time the snapshot was taken. Or do it locally - if you have a second pool with enough space you can zfs receive it to that one. Any way you will get a full clone of the zvol.
Did you mean “pool” when you wrote “dataset”? I dind your description a bit confusing to be honest.
When you joined this forum, you got a PM from @TrueNAS-Bot . Find and reply to that PM for a tutorial on using this forum, which will also increase your trust level and allow you to do these things.
After this operation, I connect this recovered ZVOL via ISCI to Windows and the partitions should be readable? I didn’t mention it earlier, but this volume connected to Windows is internally, i.e. from the Windows side, encrypted with Bitlock.
You can use /usr/sbin/zfs which will always be found.
The reason it isn’t when that is the case is that /usr/sbin is not in the current search path. It is for root, but only if you perform a full login, e.g. su - root, not only su root.