Date: Fri, 10 Jun 2011 21:51:02 -0400 From: Jason Hellenthal <jhell@DataIX.net> To: Arnaud Houdelette <tzim@tzim.net> Cc: freebsd-stable@freebsd.org Subject: Re: Renaming ZFS datasets without unmount. Message-ID: <20110611015101.GA52847@DataIX.net> In-Reply-To: <ce2fa757f4945381a18f842f1f58ab03@tzim.net> References: <ce2fa757f4945381a18f842f1f58ab03@tzim.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Arnaud, On Wed, Jun 08, 2011 at 03:18:36PM +0200, Arnaud Houdelette wrote: >=20 > When I try to rename a mounted dataset with open files, I get the=20 > following error : >=20 > [carenath] /home/tzim# zfs rename unsafe/tmp unsafe/temp > cannot unmount '/tmp': Device busy >=20 > The mountpoint property is set locally : >=20 > [carenath] /home/tzim# zfs get mountpoint unsafe/tmp > NAME PROPERTY VALUE SOURCE > unsafe/tmp mountpoint /tmp local >=20 >=20 > zfs(1M) says : >=20 > Renamed file systems can inherit new mount points, in which case=20 > they are unmounted and remounted at the new mount point. >=20 >=20 > But here, the mountpoint should not change. So the file system does not= =20 > need to be remounted ... >=20 > Either I don't understand something, or there's an "error" in the man,=20 > or a bug in zfs rename. >=20 I think your confusion here is coming from the word 'rename' which is not operating at the file-level but at the VFS level. And in order to rename filesystem objects on any filesystem that I know of these days you need to free it by 'unmount' before you can perform any other operation on it that would dereference its name. Any other condition could result in a panic condition and also there is no way for the proccesses that were using it to be notified it was being moved. Generally filesystems like /tmp would not normally be renamed after they are created anyway and planning your filesystem layout properly will prevent from having too much downtime or maintenance time. AFAIS the correct description and result from using such commands is adequate to the results that can be obtained and the administrators knowledge of filesystems. Noone would dream of renaming /dev/ad0s1a while in operation so I think the same thing could be thought of 'zfs rename'. Think of datasets as devices. > It could be great if zfs allowed "live" renaming of mounted filesystem,= =20 > as It can avoid headaches... >=20 --=20 "Unity can only be manifested by the Binary. Unity itself and the idea of U= nity are already two." -- Buddha Regards, (jhell) Jason Hellenthal --SUOF0GtieIMvvwua Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJN8soFAAoJEJBXh4mJ2FR+UvAH/2PrOKkVeb1u7OO2YyXZznz9 NVDzNqnGArkk914pNdmVfp9YujUwal6rdVBmZ8APRmduP+zWL1Grgl4/4zn4Hsby BWlHUxSvnsQmCjf5HRe4F5O3mjm6tQ+Ucj5vIZyVH36CKBsQtbP+MUOyDm+8Hu06 kDo3ICZLlW16wK/6+A4F+G74r3bC6aro8wu8oe3S5LMqQB1TUl20qoUiC9AY1CrV h3Vbxhn+jP7RIDTnWGv5NjGmI/71nlSba6BArUR33QTEUIbb5JgnsBZOuyFf7Frs jAfhtQlLEKjVV78ve+q6JlnKnTi5Anqo3plnudX4iWUxISjaaXm1Z+Ai0eoZonM= =rBVy -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110611015101.GA52847>