ZFS创建brance扩展,如mkdir -p

问题描述 投票:0回答:1

如zfs手册中所述,-p与mkdir -p具有相同的作用。我知道{...}是括号扩展。因此,有没有办法在zfs create命令下归档类似文件,或者我遗漏了什么?

zfs create -p -o recordsize=1M tank/media/{movies,music,series}

我收到此错误。:

too many arguments
usage:
        create [-pu] [-o property=value] ... <filesystem>
        create [-ps] [-b blocksize] [-o property=value] ... -V <size> <volume>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow

我在freenas上使用bash / zfs(全新安装)。

bash shell freebsd zfs
1个回答
0
投票

正如@richard-smith在评论中指出的那样,大括号扩展将您的命令扩展为:

zfs create -p -o recordsize=1M tank/media/movies tank/media/music tank/media/series

哪个不正确。要创建多个文件系统,必须使用循环:

for path in tank/media/{movies,music,series}; do zfs create -p -o recordsize=1M "$path"; done
© www.soinside.com 2019 - 2024. All rights reserved.