TxAggieEngineer
Dabbler
- Joined
- Apr 25, 2023
- Messages
- 16
I was testing using ZFS replication to get a snapshot of a test dataset over to a new system, then making the transferred data accessible on the new system. I'm a bit fuzzy about how the whole snapshot-dataset relationship functions. When I first transferred the snapshot to the "replication" dataset, everything is as I would expect it:
root@hq-nas-4[~]# zfs get -r origin data
NAME PROPERTY VALUE SOURCE
data origin - -
data/replication origin - -
data/replication@auto-2023-05-24_12-38 origin - -
Then I cloned the snapshot to a new dataset called "new". Everything still makes sense at this point:
root@hq-nas-4[~]# zfs get -r origin data
NAME PROPERTY VALUE SOURCE
data origin - -
data/new origin data/replication@auto-2023-05-24_12-38 -
data/replication origin - -
data/replication@auto-2023-05-24_12-38 origin - -
I want to be able to delete the snapshot but I need to "promote" the "new" dataset, which I did. This shows "new" is no longer linked to the snapshot. Again, that part makes sense:
root@hq-nas-4[~]# zfs promote data/new
root@hq-nas-4[~]# zfs get -r origin data
NAME PROPERTY VALUE SOURCE
data origin - -
data/new origin - -
data/new@auto-2023-05-24_12-38 origin - -
data/replication origin data/new@auto-2023-05-24_12-38 -
The thing that does not make sense is it now shows the "replication" dataset is linked to the snapshot. Why is that? The system says there is a dependent clone when I try to delete the snapshot but "replication" was there before the snapshot was ever copied over so why would it now be thought of as a dependent clone? I thought "promote" would simply "unlink" the dataset from the source snapshot and put everything back to the way it was.
root@hq-nas-4[~]# zfs get -r origin data
NAME PROPERTY VALUE SOURCE
data origin - -
data/replication origin - -
data/replication@auto-2023-05-24_12-38 origin - -
Then I cloned the snapshot to a new dataset called "new". Everything still makes sense at this point:
root@hq-nas-4[~]# zfs get -r origin data
NAME PROPERTY VALUE SOURCE
data origin - -
data/new origin data/replication@auto-2023-05-24_12-38 -
data/replication origin - -
data/replication@auto-2023-05-24_12-38 origin - -
I want to be able to delete the snapshot but I need to "promote" the "new" dataset, which I did. This shows "new" is no longer linked to the snapshot. Again, that part makes sense:
root@hq-nas-4[~]# zfs promote data/new
root@hq-nas-4[~]# zfs get -r origin data
NAME PROPERTY VALUE SOURCE
data origin - -
data/new origin - -
data/new@auto-2023-05-24_12-38 origin - -
data/replication origin data/new@auto-2023-05-24_12-38 -
The thing that does not make sense is it now shows the "replication" dataset is linked to the snapshot. Why is that? The system says there is a dependent clone when I try to delete the snapshot but "replication" was there before the snapshot was ever copied over so why would it now be thought of as a dependent clone? I thought "promote" would simply "unlink" the dataset from the source snapshot and put everything back to the way it was.