I know that zfs promote swaps a clone with the master, but other than that the documentation does not mention anything.
What consequences have promoting a dataset?
Can I just promote them back and forth any time I need to delete one, or will it be a problem at some point?
Will promoting move/create extra files on the disk?
Will it cause the dataset to use more space?
Lets take this system for example (for simplicity I assumed making a snapshot and then cloning it as one step called clone):
- /data/project-1/master
- /data/project-1/master/file-1 - 1GB file
- /data/project-1/feature-1
- clone of /data/project-1/master
- /data/project-1/feature-1/file-2 - 1GB file
- /data/project-1/feature-2
- clone of /data/project-1/master
- /data/project-1/feature-2/file-3 - 1GB file
- /data/project-1/feature-3
- clone of /data/project-1/feature-2
- /data/project-1/feature-2/file-4 - 1GB file
Now lets assume I want to delete master, I will promote random feature, so what will happen?
- If I promote feature-2, will both feature-1 and feature-2 now require its own independent copy of file-1 duplicating required space?
- Will I be able to delete master after promoting feature-2, or will it be in the tree between feature-2 and feature-1 blocking the ability to delete?
- Do I need to promote feature-3 to be able to delete feature-2
- Will I be even able to delete feature-2 without deleting either master or feature-3
- Will the operation be atomic or will it take time depending on size of the files in the filesystem.
- Is promote just modifying metadata or will it be moving physical data on the drive?
- Is there any risk of data loss?
zfs promote
, how does it work?".