我有一个ZFS池,在RAID 10配置中有6个磁盘。
我想升级镜像中的驱动器,从1TB升级到3TB驱动器。我把所有的驱动器都安装在系统里了。
我不想通过更换一个驱动器,再银,重复。是否有一种方法可以执行我从现有镜像中读取的所有数据,保留我正在删除的驱动器上的所有磨损?
root@e7-4860:~# zpool status
pool: stuffpoll
state: ONLINE
scan: scrub repaired 0 in 6h50m with 0 errors on Sun Dec 10 07:14:34 2017
config:
NAME STATE READ WRITE CKSUM
stuffpoll ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ata-HGST_HTS721010A9E630_JR10004M0LGN6E-part1 ONLINE 0 0 0
ata-HGST_HTS721010A9E630_JR10004M0M17TE-part1 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
ata-HGST_HTS541010A9E680_JA1000102MG9UR-part1 ONLINE 0 0 0
ata-HGST_HTS541010A9E680_JA1009C03158BP-part1 ONLINE 0 0 0
mirror-2 ONLINE 0 0 0
ata-HGST_HTS721010A9E630_JR100X6P2TJKVE ONLINE 0 0 0
ata-HGST_HTS721010A9E630_JR100Y4M01200M ONLINE 0 0 0
errors: No known data errors
root@e7-4860:~# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
stuffpoll 2.72T 2.47T 254G - 48% 90% 1.00x ONLINE -
root@e7-4860:~# ls /dev/disk/by-id/ -1
ata-CT240BX200SSD1_1613F0194817
ata-CT240BX200SSD1_1613F0194817-part1
ata-HGST_HTS541010A9E680_JA1000102MG9UR
ata-HGST_HTS541010A9E680_JA1000102MG9UR-part1
ata-HGST_HTS541010A9E680_JA1000102MG9UR-part9
ata-HGST_HTS541010A9E680_JA1009C03158BP
ata-HGST_HTS541010A9E680_JA1009C03158BP-part1
ata-HGST_HTS541010A9E680_JA1009C03158BP-part9
ata-HGST_HTS721010A9E630_JR10004M0LGN6E
ata-HGST_HTS721010A9E630_JR10004M0LGN6E-part1
ata-HGST_HTS721010A9E630_JR10004M0LGN6E-part9
ata-HGST_HTS721010A9E630_JR10004M0M17TE
ata-HGST_HTS721010A9E630_JR10004M0M17TE-part1
ata-HGST_HTS721010A9E630_JR10004M0M17TE-part9
ata-HGST_HTS721010A9E630_JR100X6P2TJKVE
ata-HGST_HTS721010A9E630_JR100X6P2TJKVE-part1
ata-HGST_HTS721010A9E630_JR100X6P2TJKVE-part9
ata-HGST_HTS721010A9E630_JR100Y4M01200M
ata-HGST_HTS721010A9E630_JR100Y4M01200M-part1
ata-HGST_HTS721010A9E630_JR100Y4M01200M-part9
scsi-35000c50055fb009b
scsi-35000c50055fb395f我希望最终将mirror-1中的驱动器替换为scsi-35000c50055fb009b和scsi-35000c50055fb395f
发布于 2017-12-13 18:41:19
如果您想手动展开卷,只需使用-e选项将其联机。
zpool online -e stuffpoll您还可以切换自动展开选项,使其自动发生。
zpool set autoexpand=on stuffpoll因此,假设您正在增加镜像-2的新驱动器,这样您就可以扩展它。您需要附加新的驱动器,使用一个现有的设备名称作为目标。在删除旧设备之前,可以将这两个新设备添加到镜像中。
# zpool attach pool existing_vdev_member new_device
zpool attach stuffpoll ata-HGST_HTS721010A9E630_JR100X6P2TJKVE new_dev1
zpool attach stuffpoll ata-HGST_HTS721010A9E630_JR100X6P2TJKVE new_dev2完成新设备的同步后,可以删除旧设备。
zpool detach stuffpoll ata-HGST_HTS721010A9E630_JR100X6P2TJKVE
zpool detach stuffpoll ata-HGST_HTS721010A9E630_JR100Y4M01200M曼兹普尔
zpool attach [-f] pool device new_device
Attaches new_device to an existing zpool device. The existing device
cannot be part of a raidz configuration. If device is not currently
part of a mirrored configuration, device automatically transforms
into a two-way mirror of device and new_device. If device is part of
a two-way mirror, attaching new_device creates a three-way mirror,
and so on. In either case, new_device begins to resilver immediately.
...
zpool detach pool device
Detaches device from a mirror. The operation is refused if there are
no other valid replicas of the data. If device may be re-added to
the pool later on then consider the zpool offline command instead.
...
zpool online [-e] pool device ...
Brings the specified physical device online.
-e Expand the device to use all available space. If the device
is part of a mirror or raidz then all devices must be
expanded before the new space will become available to the
pool.链接
还有,我想提醒大家。首先验证备份/还原。总是有可能发生一些不好的事情。还可以考虑在测试机器/VM上构建一个zfs池,并提前练习您的命令。
https://serverfault.com/questions/887543
复制相似问题