附錄:把11顆raid6 reshaped為10顆

使用參數 --grow 把原本11顆組成的 raid6 改成10顆組成

dadm --grow --raid-devices=10 /dev/md0
#須先把大小做調整
mdadm: this change will reduce the size of the array.
       use --grow --array-size first to truncate array.
       e.g. mdadm --grow /dev/md0 --array-size 46883123200
#調整大小後,才能變更磁碟數量
mdadm --grow /dev/md0 --array-size 46883123200
resize2fs /dev/md0
#... and run a file system check again:
e2fsck -f /dev/md0
resize2fs /dev/md0

#變更數量,要有--backup,並且不能存在陣列磁區
mdadm --grow --raid-devices=10 /dev/md0 --backup=/root/reshapedRaid6.img
#再次執行,顯示已經進入reshaped模式
mdadm --grow --raid-devices=10 /dev/md0
mdadm: /dev/md0 is performing resync/recovery and cannot be reshaped

重塑後由49T變成43T

mount /dev/md0 /mnt mount: /mnt: wrong fs type, bad option, bad superblock on /dev/md0, missing codepage or helper program, or other error.

Last updated

Was this helpful?