RAID種類

RAID は複数のHDDを組み合わせ、ひとつのHDDとして扱う機能。
専用のハードウエアを使うハードウエアRAIDと、 複数のHDDをOSレベルでRAID化するソフトウエアRAIDがある。
RAID: Redundant Array of Independent Disk, 古くは 〜 inexpensive 〜
Level概要
0 ストライピング
ひとつのデータを複数のHDDに分散記録
1 ミラーリング
同一データを複数のディスクに記録
2 ストライピング(ハミング
ハミングコード用に3台のHDDが必要(データx2, ハミングx3 計5台)
3 ストライピング(パリティ)
パリティ専用HDDを用いる(データx2, パリティx1 計3台)
4 固定パリティ
RAID 3 と同様だが、ブロック単位で操作(RAID 3はバイト単位)
5 分散パリティ
データとパリティを HDD上に分散配置
参考) RAIDとは [ 富士通 ]

ハードウエア RAID

RAID用製品はコンピューターメーカーだけでなく、EMCといった専業メーカーも存在する。
特に企業向けRAIDは非常に大規模・高機能・高信頼性を謳っている。
参考

ソフトウエア RAID

昨今、ハードウエアRAIDの低価格化により、活躍の場は減っている。
多くのディストリビューションではソフトウエアRAIDに mdadmin コマンドを用いる。
md:Multiple Devices
# mdadm --misc --stop /dev/md*... --zero-superblock /dev/sd*

パーティション操作

パーティションの表示
# fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


コマンド (m でヘルプ): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O サイズ (最小 / 推奨): 4096 バイト / 4096 バイト
Disk label type: dos
ディスク識別子: 0x000e003d

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sda1   *       65535     1048559      491512+  83  Linux
パーティション 1 は物理セクタ境界で始まっていません:
/dev/sda2         1048560    21495479    10223460   83  Linux
/dev/sda3        21495480    37879229     8191875   83  Linux
/dev/sda4        37879230   156300974    59210872+   f  W95 Ext'd (LBA)
パーティション 4 は物理セクタ境界で始まっていません:
/dev/sda5        37944765    54328514     8191875   83  Linux
パーティション 5 は物理セクタ境界で始まっていません:
/dev/sda6        54394050    62585924     4095937+  83  Linux
パーティション 6 は物理セクタ境界で始まっていません:
/dev/sda7        62651460    79035209     8191875   83  Linux
パーティション 7 は物理セクタ境界で始まっていません:

コマンド (m でヘルプ): q
パーティションの追加
# fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


コマンド (m でヘルプ): n
All primary partitions are in use
Adding logical partition 8
最初 sector (37881278-156300974, 初期値 37881856): 
初期値 37881856 を使います
Last sector, +sectors or +size{K,M,G} (37881856-37944764, 初期値 37944764): 
初期値 37944764 を使います
Partition 8 of type Linux and of size 30.7 MiB is set

コマンド (m でヘルプ): w
パーティションテーブルは変更されました!

ioctl() を呼び出してパーティションテーブルを再読込みします。

WARNING: Re-reading the partition table failed with error 16: デバイスもしくはリソースがビジー状態です.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
ディスクを同期しています。
# partprobe
#
パーティションテーブルは、OS起動時にメモリーにキャッシュされるため、fdisk で変更すると メモリー上とHDD上で内容が不一致となる。 そのためOSの再起動を推奨されるが、partprobe(8) コマンドによって同期することができる。