I had a pool, p, with a filesystem p/local, mounted at /local. In that are several workspace filesystems, including "/local/ws/install-nv". I used "mv" from /local/ws to change install-nv to nv-install. it worked. nothing seemed wrong, except the output of "zfs list". Then I remembered there was "zfs rename". What state was I in, after the mv? Should mv have worked? Would I have lost that rename on reboot?...where''s the gas station at?...
I had a pool, p, with a filesystem p/local, mounted at /local. In that are several workspace filesystems, including "/local/ws/install-nv". I used "mv" from /local/ws to change install-nv to nv-install. it worked. nothing seemed wrong, except the output of "zfs list". Then I remembered there was "zfs rename". What state was I in, after the mv? Should mv have worked? Would I have lost that rename on reboot?...where''s the gas station at?...
Yes, you can rename mountpoints, and always have been able to. It just didn''t happen much before the arrival of ZFS. When you reboot the machine, it would have tried to mount the filesystem in the original location. Under ZFS, this would have created a new mountpoint for you. With UFS, you would have failed to mount the filesystem at all. While this could theoretically be solved for the "target is a mountpoint", I''m not sure if it can be done and still be standards compliant, and it certainly can''t be solved for arbitrary cases (rename /foo/bar, when /foo/bar/baz is a mountpoint). - Eric On Wed, Jul 25, 2007 at 03:33:36PM -0700, Dan Mick wrote:> I had a pool, p, with a filesystem p/local, mounted at /local. In that are > several workspace filesystems, including "/local/ws/install-nv". > > I used "mv" from /local/ws to change install-nv to nv-install. > > it worked. nothing seemed wrong, except the output of "zfs list". > > Then I remembered there was "zfs rename". > > What state was I in, after the mv? Should mv have worked? Would I have lost > that rename on reboot?...where''s the gas station at?... > > > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
Michael Schuster
2007-Jul-26 06:23 UTC
[zfs-discuss] left over mount points [was: ''mv'' and zfs filesystems]
Eric Schrock wrote:> Yes, you can rename mountpoints, and always have been able to. It just > didn''t happen much before the arrival of ZFS. When you reboot the > machine, it would have tried to mount the filesystem in the original > location. Under ZFS, this would have created a new mountpoint for you.this reminded me of something I''ve been wanting to ask for some time ... sorry for highjacking a thread ;-). in the past, I''ve sometimes done things like: - have some stuff in /path/to/storage (ufs) - decided that that stuff might just as well live on/in zfs - "zfs creat"ed /path/to/storage.copy (with implicit creation of the mountpoint), copied data from storage to storage.copy - mv /path/to/storage to /path/to/storage.old - zfs set mountpoint=/path/to/storage <volname> when this whole dance is done, I''m left with an empty directory /path/to/storage.copy; since zfs created this directory in the first place, is it an unreasonable expectation that zfs remove it as well? Michael -- Michael Schuster Sun Microsystems, Inc. Recursion, n.: see ''Recursion''
Eric Schrock
2007-Jul-26 16:33 UTC
[zfs-discuss] left over mount points [was: ''mv'' and zfs filesystems]
If you look at callers of remove_mountpoint() in libzfs, you''ll see that it does remove the mountpoint, but only for inherited or default directories. We have no way to know for sure whether the mountpoint was originally created by ZFS or not, so we can only guess based on the current mountpoint. For inherited mountpoints, it''s reasonably safe to assume that ZFS created in the first place. For explicit mountpoints, we cannot be sure that the administrator wanted the directory automatically managed or not. - Eric On Thu, Jul 26, 2007 at 08:23:20AM +0200, Michael Schuster wrote:> Eric Schrock wrote: > > Yes, you can rename mountpoints, and always have been able to. It just > > didn''t happen much before the arrival of ZFS. When you reboot the > > machine, it would have tried to mount the filesystem in the original > > location. Under ZFS, this would have created a new mountpoint for you. > > this reminded me of something I''ve been wanting to ask for some time ... > sorry for highjacking a thread ;-). > > in the past, I''ve sometimes done things like: > - have some stuff in /path/to/storage (ufs) > - decided that that stuff might just as well live on/in zfs > - "zfs creat"ed /path/to/storage.copy (with implicit creation of the > mountpoint), copied data from storage to storage.copy > - mv /path/to/storage to /path/to/storage.old > - zfs set mountpoint=/path/to/storage <volname> > > when this whole dance is done, I''m left with an empty directory > /path/to/storage.copy; since zfs created this directory in the first place, > is it an unreasonable expectation that zfs remove it as well? > > Michael > -- > Michael Schuster Sun Microsystems, Inc. > Recursion, n.: see ''Recursion'' > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock