2020/08/02

mdadmによるRAID1の縮小とRAID1・RAID0の拡張(2本目のディスクの作業)

2本のディスクでLinuxを走らせているが、キャッシュ的なファイルを保存しているパーティション(mdadmを使ったRAID0で構築)を広げたくなった。
RAID1で構築しているパーティションが余っていたので、その領域を縮小させ、こちらのパーティションを拡張する。
1本目の作業が終わったので、RAID1からの切り離し以降の作業を2本目に対しても行う。


まず、RAIDの同期が完了していることを確認する。
root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sdb3[3] sda3[2]
      33553336 blocks super 1.2 [2/2] [UU]

md4 : active raid1 sdb4[3] sda4[2]
      125829120 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sdb1[1] sda1[0]
      524224 blocks [2/2] [UU]

unused devices: <none>

同期が完了していることが確認できたら、対象となるディスクをRAID1から切り離していく。
root@edo /
# mdadm /dev/md1 --fail /dev/sda1  --remove /dev/sda1
mdadm: set /dev/sda1 faulty in /dev/md1
mdadm: hot removed /dev/sda1 from /dev/md1

root@edo /
# mdadm /dev/md3 --fail /dev/sda3  --remove /dev/sda3
mdadm: set /dev/sda3 faulty in /dev/md3
mdadm: hot removed /dev/sda3 from /dev/md3

root@edo /
# mdadm /dev/md4 --fail /dev/sda4  --remove /dev/sda4
mdadm: set /dev/sda4 faulty in /dev/md4
mdadm: hot removed /dev/sda4 from /dev/md4

切り離しが完了したことを確認。
root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sdb3[3]
      33553336 blocks super 1.2 [2/1] [_U]

md4 : active raid1 sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sdb1[1]
      524224 blocks [2/1] [_U]

unused devices: <none>

fdiskでディスクサイズを調整する。 
まずは現状の確認。
root@edo /
# fdisk -l /dev/sda
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3   13633536  80742399  67108864   32G Linux RAID
/dev/sda4   80742400 923797503 843055104  402G Linux RAID
/dev/sda5  923797504 976773134  52975631 25.3G Linux RAID
/dev/sda6    1116160  13633535  12517376    6G Linux swap

Partition table entries are not in disk order.

root@edo ~ Sun 02 Aug 2020 01:36:51 PM JST JST(+0900)
# fdisk -l /dev/sdb
Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Crucial_CT500MX2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0D638A13-AA1D-4131-8BB7-6DE88A59EDBA

Device         Start       End   Sectors  Size Type
/dev/sdb1       2048   1050623   1048576  512M Linux RAID
/dev/sdb2    1050624   1116159     65536   32M BIOS boot
/dev/sdb3    1116160 126945279 125829120   60G Linux RAID
/dev/sdb4  126945280 546375679 419430400  200G Linux RAID
/dev/sdb5  546375680 963708927 417333248  199G Linux RAID
/dev/sdb6  963708928 976773134  13064207  6.2G Linux swap

スワップファイルを停止するのを忘れないように。 
停止の前に、sdbのスワップを有効にすること。
root@edo /
# swapon
NAME      TYPE      SIZE USED PRIO
/dev/sda6 partition   6G   0B    1

root@edo /
# swapon /dev/sdb6

root@edo /
# swapon
NAME      TYPE      SIZE USED PRIO
/dev/sda6 partition   6G   0B    1
/dev/sdb6 partition 6.2G   0B   -2

root@edo /
# swapoff /dev/sda6

root@edo /
# swapon
NAME      TYPE      SIZE USED PRIO
/dev/sdb6 partition 6.2G   0B   -2

fdiskでの作業。
root@edo /
# fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3   13633536  80742399  67108864   32G Linux RAID
/dev/sda4   80742400 923797503 843055104  402G Linux RAID
/dev/sda5  923797504 976773134  52975631 25.3G Linux RAID
/dev/sda6    1116160  13633535  12517376    6G Linux swap

Partition table entries are not in disk order.

Command (m for help): d
Partition number (1-6, default 6): 6

Partition 6 has been deleted.

Command (m for help): d
Partition number (1-5, default 5):

Partition 5 has been deleted.

Command (m for help): d
Partition number (1-4, default 4):

Partition 4 has been deleted.

Command (m for help): d
Partition number (1-3, default 3):

Partition 3 has been deleted.

Command (m for help): n
Partition number (3-128, default 3):
First sector (1116160-976773134, default 1116160):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1116160-976773134, default 976773134): +60G

Created a new partition 3 of type 'Linux filesystem' and of size 60 GiB.
Partition #3 contains a swap signature.

Do you want to remove the signature? [Y]es/[N]o: Y

The signature will be removed by a write command.

Command (m for help): n
Partition number (4-128, default 4):
First sector (126945280-976773134, default 126945280):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (126945280-976773134, default 976773134): +200G

Created a new partition 4 of type 'Linux filesystem' and of size 200 GiB.

Command (m for help): n
Partition number (5-128, default 5):
First sector (546375680-976773134, default 546375680):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (546375680-976773134, default 976773134): +199G

Created a new partition 5 of type 'Linux filesystem' and of size 199 GiB.

Command (m for help): n
Partition number (6-128, default 6):
First sector (963708928-976773134, default 963708928):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (963708928-976773134, default 976773134):

Created a new partition 6 of type 'Linux filesystem' and of size 6.2 GiB.

Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3    1116160 126945279 125829120   60G Linux filesystem
/dev/sda4  126945280 546375679 419430400  200G Linux filesystem
/dev/sda5  546375680 963708927 417333248  199G Linux filesystem
/dev/sda6  963708928 976773134  13064207  6.2G Linux filesystem

Filesystem/RAID signature on partition 3 will be wiped.

Command (m for help): t
Partition number (1-6, default 6): 3
Partition type (type L to list all types): 29

Changed type of partition 'Linux filesystem' to 'Linux RAID'.

Command (m for help): t
Partition number (1-6, default 6): 4
Partition type (type L to list all types): 29

Changed type of partition 'Linux filesystem' to 'Linux RAID'.

Command (m for help): t
Partition number (1-6, default 6): 5
Partition type (type L to list all types): 29

Changed type of partition 'Linux filesystem' to 'Linux RAID'.

Command (m for help): t
Partition number (1-6, default 6): 6
Partition type (type L to list all types): 19

Changed type of partition 'Linux filesystem' to 'Linux swap'.

Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3    1116160 126945279 125829120   60G Linux RAID
/dev/sda4  126945280 546375679 419430400  200G Linux RAID
/dev/sda5  546375680 963708927 417333248  199G Linux RAID
/dev/sda6  963708928 976773134  13064207  6.2G Linux swap

Filesystem/RAID signature on partition 3 will be wiped.

Command (m for help): w
The partition table has been altered.
Failed to remove partition 6 from system: Device or resource busy
Failed to add partition 3 to system: Device or resource busy
Failed to add partition 6 to system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot.
Syncing disks.


上記では、実はswapを停止するのを忘れていたので、同じ間違いが発生。 
なので、swapoffしてもう一度やり直してみた。今度はエラーなしでできた。
root@edo /
# fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3    1116160 126945279 125829120   60G Linux RAID
/dev/sda4  126945280 546375679 419430400  200G Linux RAID
/dev/sda5  546375680 963708927 417333248  199G Linux RAID
/dev/sda6  963708928 976773134  13064207  6.2G Linux swap

Command (m for help): d
Partition number (1-6, default 6):

Partition 6 has been deleted.

Command (m for help): d
Partition number (1-5, default 5):

Partition 5 has been deleted.

Command (m for help): d
Partition number (1-4, default 4):

Partition 4 has been deleted.

Command (m for help): d
Partition number (1-3, default 3):

Partition 3 has been deleted.

Command (m for help): n
Partition number (3-128, default 3):
First sector (1116160-976773134, default 1116160):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1116160-976773134, default 976773134): +60

Created a new partition 3 of type 'Linux filesystem' and of size 30.5 KiB.

Command (m for help): d
Partition number (1-3, default 3):

Partition 3 has been deleted.

Command (m for help): n
Partition number (3-128, default 3):
First sector (1116160-976773134, default 1116160):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1116160-976773134, default 976773134): +60G

Created a new partition 3 of type 'Linux filesystem' and of size 60 GiB.

Command (m for help): n
Partition number (4-128, default 4):
First sector (126945280-976773134, default 126945280):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (126945280-976773134, default 976773134): +200G

Created a new partition 4 of type 'Linux filesystem' and of size 200 GiB.

Command (m for help):


Command (m for help): n
Partition number (5-128, default 5):
First sector (546375680-976773134, default 546375680):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (546375680-976773134, default 976773134): +199G

Created a new partition 5 of type 'Linux filesystem' and of size 199 GiB.

Command (m for help): n
Partition number (6-128, default 6):
First sector (963708928-976773134, default 963708928):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (963708928-976773134, default 976773134):

Created a new partition 6 of type 'Linux filesystem' and of size 6.2 GiB.

Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3    1116160 126945279 125829120   60G Linux filesystem
/dev/sda4  126945280 546375679 419430400  200G Linux filesystem
/dev/sda5  546375680 963708927 417333248  199G Linux filesystem
/dev/sda6  963708928 976773134  13064207  6.2G Linux filesystem

Command (m for help): t
Partition number (1-6, default 6): 3
Partition type (type L to list all types): 29

Changed type of partition 'Linux filesystem' to 'Linux RAID'.

Command (m for help): t
Partition number (1-6, default 6): 4
Partition type (type L to list all types): 29

Changed type of partition 'Linux filesystem' to 'Linux RAID'.

Command (m for help): t
Partition number (1-6, default 6): 5
Partition type (type L to list all types): 29

Changed type of partition 'Linux filesystem' to 'Linux RAID'.

Command (m for help): t
Partition number (1-6, default 6): 6
Partition type (type L to list all types): 19

Changed type of partition 'Linux filesystem' to 'Linux swap'.

Command (m for help): p
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 431735A7-BD0D-410F-A96C-C292628A24CA

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   1050623   1048576  512M Linux RAID
/dev/sda2    1050624   1116159     65536   32M BIOS boot
/dev/sda3    1116160 126945279 125829120   60G Linux RAID
/dev/sda4  126945280 546375679 419430400  200G Linux RAID
/dev/sda5  546375680 963708927 417333248  199G Linux RAID
/dev/sda6  963708928 976773134  13064207  6.2G Linux swap

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.


スワップパーティションを作成。
root@edo /
# mkswap /dev/sda6
Setting up swapspace version 1, size = 6.2 GiB (6688866304 bytes)
no label, UUID=cf7b9530-0b95-4771-8966-bfc637def10a

RAID復旧作業の前に確認。RAIDは片系で動いている状態。
root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sdb3[3]
      33553336 blocks super 1.2 [2/1] [_U]

md4 : active raid1 sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sdb1[1]
      524224 blocks [2/1] [_U]

unused devices: <none>

sda側のパーティションをRAIDアレイに戻していく。
root@edo /
# mdadm --add /dev/md1 /dev/sda1
mdadm: hot added /dev/sda1

root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sdb3[3]
      33553336 blocks super 1.2 [2/1] [_U]

md4 : active raid1 sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda1[2] sdb1[1]
      524224 blocks [2/1] [_U]
      [===============>.....]  recovery = 76.6% (401920/524224) finish=0.0min speed=200960K/sec

unused devices: <none>

root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sdb3[3]
      33553336 blocks super 1.2 [2/1] [_U]

md4 : active raid1 sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda1[0] sdb1[1]
      524224 blocks [2/2] [UU]

unused devices: <none>

root@edo /
# mdadm -D /dev/md1
/dev/md1:
           Version : 0.90
     Creation Time : Wed Nov 28 03:58:06 2012
        Raid Level : raid1
        Array Size : 524224 (511.94 MiB 536.81 MB)
     Used Dev Size : 524224 (511.94 MiB 536.81 MB)
      Raid Devices : 2
     Total Devices : 2
   Preferred Minor : 1
       Persistence : Superblock is persistent

       Update Time : Sun Aug  2 13:50:01 2020
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : resync

              UUID : b5524b46:d7163145:cb201669:f728008a
            Events : 0.228

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1


続いてmd3の作業。
root@edo /
# mdadm --add /dev/md3 /dev/sda3
mdadm: added /dev/sda3

root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sda3[2] sdb3[3]
      33553336 blocks super 1.2 [2/1] [_U]
      [>....................]  recovery =  3.5% (1176192/33553336) finish=2.2min speed=235238K/sec

md4 : active raid1 sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda1[0] sdb1[1]
      524224 blocks [2/2] [UU]

unused devices: <none>

root@edo /
# mdadm -D /dev/md3
/dev/md3:
           Version : 1.2
     Creation Time : Fri Nov 30 02:19:12 2012
        Raid Level : raid1
        Array Size : 33553336 (32.00 GiB 34.36 GB)
     Used Dev Size : 33553336 (32.00 GiB 34.36 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

       Update Time : Sun Aug  2 13:51:16 2020
             State : active, degraded, recovering
    Active Devices : 1
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 1

Consistency Policy : resync

    Rebuild Status : 10% complete

              Name : edo:/  (local to host edo)
              UUID : 1a4518b9:879d5121:f1651760:8b1a1f02
            Events : 33168

    Number   Major   Minor   RaidDevice State
       2       8        3        0      spare rebuilding   /dev/sda3
       3       8       19        1      active sync   /dev/sdb3


同期が完了したので次へ。
root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sda3[2] sdb3[3]
      33553336 blocks super 1.2 [2/2] [UU]

md4 : active raid1 sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda1[0] sdb1[1]
      524224 blocks [2/2] [UU]

unused devices: <none>


続いて、md4の作業。
root@edo /
# mdadm --add /dev/md4 /dev/sda4
mdadm: added /dev/sda4

root@edo ~ Sun 02 Aug 2020 02:02:37 PM JST JST(+0900)
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sda3[2] sdb3[3]
      33553336 blocks super 1.2 [2/2] [UU]

md4 : active raid1 sda4[2] sdb4[3]
      125829120 blocks super 1.2 [2/1] [_U]
      [>....................]  recovery =  0.6% (856512/125829120) finish=17.0min speed=122358K/sec
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda1[0] sdb1[1]
      524224 blocks [2/2] [UU]

unused devices: <none>

root@edo /
# mdadm -D /dev/md4
/dev/md4:
           Version : 1.2
     Creation Time : Sat Aug  1 16:49:39 2015
        Raid Level : raid1
        Array Size : 125829120 (120.00 GiB 128.85 GB)
     Used Dev Size : 125829120 (120.00 GiB 128.85 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Sun Aug  2 14:02:47 2020
             State : clean, degraded, recovering
    Active Devices : 1
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 1

Consistency Policy : bitmap

    Rebuild Status : 1% complete

              Name : edo:/data  (local to host edo)
              UUID : 8f55590b:38f15e8a:4ea20fad:c34229d8
            Events : 7436

    Number   Major   Minor   RaidDevice State
       2       8        4        0      spare rebuilding   /dev/sda4
       3       8       20        1      active sync   /dev/sdb4


同期の完了を待つ。
root@edo /
# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] [raid0] [raid1] [raid10] [linear] [multipath]
md3 : active raid1 sda3[2] sdb3[3]
      62913536 blocks super 1.2 [2/2] [UU]

md4 : active raid1 sda4[2] sdb4[3]
      125829120 blocks super 1.2 [2/2] [UU]
      bitmap: 0/1 pages [0KB], 65536KB chunk

md1 : active raid1 sda1[0] sdb1[1]
      524224 blocks [2/2] [UU]

unused devices: <none>

root@edo ~ Sun 02 Aug 2020 02:55:51 PM JST JST(+0900)
# mdadm -D /dev/md4
/dev/md4:
           Version : 1.2
     Creation Time : Sat Aug  1 16:49:39 2015
        Raid Level : raid1
        Array Size : 125829120 (120.00 GiB 128.85 GB)
     Used Dev Size : 125829120 (120.00 GiB 128.85 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Sun Aug  2 14:51:59 2020
             State : clean
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : edo:/data  (local to host edo)
              UUID : 8f55590b:38f15e8a:4ea20fad:c34229d8
            Events : 8031

    Number   Major   Minor   RaidDevice State
       2       8        4        0      active sync   /dev/sda4
       3       8       20        1      active sync   /dev/sdb4

これで、すべてのRAID1の構成が復旧し、同期が取れた。 
ディスクへの負荷も減ったので、swapも有効化。
root@edo /
# swapon /dev/sda6

root@edo /
# swapon
NAME      TYPE      SIZE USED PRIO
/dev/sda6 partition 6.2G   0B   -3
/dev/sdb6 partition 6.2G   0B   -2

これで2本目の作業は完了。 
続いて、RAIDのサイズ拡張を行う。

0 件のコメント: