Re: How can I tell when ZFS has finished creating a snapshot?

From: Karl Denninger <karl_at_denninger.net>
Date: Fri, 10 Jan 2025 19:01:26 UTC
On 1/10/2025 1:52 PM, andy thomas wrote:
> Is there any way I can find out when a ZFS snapshot has completed and 
> can be used, say, for replicating to another server?
>
> Using the 'zfs snapshot -r ...' command, the command prompt re-appears 
> almost immediately suggesting the command has completed and using the 
> 'zfs list -t snapshot' command the 'USED' column will initially report 
> zero and then it will slowly grow over the next few hours. But it 
> seems to take a long time with no zfs-related processes being reported 
> by 'ps ax'. For example, after 3 hours, a snapshot of a 80TB raidz1 
> pool with only a little over 3 TB used has reported 17.4MB used:
>
>     NAME                              USED  AVAIL  REFER MOUNTPOINT
> clustor2/ma@2025-01-10_14.45.00  17.4M      -  3.09T  -
>
> but over the next hour, this 17.4MB usage figure has not increased at 
> all. So I don't know whether to wait another few hours before using 
> 'zfs send' or 'zxfer' to copy the snapshot to a backup server, or 
> whether the snapshot has in fact finished.
>
> Is there a way to find out the status of a snapshot creation?
>
> Thanks in advance for any suggestions,

The snapshot is complete when the command returns -- within the 
filesystem a snapshot is an atomic operation.

/Once made all writes to that filesystem are copy-on-write /so as time 
goes on the "Used" amount increases (and the free space goes down by an 
equal amount) because each block that is modified (and only that block) 
is copied.

-- 
Karl Denninger
karl@denninger.net
/The Market Ticker/
/[S/MIME encrypted email preferred]/