| 20 | In first place, we would create a snapshot of the filesystem. This would not have any additional cost, since zfs snapshots only require disk space if the files are modified. |
| 21 | |
| 22 | {{{ |
| 23 | # zfs snapshot tank/test/datasetA@today |
| 24 | # zfs list -r tank/test |
| 25 | NAME USED AVAIL REFER MOUNTPOINT |
| 26 | tank/test 104M 66.2G 23K /tank/test |
| 27 | tank/test/datasetA 104M 66.2G 104M /tank/test/productA |
| 28 | tank/test/datasetA@today 0 - 104M - |
| 29 | }}} |
| 30 | |
| 31 | Now, we can change dataset attributes, for example, via ncatted and we would have two datasets: the modified one "tank/test/datasetA" and the legacy one "tank/test/datasetA@today" having required only the disk space for the original dataset. |
| 32 | |
| 33 | We also can make clones of the {{{tank/test/datasetA@today}}} in order to modify the legacy dataset, since zfs snapshots are read-only filesystems. |
| 34 | |
| 35 | {{{ |
| 36 | # zfs clone tank/test/datasetA@today tank/test/datasetA |
| 37 | # zfs list -r tank/test |
| 38 | NAME USED AVAIL REFER MOUNTPOINT |
| 39 | tank/test 104M 66.2G 23K /tank/test |
| 40 | tank/test/datasetA 104M 66.2G 104M /tank/test/datasetA |
| 41 | tank/test/datasetA@today 0 - 104M - |
| 42 | tank/test/datasetAClone 0 66.2G 104M /tank/test/datasetAClone |
| 43 | }}} |
| 44 | |
| 45 | This clone can be promoted in case we need to use the legacy dataset again. |
| 46 | |
| 47 | {{{ |
| 48 | # zfs promote tank/test/datasetAClone |
| 49 | # zfs list -r tank/test |
| 50 | NAME USED AVAIL REFER MOUNTPOINT |
| 51 | tank/test 104M 66.2G 23K /tank/test |
| 52 | tank/test/datasetA 0 66.2G 104M /tank/test/datasetA |
| 53 | tank/test/datasetA@today 0 - 104M - |
| 54 | tank/test/datasetAClone 104M 66.2G 104M /tank/test/datasetAClone |
| 55 | }}} |
| 56 | |
| 57 | For more information see http://docs.oracle.com/cd/E19253-01/819-5461/gbcxz/index.html. |