ZFS snapshot renames failing after upgrade to 9.2

Matt Magoffin matt at msqr.us
Thu Nov 14 18:35:52 UTC 2013


Hello,

I have a system that had been running FreeBSD 9.1 for some time, and I recently upgraded to 9.2. I've been using this simple script to create daily, rotating ZFS snapshots via cron:

http://andyleonard.com/2010/04/07/automatic-zfs-snapshot-rotation-on-freebsd/

Essentially the snapshots are renamed and then a new snapshot is created with the same name as the most recently created snapshot. Since the upgrade to 9.2, however, the snapshots aren't able to be renamed. I end up with an error like this:

cannot rename 'zdata/home': a child dataset already has a snapshot with the new name
cannot create snapshot 'zdata/home at daily.0': dataset already exists

Once that happens, zfs will show two snapshots:

# zfs list -t snapshot -o name,creation,used,referenced |grep zdata/home
zdata/home at daily.1                                Wed Nov 13  0:00 2013  50.5K  91.0G
zdata/home at daily.0                                Thu Nov 14  0:00 2013      0  91.0G

However, trying to list the snapshots results in this error:

# ls .zfs/snapshot/
ls: daily.1: Device busy
daily.0

I can destroy the daily.1 snapshot:

# zfs destroy zdata/home at daily.1
# zfs list -t snapshot -o name,creation,used,referenced |grep zdata/home
zdata/home at daily.0                                Thu Nov 14  0:00 2013      0  91.0G
# ls .zfs/snapshot/
daily.0

Then if I try to rename it like the script would, I end up in the same "Device busy" state:

# zfs rename zdata/home at daily.0 zdata/home at daily.1
# zfs list -t snapshot -o name,creation,used,referenced |grep zdata/home
zdata/home at daily.1                                Thu Nov 14  0:00 2013      0  91.0G
# ls .zfs/snapshot/
ls: daily.1: Device busy

Does anyone have any ideas how to get the renames working?

-- m@

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1724 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20131115/3eb42a5e/attachment.bin>


More information about the freebsd-fs mailing list