27.19. 在引导时配置挂载一个 Stratis 文件系统
您可以通过设置一个正确启动文件系统池的机制,将 Stratis 文件系统配置为在引导时挂载。如果没有此机制,挂载操作会失败。Stratis 提供两个 systemd 服务来支持此过程。
Stratis 目前不支持管理根文件系统。这些指令只适用于非根文件系统。
先决条件
- Stratis 文件系统(如 <my-fs>)是在 Stratis 池(如 <my-pool>)上创建的。如需更多信息,请参阅 创建一个 Stratis 文件系统。
- 已创建一个挂载点目录,如 <mount-point>。
- 已确定文件系统池的 UUID ,如 <pool-uuid>。
流程
以 root 用户身份编辑
/etc/fstab
文件。将
x-systemd.requires=stratis-fstab-setup@<pool-uuid>.service
添加到文件系统/etc/fstab
条目的挂载选项中:/dev/stratis/<my-pool>/<my-fs> <mount-point> xfs defaults,x-systemd.requires=stratis-fstab-setup@<pool-uuid>.service
/dev/stratis/<my-pool>/<my-fs> <mount-point> xfs defaults,x-systemd.requires=stratis-fstab-setup@<pool-uuid>.service
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果池是通过 Clevis 使用 NBDE (Network Bound Disk Encryption) 加密的,请添加
x-systemd.requires=stratis-fstab-setup-with-network@<pool-uuid>.service
和_netdev
:/dev/stratis/<my-pool>/<my-fs> <mount-point> xfs defaults,x-systemd.requires=stratis-fstab-setup-with-network@<pool-uuid>.service,_netdev
/dev/stratis/<my-pool>/<my-fs> <mount-point> xfs defaults,x-systemd.requires=stratis-fstab-setup-with-network@<pool-uuid>.service,_netdev
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 替换:
- <my-pool> 使用包含文件系统的 Stratis 池的名称替换。
- <my-fs> 使用在池中创建的 Stratis 文件系统的名称替换。
- <mount-point> 使用您要挂载文件系统的目录名称替换。
- <pool-uuid> 使用文件系统的池的 UUID 替换。
在引导时从加密的 Stratis 池挂载 Stratis 文件系统可能会导致引导过程停止,直到提供密码。如果池使用任何无人值守机制(如 NBDE 或 TPM2)加密的,则 Stratis 池将被自动解锁。如果没有解锁,用户可能需要在控制台中输入密码来解锁文件系统的池。