code: func (r *Root) Create(name string, opts map[string]string) (volume.Volume, error) {
  	if err := r.validateName(name); err != nil {
  		return nil, err
  	}
  
  	r.m.Lock()
  	defer r.m.Unlock()
  
  	v, exists := r.volumes[name]
  	if exists {
  		return v, nil
  	}
  
  	path := r.DataPath(name)
  	if err := idtools.MkdirAllAndChown(path, 0755, r.rootIdentity); err != nil {
  		return nil, errors.Wrapf(errdefs.System(err), "error while creating volume path '%s'", path)
  	}
  
  	var err error
  	defer func() {
  		if err != nil {
  			os.RemoveAll(filepath.Dir(path))
  		}
  	}()
  
  	v = &localVolume{
  		driverName: r.Name(),
  		name:       name,
  		path:       path,
  	}
  
  	if len(opts) != 0 {
  		if err = setOpts(v, opts); err != nil {
  			return nil, err
  		}
  		var b []byte
  		b, err = json.Marshal(v.opts)
  		if err != nil {
  			return nil, err
  		}
  		if err = ioutil.WriteFile(filepath.Join(filepath.Dir(path), "opts.json"), b, 600); err != nil {
  			return nil, errdefs.System(errors.Wrap(err, "error while persisting volume options"))
  		}
  	}
  
  	r.volumes[name] = v
  	return v, nil
  }
docs: // Create creates a new volume.Volume with the provided name, creating
  // the underlying directory tree required for this volume in the
  // process.