Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2013 07:35:40 +1300
From:      Matt Magoffin <matt@msqr.us>
To:        freebsd-fs@freebsd.org
Subject:   ZFS snapshot renames failing after upgrade to 9.2
Message-ID:  <0C9FD4E1-0549-4849-BFC5-D8C5D4A34D64@msqr.us>

next in thread | raw e-mail | index | archive | help

--Apple-Mail=_CE034618-948E-4B68-B279-3900679E6636
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

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-freeb=
sd/

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@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@daily.1                                Wed Nov 13  0:00 2013  =
50.5K  91.0G
zdata/home@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@daily.1
# zfs list -t snapshot -o name,creation,used,referenced |grep zdata/home
zdata/home@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@daily.0 zdata/home@daily.1
# zfs list -t snapshot -o name,creation,used,referenced |grep zdata/home
zdata/home@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@


--Apple-Mail=_CE034618-948E-4B68-B279-3900679E6636
Content-Disposition: attachment;
	filename=smime.p7s
Content-Type: application/pkcs7-signature;
	name=smime.p7s
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDgTCCA30w
ggJloAMCAQICAQIwCwYJKoZIhvcNAQELMGsxEDAOBgNVBAMMB21zcXIgQ0ExDTALBgNVBAoMBG1z
cXIxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MQswCQYDVQQGEwJVUzEZMBcGCSqG
SIb3DQEJARYKY2FAbXNxci51czAeFw0xMzA3MDcyMTI1MTJaFw0yMzA3MDUyMTI1MTJaMHMxFjAU
BgNVBAMMDU1hdHQgTWFnb2ZmaW4xDTALBgNVBAoMBG1zcXIxIDAeBgNVBAsMF0NlcnRpZmljYXRp
b24gQXV0aG9yaXR5MQswCQYDVQQGEwJVUzEbMBkGCSqGSIb3DQEJARYMbWF0dEBtc3FyLnVzMIIB
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA80JsC5zGa1iuzGVegrbX8kpfIpqTsG4yaTGP
2XwgLpsyGzn0tule6d/6qa3OJRUR4pY8qCmFs2yxQoVfJvQNRfQDkBO/T6gyx5ml2CTppyCQiiRe
Ki0BpD2xQB7SJOoKLTEoveWzAdC8sMT+WxYeS8R1i3HFtoth0Ll0u6hP6Ufp0XLOVXdW2jr0l4aY
gn1KSM7KmFmLXDpOFlempaxUTXWLaXjGGDjRi5Ev1a1OTHyfPiA4YmC4/y3Npq2bl88/gxGw7u2Y
zYshKZ0y24o5HxxmoxpE0EGl7Ub7+2osp54SKurKdFo/9wlNNIEPATDVoAT2NPDIOWBtZ9LUvYvH
SQIDAQABoyYwJDAOBgNVHQ8BAf8EBAMCAf4wEgYDVR0lAQH/BAgwBgYEVR0lADANBgkqhkiG9w0B
AQsFAAOCAQEAfuWLLZL5kryMYHEY0EE4cocnBTzXXkhDHUpqoWZ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pSjj/RJ5T+eqY6JT/k1dtsjB+yp862UwzIPtZDa6
tEi1gGA+rATUKjA53goGN1vwzdrDM899b65yV8y9sKiZNWy+IQNvLb4DEYb6MR+4CVZg7kcNHPfQ
kk4dInxIHOLAUFESL31PMqjB2z5oEF+sll//erHveTushOv6CHTM3KiBjjds1PCJsVJRJ+lfwq17
UvTJrIIwORzaPDv4JXsb6FsYRCDJ/pPSgmc+yqcmF/XZWHOFdIFyuOVjBmq2TnpqsKxDrJN7xBOc
b6KuK5Lo9boAAAAAAAA=

--Apple-Mail=_CE034618-948E-4B68-B279-3900679E6636--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0C9FD4E1-0549-4849-BFC5-D8C5D4A34D64>