"zfs receive -F" not destroying snapshots that do not exist on the sending side

claudiu vasadi claudiu.vasadi at gmail.com
Mon Jul 16 14:40:21 UTC 2012


Hello list,

Ono our backup machine, I noticed that the old snapshots do not get
deleted. I checked the script that sends snapshots there and it is using
the "-F" flag for "zfs receive" which, according to the man page, should
delete snapshots that do not exist on the sending side.

In my case, it does not. The machines in question are 9-STABLE (around
r236943) exhibiting no problems what so ever. I tried on other machines and
got the same result.

I did a quick test:
zfs create rpool/test
zfs snapshot rpool/test at snap1
zfs snapshot rpool/test at snap2
zfs snapshot rpool/test at snap3
zfs snapshot rpool/test at snap4
zfs send rpool/test at snap1 | ssh -c arcfour ssh backup.local zfs receive -F
backup/test
zfs send -i snap1 rpool/test at snap2 | ssh -c arcfour ssh backup.local zfs
receive -F backup/test
zfs send -i snap2 rpool/test at snap3 | ssh -c arcfour ssh backup.local zfs
receive -F backup/test
zfs destroy rpool/test at snap1
zfs send -i snap3 rpool/test at snap4 | ssh -c arcfour ssh backup.local zfs
receive -F backup/test


I think, snap1 should be deleted at this stage, but it is not. I also tried
sending the initial snapshot with the "-R" flag but the results were the
same.


Is this expected behavior or some bug ?


-- 
Best regards,
Claudiu Vasadi


More information about the freebsd-fs mailing list