You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 11 (bullseye)下扩展MD RAID5阵列执行umount后阵列丢失的恢复求助

Ubuntu 11 (bullseye)下扩展MD RAID5阵列执行umount后阵列丢失的恢复求助

Hey there, sorry to hear you ran into this frustrating issue when trying to expand your RAID5 array. Let’s walk through getting your array back online first, then finish the expansion properly.

第一步:找回并重新装配RAID阵列

First, let’s check if mdadm can still detect the existing RAID metadata on your disks. Run these commands to scan for RAID signatures:

sudo mdadm --detail --scan
sudo mdadm -E /dev/sdb1 /dev/sdc1 /dev/sde1

The second command will show metadata info for each of your original RAID partitions. Look for lines like UUID and RAID Level : raid5 to confirm these belong to your missing array.

Once you confirm the disks/partitions, reassemble the array (replace /dev/md0 with your actual RAID device name if it was different):

sudo mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sde1

If you get an error about missing devices, double-check you’re using the correct partition paths from your lsblk output.

第二步:验证并挂载阵列

After assembling, verify the array status:

cat /proc/mdstat

You should see the array listed with active raid5 and a sync process (if needed). Next, run a file system check to make sure everything’s intact (replace /dev/md0 with your RAID device):

sudo e2fsck -f /dev/md0

Once that completes successfully, mount the array back to its original mount point (replace /your/mount/path with where it was mounted before, e.g., /mnt/raid):

sudo mount /dev/md0 /your/mount/path

You can confirm it’s mounted with lsblk again—you should see the RAID device listed with the mount point now.

第三步:继续完成RAID扩容

Now that your array is back, let’s finish adding the new 2TB disk (/dev/sdd):

  1. Create a RAID partition on the new disk:
    Use fdisk or parted to create a partition matching the size and type of your existing RAID partitions. For fdisk:

    sudo fdisk /dev/sdd
    
    • Press n to create a new partition, select primary, use the full disk space.
    • Press t to change the partition type, enter fd for Linux RAID.
    • Press w to write the changes.
      You’ll now have /dev/sdd1 as the new RAID partition.
  2. Add the new partition to the RAID array:

    sudo mdadm --add /dev/md0 /dev/sdd1
    
  3. Grow the RAID array to 4 devices:

    sudo mdadm --grow /dev/md0 --raid-devices=4
    

    This will start a reshape process—check progress with cat /proc/mdstat. Don’t interrupt this, it can take a while depending on disk speed.

  4. Expand the file system to use the new space:
    Once the reshape is done, expand the file system (for ext3/ext4):

    sudo resize2fs /dev/md0
    

Important Notes

  • Backup first: If you have critical data, make sure you have a backup before running any of these commands—RAID operations can go wrong if interrupted.
  • Double-check device names: Always confirm you’re targeting the correct disks/partitions to avoid accidental data loss.
  • Monitor sync/reshape progress: Use cat /proc/mdstat to keep an eye on the process; it’ll show a percentage complete.

备注:内容来源于stack exchange,提问作者Eitan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 14:43:12