目次
LinuxのソフトウェアRAIDをインストール後に構築する手順。(RHEL9系)
ソフトウェアRAID関連のパッケージが未導入の場合には、以下のコマンドにて導入を行う。
dnf install -y mdadm
fdisk /dev/sd「n」 パーティションを作成 パーティションのタイプは29(29 Linux RAID)を選択
mdadm --create /dev/md1 --level=raid1 --raid-device=2 /dev/sdb1 /dev/sde1
mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 Continue creating array [y/N]? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md1 started.
cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sde1[1] sdb1[0]
488253440 blocks super 1.2 [2/2] [UU]
[>....................] resync = 2.5% (12601664/488253440) finish=38.5min speed=205740K/sec
bitmap: 4/4 pages [16KB], 65536KB chunkmd0 : active raid1 sda1[0] sdc1[1]
1875240768 blocks super 1.2 [2/2] [UU]
bitmap: 4/14 pages [16KB], 65536KB chunk
unused devices: <none>
mkfs.xfs /dev/md1~
meta-data=/dev/md1 isize=512 agcount=4, agsize=30515840 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1 nrext64=0
data = bsize=4096 blocks=122063360, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=59601, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
Discarding blocks...Done.mount /dev/md1 /exports/disk8/
mdadm --detail --scan | sudo tee -a /etc/mdadm.conf
mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90
| GRUB | 0.90 | メタデータがディスクの末尾に保存される |
| GRUB2 | 1.0, 1.1, 1.2 | メタデータがディスクの先頭または中央に保存される |