You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'd like to be able to create sparse volumes using this library. To do that with zfs command one need to specify -s flag so a function like this would work (it's just a copy of CreateVolume with additional flag in args[2]):
// CreateVolume creates a new ZFS volume with the specified name, size, and
// properties.
// A full list of available ZFS properties may be found here:
// https://www.freebsd.org/cgi/man.cgi?zfs(8).
func CreateSparseVolume(name string, size uint64, properties map[string]string) (*Dataset, error) {
args := make([]string, 4, 5)
args[0] = "create"
args[1] = "-p"
args[2] = "-sV"
args[3] = strconv.FormatUint(size, 10)
if properties != nil {
args = append(args, propsSlice(properties)...)
}
args = append(args, name)
_, err := zfs(args...)
if err != nil {
return nil, err
}
return GetDataset(name)
}
The text was updated successfully, but these errors were encountered:
Hello,
I'd like to be able to create sparse volumes using this library. To do that with
zfs
command one need to specify-s
flag so a function like this would work (it's just a copy ofCreateVolume
with additional flag inargs[2]
):The text was updated successfully, but these errors were encountered: