0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ソフトウェアRAIDを解除する

Posted at

作業メモ

サーバのOSが古くなりすぎたので、CentOSからUbuntuServerに入れ替える予定。
ソフトウェアRAIDを組んでいたので、DISKを再利用出来るようにきれいにしておく。

構成

  • CentOS6 <これを入れ替える下準備
  • パーティションでRAID1
  • 事前に中のデータは、別のDISKに退避済み
  • /etc/fstab 該当行をコメントアウトしておく

1.RAID状態の確認

$ sudo cat /proc/mdstat
Personalities : [raid1] 
md1 : active raid1 sdb1[1] sdc1[2]
      1073610560 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>

詳細の確認

$ sudo mdadm --detail /dev/md1
/dev/md1:
        Version : 1.2
  Creation Time : Mon Dec  2 13:54:11 2013
     Raid Level : raid1
     Array Size : 1073610560 (1023.87 GiB 1099.38 GB)
  Used Dev Size : 1073610560 (1023.87 GiB 1099.38 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sat Dec 19 10:54:38 2020
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : HostName:1  (local to host HostName)
           UUID : cdb47d47:664ec9bd:c1c02b5b:14d1a895
         Events : 1067

    Number   Major   Minor   RaidDevice State
       2       8       33        0      active sync   /dev/sdc1
       1       8       17        1      active sync   /dev/sdb1

2.RAIDを止める

$ sudo sudo mdadm --stop /dev/md1
mdadm: stopped /dev/md1

$ sudo mdadm --detail /dev/md1
/dev/md1:
        Version : 
     Raid Level : raid0
  Total Devices : 0

          State : inactive

    Number   Major   Minor   RaidDevice

3.DISKを再利用できる用にパーティションもきれいにしておく

RAID構成で使っていたDISK情報を確認

「/dev/sdb」と「/dev/sdc」が対象

$ sudo parted /dev/sdb -s unit s -s p
モデル: ATA WDC WD20EFRX-68E (scsi)
ディスク /dev/sdb: 3907029168s
セクタサイズ (論理/物理): 512B/4096B
パーティションテーブル: gpt

番号  開始         終了         サイズ       ファイルシステム  名前              フラグ
 1    2048s        2147485695s  2147483648s                    Linux RAID        raid
 2    2147485696s  3907029134s  1759543439s  ext4              Linux filesystem

$ sudo parted /dev/sdc -s unit s -s p
モデル: ATA WDC WD20EFRX-68E (scsi)
ディスク /dev/sdc: 3907029168s
セクタサイズ (論理/物理): 512B/4096B
パーティションテーブル: gpt

番号  開始         終了         サイズ       ファイルシステム  名前              フラグ
 1    2048s        2147485695s  2147483648s                    Linux RAID        raid
 2    2147485696s  3907029134s  1759543439s  ext4              Linux filesystem

2つともWD Redだ。

S.M.A.R.T.情報も確認しておく

$ sudo smartctl -A /dev/sdb
smartctl 5.43 2016-09-28 r4347 [x86_64-linux-2.6.32-754.30.2.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
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     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   171   169   021    Pre-fail  Always       -       4416
  4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1101
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   016   016   000    Old_age   Always       -       61616
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       14
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       1097
194 Temperature_Celsius     0x0022   124   103   000    Old_age   Always       -       23
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

$ sudo smartctl -A /dev/sdc
smartctl 5.43 2016-09-28 r4347 [x86_64-linux-2.6.32-754.30.2.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
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     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   173   173   021    Pre-fail  Always       -       4308
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       600
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   054   054   000    Old_age   Always       -       34008
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       7
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       0
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       600
194 Temperature_Celsius     0x0022   128   104   000    Old_age   Always       -       19
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

S.M.A.R.T.情報もきれいなのでリユース決定。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?