`mdadm --add`拒绝为另一个RAID阵列中的磁盘工作

时间:2019-12-06 01:14:08

标签: raid mdadm

我想将磁盘添加到软件RAID 10。 但是,该磁盘以前是另一台计算机上RAID的成员,现在不再可用,因此该磁盘正在等待回收。

但是,我所做的任何事情都不允许我添加磁盘而不会失败。 我dd磁盘(sudo dd if=/dev/zero | pv | sudo dd of=${disk}1 bs=10M iflag=fullblock count=3000)并在磁盘上创建分区(sudo parted -a optimal $disk mklabel gpt ; sudo parted -a optimal $disk mkpart primary 0% 100% ; sudo mkfs.ext4 ${disk}1

但是

$ sudo mdadm --add /dev/md0 /dev/sdk
mdadm: Cannot open /dev/sdk: Device or resource busy
$ sudo mdadm --add /dev/md0 /dev/sdk1
mdadm: Cannot open /dev/sdk1: Device or resource busy

$ sudo mdadm --zero-superblock /dev/sdk
mdadm: Couldn't open /dev/sdk for write - not zeroing
$ sudo wipefs --all /dev/sdk                                                                                                                                                                            
wipefs: error: /dev/sdk: probing initialization failed: Device or resource busy

lsof没有显示任何保存磁盘的过程,未安装磁盘。
知道如何将磁盘添加到RAID吗?

添加的数据:

$ sudo fdisk -l /dev/sdk
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdk: 3000.6 GB, 3000592982016 bytes, 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: C383DE32-D060-4183-AA7B-F97441977A81


#         Start          End    Size  Type            Name
 1         2048   5860532223    2.7T  Microsoft basic primary

$ sudo smartctl --all /dev/sdk
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.12.2.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Toshiba 3.5" DT01ACA... Desktop HDD
Device Model:     TOSHIBA DT01ACA300
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                (22508) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 376) minutes.
SCT capabilities:              (0x003d) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   139   139   054    Pre-fail  Offline      -       70
  3 Spin_Up_Time            0x0007   136   136   024    Pre-fail  Always       -       422 (Average 420)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       19
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   124   124   020    Pre-fail  Offline      -       33
  9 Power_On_Hours          0x0012   097   097   000    Old_age   Always       -       26047
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       19
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       668
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       668
194 Temperature_Celsius     0x0002   187   187   000    Old_age   Always       -       32 (Min/Max 19/42)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

0 个答案:

没有答案