27.17. 创建 Stratis 文件系统
在现有 Stratis 池上创建 Stratis 文件系统。
先决条件
-
Stratis 已安装,
stratisd
服务正在运行。如需更多信息,请参阅 安装 Stratis。 - 一个 Stratis 池已创建。如需更多信息,请参阅 创建未加密的 Stratis 池 或使用内核密钥环 中的密钥。
流程
在池中创建 Stratis 文件系统:
stratis filesystem create --size number-and-unit my-pool my-fs
# stratis filesystem create --size number-and-unit my-pool my-fs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow number-and-unit
- 指定文件系统的大小。规格格式必须遵循标准大小规格格式进行输入,即 B、KiB、MiB、GiB、TiB 或 PiB。
my-pool
- 指定 Stratis 池的名称。
my-fs
为文件系统指定一个任意名称。
例如,创建一个 Stratis 文件系统:
stratis filesystem create --size 10GiB pool1 filesystem1
# stratis filesystem create --size 10GiB pool1 filesystem1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
设置文件系统的大小限制:
stratis filesystem create --size number-and-unit --size-limit number-and-unit my-pool my-fs
# stratis filesystem create --size number-and-unit --size-limit number-and-unit my-pool my-fs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意从 Stratis 3.6.0 开始提供这个选项。
如果需要,您还可以稍后删除大小限制:
stratis filesystem unset-size-limit my-pool my-fs
# stratis filesystem unset-size-limit my-pool my-fs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
列出池中的文件系统,以检查是否已创建 Stratis 文件系统:
stratis fs list my-pool
# stratis fs list my-pool
Copy to Clipboard Copied! Toggle word wrap Toggle overflow