You can prevent the removal of a ZFS snapshot by using the hold subcommand.

For example, to prevent the snapshot called milestone from deletion, run the

following command:

# zfs hold milestone_hold mypool/projects@my_milestone

The "zfs holds" command will list all current snapshots that are protected

this way (-r for a recursive list):

# zfs holds -r mypool

The TIMESTAMP column in the output of the above command is from when the

hold was created, not the snapshot it holds. The "zfs destroy" command will

echo a "dataset is busy" message on the console when it encounters a hold.

Use "zfs release" to release the hold on the snapshot:

# zfs release milestone_hold mypool/projects@my_milestone

-- Benedict Reuschling

Reply to this note

Please Login to reply.

Discussion

No replies yet.