zfs-rename
rename ZFS dataset
- Provided by: zfsutils-linux (Version: 2.4.1-1ubuntu5)
- Source: zfs-linux
- Report a bug
rename ZFS dataset
zfs |
rename [-f]
filesystem|volume|snapshot
filesystem|volume|snapshot |
zfs |
rename -p
[-f]
filesystem|volume
filesystem|volume |
zfs |
rename -u
[-f] filesystem
filesystem |
zfs |
rename -r
snapshot snapshot |
zfs rename
[-f]
filesystem|volume|snapshot
filesystem|volume|snapshotzfs rename
-p [-f]
filesystem|volume
filesystem|volumezfs rename
-u [-f]
filesystem filesystem-f-u flag.-p-uzfs rename
-r snapshot
snapshotThe following commands illustrate how to test out changes to a file system, and then replace the original file system with the changed one, using clones, clone promotion, and renaming:
#zfscreatepool/project/production populate /pool/project/production with data #zfssnapshotpool/project/production@today #zfsclonepool/project/production@today pool/project/beta make changes to /pool/project/beta and test them #zfspromotepool/project/beta #zfsrenamepool/project/production pool/project/legacy #zfsrenamepool/project/beta pool/project/production once the legacy version is no longer needed, it can be destroyed #zfsdestroypool/project/legacy
The following example shows how to maintain a history of snapshots with a consistent naming scheme. To keep a week's worth of snapshots, the user destroys the oldest snapshot, renames the remaining snapshots, and then creates a new snapshot, as follows:
#zfsdestroy-rpool/users@7daysago #zfsrename-rpool/users@6daysago @7daysago #zfsrename-rpool/users@5daysago @6daysago #zfsrename-rpool/users@4daysago @5daysago #zfsrename-rpool/users@3daysago @4daysago #zfsrename-rpool/users@2daysago @3daysago #zfsrename-rpool/users@yesterday @2daysago #zfsrename-rpool/users@today @yesterday #zfssnapshot-rpool/users@today