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

Adding more mirrored vdevs to a ZFS pool on Ubuntu

· 52CE 我爱测

I'm on Ubuntu 16.04.1 LTS and I have a ZFS pool named unas containing two mirrored drives. I have now attached two more drives and I want to add these new drives to my unas pool as a pair of mirrored drives so that I end up with …

问题原文

原帖链接 · Stephen Graham · CC BY-SA 3.0

I'm on Ubuntu 16.04.1 LTS and I have a ZFS pool named unas containing two mirrored drives. I have now attached two more drives and I want to add these new drives to my unas pool as a pair of mirrored drives so that I end up with one pool, named unas, which contains 4 drives, grouped into mirrored pairs.

The results of the zpool status command, shown below, show my current configuration. What steps and commands do I use to mirror the two new drives and then add those mirrored drives to my unas pool?

Is it as simple as using the following command to add the two new drives as a mirrored pair?

$ zpool add unas mirror newDrive1 newDrive2

The results of my current zpool status are:

$ sudo zpool status
pool: unas
state: ONLINE
scan: scrub repaired 1.50M in 36h3m with 0 errors on Thu Jun  9 08:06:41 2016

config:

NAME                                          STATE     READ WRITE CKSUM
unas                                          ONLINE       0     0     0
  mirror-0                                    ONLINE       0     0     0
    ata-WDC_WD30EFRX-68EUZN0_WD-WCC4N1VUU0LX  ONLINE       0     0     0
    ata-WDC_WD30EFRX-68EUZN0_WD-WCC4N7FSX6F9  ONLINE       0     0     0

errors: No known data errors

已采纳解答

原帖链接 · user121391 · CC BY-SA 3.0

Yes, it is.

If you are unclear about such things in the future, just test them out with small files on your old pool first. You can create pools from regular files as long as their size is at least 64MB. The commands are the same, just give it the full paths of the files instead of the device paths.

On Solaris this would be:

# create your test files
cd /yourpool/yourfs
mkfile 100m sd0 sd1 sd2 sd3

# create pool
zpool create testpool mirror /yourpool/yourfs/sd0 /yourpool/yourfs/sd1
zpool status testpool

# expand pool
zpool add testpool mirror /yourpool/yourfs/sd2 /yourpool/yourfs/sd3
zpool status

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

资料来源与适用范围

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

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

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