修复配置错误的镜像zfs池 [英] repairing misconfigured mirrored zfs pool

查看:234
本文介绍了修复配置错误的镜像zfs池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的机器从两个USB设备的镜像zfs池启动.池过去看起来像这样:

My machine boots from a mirrored zfs pool of two USB devices. The pool used to look like this:

sudo zpool status
pool: freenas-boot
state: ONLINE
scan: resilvered 891M in 15h19m with 0 errors on Wed Mar 29 03:29:55 2017
config:

    NAME        STATE     READ WRITE CKSUM
    freenas-boot  ONLINE     0     0     0
      mirror-0  ONLINE       0     0     0
        da0p2   ONLINE       0     0     3
        da1p2   ONLINE       0     0     0

errors: No known data errors

我试图用校验和错误替换介质,但是通过一系列不正确使用的命令,我最终添加"了新驱动器,而不是附加"了它.现在,该池是两个设备的串联,不再镜像:

I tried to replace the media with the checksum error, but through a series of incorrectly used commands I ended up "adding" the new drive instead of "attaching" it. The pool is now a concatenation of two devices and no longer mirrored:

  NAME        STATE     READ WRITE CKSUM
    freenas-boot  ONLINE     0     0     0
      da0p2     ONLINE       0     0     0
      da1p2     ONLINE       0     0     0

我了解到我再也无法从池中删除设备了

I learned that I cannot remove the device from the pool any more and the obvious

 zpool attach -f pool device new_device

命令不起作用.

我计划在第三个和第四个驱动器上镜像所有数据(足够大),然后删除串联的第一个和第二个驱动器.但是,似乎镜像仅在设备基础上起作用.我需要四个设备来进行镜像配置,这是不利的,因为机器外壳内只有两个USB端口.

I planned to mirror all the data on (large enough) third and fourth drives and then get rid of the concatenated first and second. However, it appears that mirroring only works on a device basis. I would need four devices for a mirrored configuration, which is unfavourable as only two USB ports are inside the machine's casing.

向两个设备的可引导镜像池过渡的好方法是什么?请记住,所讨论的机器是服务器,并且其启动失败将使多个用户不满意.

What would be a good way to move towards a bootable mirrored pool of two devices? Please keep in mind that the machine in question is a server and its failure to boot would make several users unhappy.

推荐答案

  1. 递归zfs snapshot您的根池
  2. zfs send/recv将此快照复制到另一个大小相同的存储棒或卷,并配置为单独的根池
  3. 使该单独的根池具有可复制的数据可启动
  4. 重新启动系统并从新的根池启动
  5. 将两个木棍作为镜像添加到新池中,从而破坏了旧木棍
  6. 如果重新镀银完成,请移走最初的木棒或木棒并销毁它
  1. Recursively zfs snapshot your root pool
  2. zfs send/recv this snapshot to another stick or volume of equal size, configured as a separate root pool
  3. Make this separate root pool with your copied data bootable
  4. Reboot the system and boot from your new root pool
  5. Add both sticks as mirrors to the new pool, thereby destroying the old one
  6. If resilvering has finished, remove the initial stick or volume and destroy it

您现在有了一个带有两个初始杆的正确镜像池.

You now have a correctly mirrored pool with both initial sticks.

这篇关于修复配置错误的镜像zfs池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆