Intel 320 60GB x 5 をRAID5で構成で作ろうとした時のメモ。
dmesgを見るとmdがsda,sdb,adc,sdd,sdeのRAIDデバイスだと分かる。
/devを覗いてみると3つのデバイスがぶら下がっている。
/proc/mdstat
にraidの設定が書かれている。
$ ls /dev | grep md
md
md126
md127
$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md126 : active raid5 sda[4] sdb[3] sdc[2] sdd[1] sde[0]
234452992 blocks super external:/md127/0 level 5, 64k chunk, algorithm 0 [5/5] [UUUUU]
md127 : inactive sdb[4](S) sda[3](S) sde[2](S) sdc[1](S) sdd[0](S)
11620 blocks super external:imsm
unused devices: <none>
$ sudo mdadm -D /dev/md126
/dev/md126:
Container : /dev/md/imsm0, member 0
Raid Level : raid5
Array Size : 234452992 (223.59 GiB 240.08 GB)
Used Dev Size : 58613376 (55.90 GiB 60.02 GB)
Raid Devices : 5
Total Devices : 5
State : clean
Active Devices : 5
Working Devices : 5
Failed Devices : 0
Spare Devices : 0
Layout : left-asymmetric
Chunk Size : 64K
UUID : xxxx
Number Major Minor RaidDevice State
4 8 0 0 active sync /dev/sda
3 8 16 1 active sync /dev/sdb
2 8 32 2 active sync /dev/sdc
1 8 48 3 active sync /dev/sdd
0 8 64 4 active sync /dev/sde
$ sudo mkfs.ext4 /dev/md126
mke2fs 1.42.10 (18-May-2014)
Creating filesystem with 58613248 4k blocks and 14655488 inodes
Filesystem UUID: xxxx
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
$ sudo mkfs.ext4 /dev/md126
$ blkid
/dev/md126: UUID="xxxxx" TYPE="ext4"
取り敢えずインストールコマンドを叩く
$ coreos-install -d /dev/md126 -c cloud-config.yml
/usr/bin/coreos-install: Target block device (/dev/md126) is not a full disk.
インストーラのコードを見てみるとデバイスがdisk|loop|lvm以外だとだめのようだ。
https://github.com/coreos/init/blob/master/bin/coreos-install#L187
lsblk -n -d -o TYPE /dev/md126
raid5
https://github.com/coreos/docs/issues/222
raid5でlvmを作ってそこにインストールする方向に変更
参考:http://qiita.com/irasally/items/b3630eb2f7739a05d4bc
$ sudo fdisk /dev/md126
$ lsblk -n -d -o TYPE /dev/md126
$ lsblk -n -d -o TYPE /dev/md126p1
$ sudo pvcreate /dev/md126p1
$ sudo vgcreate VgRaid /dev/md126p1
$ sudo lvcreate -n LvRaid -l 100%FREE VgRaid
$ lsblk -n -d -o TYPE /dev/md126p1
md
$ lsblk -n -d -o TYPE /dev/VgRaid/LvRaid
lvm
$ sudo coreos-install -d /dev/VgRaid/LvRaid -c cloud-config.yml
Checking availability of "local-file"
Fetching user-data from datasource of type "local-file"
Downloading the signature for http://stable.release.core-os.net/amd64-usr/633.1.0/coreos_production_image.bin.bz2...
2015-05-04 10:37:52 URL:http://stable.release.core-os.net/amd64-usr/633.1.0/coreos_production_image.bin.bz2.sig [543/543] -> "/tmp/coreos-install.YKTo85nR9C/coreos_production_image.bin.bz2.sig" [1]
Downloading, writing and verifying coreos_production_image.bin.bz2...
2015-05-04 10:39:01 URL:http://stable.release.core-os.net/amd64-usr/633.1.0/coreos_production_image.bin.bz2 [139976806/139976806] -> "-" [1]
gpg: Signature made Thu Mar 26 11:07:40 2015 UTC using RSA key ID E5676EFC
gpg: key 93D2DCB4 marked as ultimately trusted
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: Good signature from "CoreOS Buildbot (Offical Builds) <buildbot@coreos.com>" [ultimate]
blockdev: ioctl error on BLKRRPART: Invalid argument
アッ、ハイ…無理ですね。
RAID1に無理インストールする方法があるみたいだけど、ここまでやるならdiskに直接インストールすればいいや…
https://gist.github.com/psi-4ward/c1cece78cdf8fa9d64e7