zfs destroy snapshot

janos66

Dabbler
Joined
Feb 18, 2022
Messages
21
Hi,

I replicated a test filesystem with the replication wizard and forgot to set "full filesystem", so I ended up with an snapshot on the target system.
I thought no issue destroy the snapshot and start the replication again, hence I did

Code:
zfs destroy store01@auto-2022-02-18_21-10


and after that

Code:
zfs list -t snapshot
zfs list


no filesystem and no snapshot, but "zpool list" shows there is still data on store01

root@truenas[~]# zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
boot-pool 102G 2.63G 99.4G - - 0% 2% 1.00x ONLINE -
store01 108T 209G 108T - - 0% 0% 1.00x ONLINE /mnt
store02 101G 1.20G 99.8G - - 0% 1% 1.00x ONLINE /mnt


and the replication wizard refuses to overwrite the data.
Code:
report_problem Error
[EFAULT] Target dataset 'store01' does not have snapshots but has data (e.g. 'blabla' and replication from scratch is not allowed. Refusing to overwrite existing data.


How can that be and why it is not possible to simply send the data with "zfs send" via console?

Each time when I try to use "zfs send" the system deletes the filesystem by itself
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
because you sent data to the location by sending a snapshot, and then deleted the snapshot. the snapshot doesn't contain the data, its an immutable reference to data.
when you have no snapshots, you still have data.
delete the data, delete the dataset, or use zfs send with the destroyable options (I dont know offhand, i usually use the GUI)
the GUI also has an option for destoy everything in the target.
why are you using the command line in the first place?
 

janos66

Dabbler
Joined
Feb 18, 2022
Messages
21
Hi,
yes I know the snapshot is just a reference of the data at a certain point in time, but there was no dataset that I could have deleted, just the zpool which yes is also a dataset
Look I never used the Trunas replication wizard before, e.g if I need a ZFS volume for KVM on my Linux workstation, then this is the command line for it.

Code:
zfs send store01/backup/vm-backup/winwork@30.11.21 | ssh root@10.0.90.55 zfs recv store01/winwork


And I can use it immediately to boot my Windows VM or open the NTFS file system with Dolphin.

The result I wanted in this case, was to move all my datasets back to the main system and not snapshots of which I then have to create clones from.
This is OK and what I want later on when I replicate from my main system to the backup system.

The funny thing is, it worked before, I moved all datasets from Truenas Core to the backup system with zfs send and they were all immediately visible in the gui as a dataset and I was able to access the files.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
just because you can do something doesn't mean you should, and it would likely be easier to do in the GUI, as TrueNAS is designed for, but, again, if there is data, you should be able to use the "nuke everything at the destination and put this there instead" switch, that I dont recall offhand.

im not sure why "snapshots of which I then have to create clones from". if you send a snapshot, it makes the destination exactly match the snapshot, you would only make a clone if you want...a clone of that, specific, snapshot.

some core part of what you are trying to do doesnt make sense to me. maybe somebody else will end up chiming in who understands.
 
Top