我们有一个 Synology RS3614rpxs NAS 头,包含 (9) 个 3TB 硬盘驱动器,位于 RAID 6 + 1 热备件中。存储空间耗尽,我们添加了一个扩展机箱,其中安装了 5TB 硬盘驱动器,目的是创建第二个阵列(也就是 RAID 6)。
Synology 似乎是使用标准 linuxmd
来形成 RAID 阵列,LVM
在顶部形成卷组(由底层md
设备组成),然后是逻辑卷。
在引入扩展机箱期间,意外将 3 个磁盘添加到第一个阵列 ( md2
)。一个问题,因为我们正在失去 5TB 磁盘上的可用空间。其余磁盘似乎已添加到第二个阵列 ( md3
)。md3
似乎已添加到现有卷组vg1.
我们的目标:
md3
如有必要,从vg1
逻辑卷中删除并调整其大小。- 销毁
md3
并使其磁盘可供重新利用。
问题:我们如何才能最好地实现这些目标?
对于上下文:
“df -h”的输出
Filesystem Size Used Available Use% Mounted on
/dev/md0 2.3G 637.9M 1.6G 28% /
/tmp 1.9G 404.0K 1.9G 0% /tmp
/run 1.9G 3.8M 1.9G 0% /run
/dev/shm 1.9G 0 1.9G 0% /dev/shm
/dev/vg1/volume_3 2.4T 1.2T 1.2T 49% /volume3
/dev/vg1/volume_1 5.8T 2.9T 2.9T 49% /volume1
/dev/vg1/volume_2 10.7T 10.2T 443.5G 96% /volume2
“lvdisplay”的输出
--- Logical volume ---
LV Name /dev/vg1/syno_vg_reserved_area
VG Name vg1
LV UUID agGo1D-0811-miWz-ro0e-Nsvo-YdO9-XRJQY4
LV Write Access read/write
LV Status available
# open 0
LV Size 12.00 MB
Current LE 3
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 384
Block device 253:0
--- Logical volume ---
LV Name /dev/vg1/volume_1
VG Name vg1
LV UUID 3oehZK-Bv5V-T1RL-MWfY-VQnh-tsrr-tXn3v9
LV Write Access read/write
LV Status available
# open 1
LV Size 5.86 TB
Current LE 1536000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 253:1
--- Logical volume ---
LV Name /dev/vg1/volume_2
VG Name vg1
LV UUID 3VMQE8-BG0Y-K0jC-Y2Rz-ID09-0dAs-XqTavU
LV Write Access read/write
LV Status available
# open 1
LV Size 10.74 TB
Current LE 2816000
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 253:2
--- Logical volume ---
LV Name /dev/vg1/volume_3
VG Name vg1
LV UUID mGs4IT-7QM8-PFF2-TD3O-SGzo-QaKp-33DrrW
LV Write Access read/write
LV Status available
# open 1
LV Size 2.47 TB
Current LE 647706
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 253:3
“vgdisplay”的输出
--- Volume group ---
VG Name vg1
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 40.88 TB
PE Size 4.00 MB
Total PE 10715889
Alloc PE / Size 4999709 / 19.07 TB
Free PE / Size 5716180 / 21.81 TB
VG UUID 9i82gX-6djB-1KC3-jbZK-nEJ2-9jJh-KvNgJp
“pvdisplay”的输出
pvdisplay
--- Physical volume ---
PV Name /dev/md2
VG Name vg1
PV Size 27.25 TB / not usable 3.56 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 7142441
Free PE 2142732
Allocated PE 4999709
PV UUID SmZrd0-jC5T-2QwU-Ecnh-PuY0-O9u6-sqDW1E
--- Physical volume ---
PV Name /dev/md3
VG Name vg1
PV Size 13.63 TB / not usable 1.62 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 3573448
Free PE 3573448
Allocated PE 0
PV UUID aQmMu2-gg8j-Be1T-IofO-bOuk-aL0s-ysiR6j
免责声明:您应该仔细阅读 lvm 手册并了解每个步骤的作用。但是,除非遇到错误,否则风险应该很小。
这就是我通常在这种情况下所做的。
如果有可能其他人可能会做一些事情来搞砸您,您希望在进行维护时阻止任何登录(根据您的维护程序和公司政策触摸 /etc/nologin 等)。
pvmove /dev/md3 # 确保所有使用的范围都被移走
pvs -o+pv_used # 确保 /dev/md3 中没有使用范围
vgreduce vg1 /dev/md3 # 现在删除物理卷