I am sponsoring the following fast-track for Lori Alt. It introduces
the ability to mount a ZFS dataset at a mountpoint other than the
current value of the dataset's persistent mountpoint property.  The case
requests micro/patch binding.

Template Version: @(#)sac_nextcase 1.70 03/30/10 SMI
This information is Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
1. Introduction
    1.1. Project/Component Working Name:
         Temporary ZFS mounts
    1.2. Name of Document Author/Supplier:
         Author:  Lori Alt
    1.3  Date of This Document:
        12 April, 2010

4. Technical Description

File systems such as UFS support the ability to mount a file system
at a mountpoint other than the file system's persistent mountpoint
(which, in the case of UFS, is the mountpoint specified in the
file systems's /etc/vfstab entry).  This ability is especially useful
when maintaining boot environments (that is, root file systems), whose
persistent mountpoint is always "/", but cannot actually be mounted at that
location for maintenance purposes, because the root is already occupied.
There are other circumstances when a temporary mount is useful also.

Non-legacy ZFS mounts do not currently support temporary mounts.  The
only way to mount a dataset at a temporary location is to modify the
dataset's "mounpoint" property, and then set it back to the original
value after the temporary mount is no longer needed.  This is cumbersome,
and can lead to systems left in an incorrect state if the system goes
down before the the mountpoint can be set back to its correct, permanent
value.

4.1. Proposal

A new temporary mount property will be defined for the "zfs mount" command.
Currently, the -o option to "zfs mount" can be used to set temporary
values for the following properties: devices, exec, readonly, setuid,
and xattr.  It will now be possible to assign a temporary "mountpoint"
property.  The file system will be mounted at the temporary mountpoint
and the persistent "mountpoint"  property for the dataset will not change.

The temporary mountpoint must already exist and must be an empty directory.

If the dataset is already mounted (in any way, by zfs mount or legacy mount
or another temporary mount), executing "zfs mount" with the
"-o mountpoint=<mntpt>" option will fail.

Temporary mountpoints are not inherited.  If a hierarchy of datasets are
to be mounted at a temporary location, each dataset must be explicitly
mounted.  So if these datasets exist:

    tank/a
    tank/a/b

The following commands would be necessary to mount them temporarily
at /alt :

    zfs mount -o  mountpoint=/alt  tank/a
    zfs mount -o  mountpoint=/alt/b  tank/a/b

The capability to do temporary mounts can be delegated to non-privileged
users with the "zfs allow" command, but the mount will only succeed if the
user has write privileges on the mountpoint.

4.2. Man Page Changes:

*** zfs.1m.orig Fri Apr  9 16:10:09 2010
--- zfs.1m.modified     Fri Apr  9 16:13:21 2010
***************
   Temporary Mount Point Properties
     When a file system is mounted, either through mount(1M)  for
     legacy  mounts or the zfs mount command for normal file sys-
     tems, its mount options are set according to its properties.
     The  correlation  between properties and mount options is as
     follows:

           PROPERTY                MOUNT OPTION
            devices                 devices/nodevices
            exec                    exec/noexec
            readonly                ro/rw
            setuid                  setuid/nosetuid
            xattr                   xattr/noxattr
+           mountpoint              mountpoint

       In addition, these options can be set on a  per-mount  basis
       using  the -o option, without affecting the property that is
***************
*** 17,22 ****
       stored on disk. The values specified  on  the  command  line
       override  the  values  stored  in  the  dataset. The -nosuid
       option is an alias for nodevices,nosetuid. These  properties
!      are  reported  as "temporary" by the zfs get command. If the
!      properties are changed while the dataset is mounted, the new
!      setting overrides any temporary settings.
--- 18,26 ----
       stored on disk. The values specified  on  the  command  line
       override  the  values  stored  in  the  dataset. The -nosuid
       option is an alias for nodevices,nosetuid. These  properties
!      are  reported  as "temporary" by the zfs get command. For
!      properties other than "mountpoint", if the properties are
!      changed while the dataset is mounted, the new setting overrides
!      any temporary settings. The "mountpoint" property cannot be
!      changed while a temporary mountpoint property is in effect
!      (that is, while the dataset is mounted at a temporary location).


6. Resources and Schedule
     6.4. Steering Committee requested information
         6.4.1. Consolidation C-team Name:
                 ON
     6.5. ARC review type: FastTrack
     6.6. ARC Exposure: open
_______________________________________________
opensolaris-arc mailing list
opensolaris-arc@opensolaris.org

Reply via email to