大网数据广告活动
服务器运维问答

ZFS on Linux: Which mountpoint option when mounting manually per script?

· 52CE 我爱测

I want to create a zpool with ZFS on Linux (7.13) on Debian Buster. The problem is that the pool will be created based on LUKS encrypted drives (not root, only external). These drives are decrypted and loaded during boot by a scr…

问题原文

原帖链接 · MelBourbon · CC BY-SA 4.0

I want to create a zpool with ZFS on Linux (7.13) on Debian Buster. The problem is that the pool will be created based on LUKS encrypted drives (not root, only external). These drives are decrypted and loaded during boot by a script which i created since they are pulling a key file from an external source.

To avoid any issues with timing where the system wants to mount the zpool before the drives are decrypted and loaded I would like to mount the pool also manually as part of the script.

Now I ask myself which option I should choose for the mountpoint at creating the pool: none or legacy

The man page does not really help what the real difference is:

If a file system's mount point is set to legacy ZFS makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system. Because pools must be imported before a legacy mount can succeed, administrators should ensure that legacy mounts are only attempted after the zpool import process finishes at boot time. For example, on machines using systemd, the mount option

Does anybody know the real differences and how to achieve a manual mounting later by script the best way?

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

I've been using ZFS pools on LUKS encrypted volumes for the better part of a decade. It works fine.

There is no reason to mount the pool manually to attempt to defeat nonexistent timing problems. Just create your pool normally and enjoy.

To avoid any problems in the future, when creating and managing the pool, use the names beginning with luks- in the /dev/mapper directory to refer to the devices. For example, the devices:

lrwxrwxrwx. 1 root root 10 Jul 26 22:22 luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1046856 -> ../../dm-5
lrwxrwxrwx. 1 root root 10 Jul 26 22:22 luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1145175 -> ../../dm-4
lrwxrwxrwx. 1 root root 10 Jul 26 22:22 luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1165144 -> ../../dm-2
lrwxrwxrwx. 1 root root 10 Jul 26 22:22 luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WMC1P0DHH53R -> ../../dm-3

correspond to:

  pool: srv
 state: ONLINE
  scan: scrub repaired 0B in 0h42m with 0 errors on Tue Jul 30 14:42:04 2019
config:

        NAME                                                 STATE     READ WRITE CKSUM
        srv                                                  ONLINE       0     0     0
          mirror-0                                           ONLINE       0     0     0
            luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1046856  ONLINE       0     0     0
            luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1145175  ONLINE       0     0     0
          mirror-1                                           ONLINE       0     0     0
            luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1165144  ONLINE       0     0     0
            luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WMC1P0DHH53R  ONLINE       0     0     0

This pool is created with:

zpool create -o ashift=12 srv \
    mirror \
        luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1046856 \
        luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1145175 \
    mirror \
        luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WCC1P1165144 \
        luks-ata-WDC_WD2000FYYZ-01UL1B1_WD-WMC1P0DHH53R

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-08-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。