ZFS-CLONE(8)

πŸ’– zfs-clone(8) β€” clone snapshot of ZFS dataset πŸ’–

okay bestie, welcome to zfs-clone, a page from the System Manager's Manual (that's the manual name, we're being fancy today πŸ’…). It's got one job and it does it gorgeously: making a clone out of a snapshot. Let's get into it πŸ¦‹


✨ SYNOPSIS ✨

zfs clone [-pu] [-o property=value]… snapshot filesystem|volume

that's it. that's the whole vibe. ✨


🌸 DESCRIPTION 🌸

fr fr, if you want the deep lore, go read the β€œClones” section of zfsconcepts(7) β€” it's giving required reading. πŸ“š

the tea: your target dataset can live anywhere in the ZFS hierarchy, and it gets created as the same type as the original. no cap.

now, the flags, one by one, no skipping, we don't do that here πŸ’–

  • -o property=value β€” sets the specified property. that's it, that's the whole flag. for the deets, go see zfs create (it explains it way better than I could, iykyk). 🌈
  • -p β€” creates all the non-existing parent datasets. iconic. and here's the cute part: datasets made this way get automatically mounted according to the mountpoint property inherited from their parent. πŸͺ„ and if the target filesystem or volume already exists? the operation just completes successfully. no drama, no error, we move on. periodt.
  • -u β€” do not mount the newly created file system. she's created but she's staying home. πŸ™ˆ

πŸŽ€ EXAMPLES πŸŽ€

⭐ Example 1: Creating a ZFS Clone

this command creates a writable file system whose initial contents are the same as pool/home/bob@yesterday. slay.

# zfs clone pool/home/bob@yesterday pool/clone

πŸ”₯ Example 2: Promoting a ZFS Clone

okay this one is the main character moment πŸ‘‘. these 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. chef's kiss.

# zfs create pool/project/production
  populate /pool/project/production with data
# zfs snapshot pool/project/production@today
# zfs clone pool/project/production@today pool/project/beta
  make changes to /pool/project/beta and test them
# zfs promote pool/project/beta
# zfs rename pool/project/production pool/project/legacy
# zfs rename pool/project/beta pool/project/production
  once the legacy version is no longer needed, it can be destroyed
# zfs destroy pool/project/legacy

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, bestie!! this masterpiece came to you from OpenZFS, dated July 11, 2022 β€” like, that's the source and the version and the date, all wrapped up with a bow πŸŽ€. go clone something cute. mwah πŸ’œβœ¨

πŸ“¦ where this page comes from