在zfsonlinux中增长zpool

前端之家收集整理的这篇文章主要介绍了在zfsonlinux中增长zpool前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有2x3TB磁盘与GPT和zpool在第一个磁盘(sda4)上使用2.7TB分区,在第二个磁盘(sdb4)上使用1TB.

原因是最初两个磁盘只有1TB,我依次用3TB替换它们.但是在我有1x1TB和1x3TB的时候,我将3TB的剩余部分用于我想要删除的不同分区.

我在Linux上使用最新的ZFS(0.6.5.7-8-wheezy).将池大小调整为2.7TB的正确方法是什么?

autoresize目前已关闭.这是lsblk和zpool状态的当前输出

# lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda       8:0    0   2,7T  0 disk
├─sda1    8:1    0     1M  0 part
├─sda2    8:2    0  14,5G  0 part
│ └─md0   9:0    0  14,5G  0 raid1 /
├─sda3    8:3    0   4,2G  0 part
│ └─md2   9:2    0   4,2G  0 raid1 [SWAP]
└─sda4    8:4    0   2,7T  0 part
sdb       8:16   0   2,7T  0 disk
├─sdb1    8:17   0     1M  0 part
├─sdb2    8:18   0  14,5G  0 raid1 /
├─sdb3    8:19   0   4,2G  0 raid1 [SWAP]
├─sdb4    8:20   0 912,9G  0 part
└─sdb5    8:21   0   1,8T  0 part

# zpool status
  pool: zpradix1imain
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used,but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: resilvered 687G in 6h2m with 0 errors on Fri Dec 26 18:39:27 2014
config:

        NAME                                                STATE     READ WRITE CKSUM
        zpradix1imain                                       ONLINE       0     0     0
          mirror-0                                          ONLINE       0     0     0
            ata-WDC_WD30EZRZ-00WN9B0_WD-WCC4E7CL5U9D-part4  ONLINE       0     0     0
            ata-WDC_WD30EZRX-00D8PB0_WD-WMC4N0E6K1AW-part4  ONLINE       0     0     0

作为第一步,我将删除sdb5并将sdb4(通过gdisk)调整为2.7TB并重新扫描分区表(两个磁盘将具有相同的分区布局).

但是之后?

解决方法

这看起来有点混乱.

但简而言之:

>在zpool上设置autoexpand = on.
>将分区大小调整为合适的大小.
>运行partprobe或重启.
>完成后,使用zpool online -e zpradix1imain ata-WDC_WD30EZRZ-00WN9B0_WD-WCC4E7CL5U9D-part4和zpool online -e zpradix1imain ata-WDC_WD30EZRX-00D8PB0_WD-WMC4N0E6K1AW-part4
>重新加载ZFS模块或重新启动.

zpool online [-e] pool device...

       Brings the specified physical device online.

       This command is not applicable to spares or cache devices.

       -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.
原文链接:https://www.f2er.com/linux/397326.html

猜你在找的Linux相关文章