V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要把任何和邀请码有关的内容发到 NAS 节点。

邀请码相关的内容请使用 /go/in 节点。

如果没有发送到 /go/in,那么会被移动到 /go/pointless 同时账号会被降权。如果持续触发这样的移动,会导致账号被禁用。
Kerwin1202
V2EX  ›  NAS

黑裙 raid1 如何扩容

  •  
  •   Kerwin1202 · 2019-10-11 22:30:22 +08:00 · 3786 次点击
    这是一个创建于 1870 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用的 vm 弄得虚拟机 装的黑裙,当初装的时候,新建了两个虚拟硬盘 150G, 组了个 raid1, 但是现在发现磁盘有点不够,给两个硬盘都扩容到 500G , Nas 里看到的存储池两个硬盘确实是 500G 但是可用还是 150G,

    用网上说的物理硬盘的形式,插拔形式同步替换了好像也不行。

    # mdadm -D /dev/md2
    /dev/md2:
            Version : 1.2
      Creation Time : Thu Dec 20 10:40:21 2018
         Raid Level : raid1
         Array Size : 152464384 (145.40 GiB 156.12 GB)
      Used Dev Size : 152464384 (145.40 GiB 156.12 GB)
       Raid Devices : 2
      Total Devices : 2
        Persistence : Superblock is persistent
    
        Update Time : Fri Oct 11 22:24:17 2019
              State : clean 
     Active Devices : 2
    Working Devices : 2
     Failed Devices : 0
      Spare Devices : 0
    
               Name : Kerwin-NAS:2  (local to host Kerwin-NAS)
               UUID : b3222639:4a6f6d7f:9bcf4491:c47d736f
             Events : 4909
    
        Number   Major   Minor   RaidDevice State
           2       8       51        0      active sync   /dev/sdd3
           3       8       67        1      active sync   /dev/sde3
    
    
    fdisk -l
    Disk /dev/synoboot: 50 MiB, 52428800 bytes, 102400 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: B3CAAA25-3CA1-48FA-A5B6-105ADDE4793F
    
    Device         Start    End Sectors Size Type
    /dev/synoboot1  2048  32767   30720  15M EFI System
    /dev/synoboot2 32768  94207   61440  30M Linux filesystem
    /dev/synoboot3 94208 102366    8159   4M BIOS boot
    
    
    Disk /dev/sdb: 10 GiB, 10737418240 bytes, 20971520 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xb5be3cf2
    
    Device     Boot   Start     End Sectors  Size Id Type
    /dev/sdb1          2048 4982527 4980480  2.4G fd Linux raid autodetect
    /dev/sdb2       4982528 9176831 4194304    2G fd Linux raid autodetect
    
    
    Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x9978bd16
    
    Device     Boot   Start       End   Sectors   Size Id Type
    /dev/sda1          2048   4982527   4980480   2.4G fd Linux raid autodetect
    /dev/sda2       4982528   9176831   4194304     2G fd Linux raid autodetect
    /dev/sda3       9437184 314367999 304930816 145.4G fd Linux raid autodetect
    
    
    Disk /dev/sdc: 500 GiB, 536870912000 bytes, 1048576000 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xd6ac5a88
    
    Device     Boot   Start       End   Sectors   Size Id Type
    /dev/sdc1          2048   4982527   4980480   2.4G fd Linux raid autodetect
    /dev/sdc2       4982528   9176831   4194304     2G fd Linux raid autodetect
    /dev/sdc3       9437184 314367999 304930816 145.4G fd Linux raid autodetect
    
    
    Disk /dev/sdd: 500 GiB, 536870912000 bytes, 1048576000 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xe7a70274
    
    Device     Boot   Start       End   Sectors   Size Id Type
    /dev/sdd1          2048   4982527   4980480   2.4G fd Linux raid autodetect
    /dev/sdd2       4982528   9176831   4194304     2G fd Linux raid autodetect
    /dev/sdd3       9437184 314367999 304930816 145.4G fd Linux raid autodetect
    
    
    Disk /dev/sde: 500 GiB, 536870912000 bytes, 1048576000 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x96888e42
    
    Device     Boot   Start       End   Sectors   Size Id Type
    /dev/sde1          2048   4982527   4980480   2.4G fd Linux raid autodetect
    /dev/sde2       4982528   9176831   4194304     2G fd Linux raid autodetect
    /dev/sde3       9437184 314367999 304930816 145.4G fd Linux raid autodetect
    
    
    Disk /dev/md0: 2.4 GiB, 2549940224 bytes, 4980352 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/md1: 2 GiB, 2147418112 bytes, 4194176 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/zram0: 1 GiB, 1086324736 bytes, 265216 sectors
    Units: sectors of 1 * 4096 = 4096 bytes
    Sector size (logical/physical): 4096 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    
    
    Disk /dev/zram1: 1 GiB, 1086324736 bytes, 265216 sectors
    Units: sectors of 1 * 4096 = 4096 bytes
    Sector size (logical/physical): 4096 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    
    
    Disk /dev/md2: 145.4 GiB, 156123529216 bytes, 304928768 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    

    网上说的比较多的是 grow 但是依旧是 150 G 而不是 500

    # mdadm --grow --size=max /dev/md2
    mdadm: component size of /dev/md2 unchanged at 152464384K
    
    

    然后

    # resize2fs  /dev/md2
    resize2fs 1.42.6 (21-Sep-2012)
    resize2fs: Device or resource busy while trying to open /dev/md2
    Couldn't find valid filesystem superblock.
    

    似乎都不行. 求大佬解答下。

    还是只能采用新的两个硬盘组个新的 raid1,把数据同步到这个新的存储池,删掉旧的。

    5 条回复    2019-10-12 14:33:26 +08:00
    yingfengi
        1
    yingfengi  
       2019-10-11 22:37:08 +08:00 via Android
    不太理解。。。既然是虚拟硬盘,为啥 raid1。。。。
    Kerwin1202
        2
    Kerwin1202  
    OP
       2019-10-11 22:41:33 +08:00
    @yingfengi 当时新建的时候。不太明白就瞎上了。
    xhcnb
        3
    xhcnb  
       2019-10-12 11:15:27 +08:00
    /dev/sdd3 9437184 314367999 304930816 145.4G fd Linux raid autodetect
    /dev/sde3 9437184 314367999 304930816 145.4G fd Linux raid autodetect
    大哥你只扩展了磁盘大小, 组成 ayyay 的两个分区大小没有改啊
    修改 /dev/sdd 和 /dev/sde 的分区表, 把分区 3 改成最大, 再扩展 raid
    Kerwin1202
        4
    Kerwin1202  
    OP
       2019-10-12 14:31:01 +08:00
    @xhcnb。。昨晚后来手一抖升了 raid5 了, 不能试了... 现在打算整个新的 raid0 另外弄备份
    Kerwin1202
        5
    Kerwin1202  
    OP
       2019-10-12 14:33:26 +08:00
    @xhcnb 还是说声多谢。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2722 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:17 · PVG 18:17 · LAX 02:17 · JFK 05:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.