1
1

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 5 years have passed since last update.

Proxmox VE 4.3 で mdadmを使う

Last updated at Posted at 2016-10-31

インストール

apt install -y mdadm

raid.png

RAID1の新規作成

  • 以下構成とする
    • sda : 1tb
    • sdb : 500gb
    • sdc : 500gb
    • sdd : 1tb
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
mkfs.ext4 /dev/md0
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sda /dev/sdd
mkfs.ext4 /dev/md1

OS起動時にマウントされるようにする

mdadm --detail --scan
mdadm --detail --scan > /etc/mdadm.conf
  • /etc/fstabに追記

リビルド状況確認

cat /proc/mdstat

DISK障害対応

  • 障害HDDを引っこ抜く
状況確認
mdadm --detail /dev/md0
- State : clean, degraded
  ...
    Number   Major   Minor   RaidDevice State
       0       8        0        0      active sync   /dev/sdb
-      2       0        0        2      removed
mdadm --manage /dev/md0 --remove /dev/sdc
mdadm --manage /dev/md0 --fail /dev/sdc
  • 電源を落とし、DISK交換
mdadm --manage /dev/md0 --add /dev/sdc
+ State : active, degraded, recovering
  ...
    Number   Major   Minor   RaidDevice State
       0       8        0        0      active sync   /dev/sdb
+      2       8       48        1      spare rebuilding   /dev/sdc
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?