大网数据广告活动
服务器运维问答

mdadm mdadm: cannot open /dev/sda1: Device or resource busy

· 52CE 我爱测

I am having trouble going from a single disk to raid 10 The command issued is: mdadm --create /dev/md0 --level=10 --raid-devices=8 /dev/sd[abcdefgh]1 The output is: mdadm mdadm: cannot open /dev/sda1: Device or resource busy I ha…

问题原文

原帖链接 · Backtogeek · CC BY-SA 4.0

I am having trouble going from a single disk to raid 10

The command issued is:

mdadm --create /dev/md0 --level=10 --raid-devices=8 /dev/sd[abcdefgh]1

The output is:

mdadm mdadm: cannot open /dev/sda1: Device or resource busy

I have verified this has nothing to do with DM:

]# dmsetup status

No devices found

The file system is GPT, I used sgdisk --backup=table /dev/sda followed by sgdisk --load-backup=table /dev/sdb through to sdh to copy the partitions table

The table looks like:

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  525MB   524MB   ext3                  boot
 2      525MB   86.4GB  85.9GB  ext4
 3      86.4GB  90.7GB  4295MB  linux-swap(v1)
 4      90.7GB  1000GB  909GB

I have created the other arrays fine however I cannot create the raid for the 1st and 2nd partition.

current status:

]# cat /proc/mdstat
Personalities : [raid10]
md3 : active raid10 sdh3[7] sdg3[6] sdf3[5] sde3[4] sdd3[3] sdc3[2] sdb3[1] sda3[0]
      16766976 blocks super 1.2 512K chunks 2 near-copies [8/8] [UUUUUUUU]
        resync=DELAYED

md4 : active raid10 sdh4[7] sdg4[6] sdf4[5] sde4[4] sdd4[3] sdc4[2] sdb4[1] sda4[0]
      3552147456 blocks super 1.2 512K chunks 2 near-copies [8/8] [UUUUUUUU]
      [========>............]  resync = 42.5% (1513033344/3552147456) finish=76.2min speed=445722K/sec

unused devices: <none>

Can anyone offer any advice, do I need to boot in to a rescue disk and create the arrays for / and /boot while they are not mounted?

已采纳解答

原帖链接 · Hennes · CC BY-SA 3.0

do I need to...create the arrays for / and /boot while they are not mounted?

Precisely.

I hope you also realised that the old contents will be wiped in the process, so you might want to create a new array with one device missing (use mdadm --level=10 --raid-devices=8 --missing /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1 /dev/sdh1). Then format the filesystem on the new array volume and copy all data from /dev/sda1 to it. Then reboot from the array (thus NOT using the /dev/sda1 root) and actually add /dev/sda1.

Do not forget to adjust the bootloader accordingly.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-04-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。