Proxmox · 4 min read · Nov 28, 2025

Proxmox VE 2.x ソフトウェア RAID

Proxmox VE 2.x ソフトウェア RAID

Proxmox Virtual Environmentは、仮想アプライアンスや仮想マシンを実行するための使いやすいオープンソースの仮想化プラットフォームです。ProxmoxはソフトウェアRAIDを公式にはサポートしていませんが、私はソフトウェアRAIDが非常に安定していることを発見しており、場合によってはハードウェアRAIDよりも良い結果を得ています。

私はこれがあなたにとって機能するという保証はしません!

概要

まず、Proxmox V2をProxmoxからダウンロードしたCDを使って通常の方法でインストールします。次に、2番目のハードドライブにRAID 1アレイを作成し、Proxmoxのインストールをそこに移動します。

次に、Grubの設定を調整して、新しいセットアップでブートできるようにします。

クレジット

以下のチュートリアルは私が使用したものです:

https://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-debian-squeeze

HowtoForgeのFalkoに特別な感謝を、彼のハウツーから多くの資料が再利用されています。 https://www.howtoforge.com/linux_lvm

Proxmoxのインストール

Proxmoxの最新のダウンロードCDからProxmoxをインストールします http://www.proxmox.com/downloads/proxmox-ve/17-iso-images

ext4インストールを希望する場合は、ブートプロンプトで次のように入力します:

linux ext4

インストール手順はこちら: http://pve.proxmox.com/wiki/Quick_installation

次に、sshでログインして、次を実行します:

apt-get update
apt-get upgrade

RAIDのインストール

注意:このチュートリアルは、Proxmoxが/dev/sdaにインストールされており、予備のディスクが/dev/sdbであると仮定しています。現在のパーティショニングをリストするには、次のコマンドを使用します:

fdisk -l

出力は次のようになります:

root@proxmox:/# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009f7a7

Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 523264 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 66 121602 976237568 8e Linux LVM

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078af8

Device Boot Start End Blocks Id System

ここにはもっとありますが、今は最初の2つのディスクだけに関心があります。/dev/sdaにProxmoxのインストールがあり、/dev/sdbにはパーティションがないことがわかります。

まず、ソフトウェアRAID、つまりmdraidをインストールします:

apt-get install mdadm

パッケージ設定ウィンドウでokを選択し、次にallを選択します。 次に、modprobeでカーネルモジュールを起動します:

modprobe linear
modprobe raid0
modprobe raid1
modprobe raid5
modprobe raid6
modprobe raid10

次に実行します:

cat /proc/mdstat

出力は次のようになります:

root@proxmox:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
unused devices:
root@proxmox:~#

次に、sdaからsdbにパーティションテーブルをコピーする必要があります:

sfdisk -d /dev/sda | sfdisk –force /dev/sdb

出力は次のようになります:

root@proxmox:/# sfdisk -d /dev/sda | sfdisk –force /dev/sdb
Checking that no-one is using this disk right now …
OK

Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sdb1 0 - 0 0 0 Empty
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/sdb1 * 2048 1048575 1046528 83 Linux
/dev/sdb2 1048576 1953523711 1952475136 8e Linux LVM
/dev/sdb3 0 - 0 0 Empty
/dev/sdb4 0 - 0 0 Empty
Warning: partition 1 does not end at a cylinder boundary
Successfully wrote the new partition table

Re-reading the partition table …

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
root@vmh:/# root@vmh:/# sfdisk -d /dev/sda | sfdisk –force /dev/sdb
-bash: root@vmh:/#: No such file or directory
Checking that no-one is using this disk right now …
OK

Disk /dev/sdb: 121601 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sdb1 * 0+ 65- 66- 523264 83 Linux
/dev/sdb2 65+ 121601- 121536- 976237568 8e Linux LVM
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
New situation:
No partitions found

sfdisk: no partition table present.

次に、パーティションタイプをLinux RAID自動検出に変更する必要があります:

fdisk /dev/sdb

root@proxmox:/# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It’s strongly recommended to
switch off the mode (command ‘c’) and change display units to
sectors (command ‘u’).

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): p
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00078af8

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 66 523264 fd Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sdb2 66 121602 976237568 fd Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

これで、/dev/sdbに2つのLinux RAID自動検出パーティションがあることがわかります。

/dev/sdbに以前のRAIDインストールの残りがないことを確認するために、次のコマンドを実行します:

mdadm –zero-superblock /dev/sdb1
mdadm –zero-superblock /dev/sdb2

以前のRAIDインストールの残りがない場合、上記の各コマンドは次のようなエラーを出力します(心配する必要はありません):

root@proxmox:~# mdadm –zero-superblock /dev/sdb1
mdadm: Unrecognised md component device - /dev/sdb1
root@server1:~#

さもなければ、コマンドは何も表示しません。

次に、新しいRAIDアレイを作成する必要があります:

mdadm –create /dev/md0 –level=1 –raid-disks=2 missing /dev/sdb1
mdadm –create /dev/md1 –level=1 –raid-disks=2 missing /dev/sdb2

これにより(はいと答える):

root@proxmox:/# mdadm –create /dev/md0 –level=1 –raid-disks=2 missing /dev/sdb1
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
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
root@proxmox:/#

コマンド

cat /proc/mdstat

root@proxmox:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active (auto-read-only) raid1 sdb1[1]
523252 blocks super 1.2 [2/1] [_U]

md1 : active (auto-read-only) raid1 sdb2[1]
976236408 blocks super 1.2 [2/1] [_U]

unused devices:

は、2つの劣化したRAIDアレイがあることを示すはずです([_U]または[U_]はアレイが劣化していることを意味し、[UU]はアレイが正常であることを意味します)。 次に、/etc/mdadm/mdadm.conf(まだ新しいRAIDアレイに関する情報を含んでいません)を新しい状況に調整する必要があります: cp /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf_orig mdadm --examine --scan >> /etc/mdadm/mdadm.conf 標準のProxmoxインストールは、/dev/sda1をブートパーティションとして使用し、/dev/sda2でルート、スワップ、データパーティションのためにlvmを使用します。 lvmパーティションに不慣れな場合は、このハウツーの最上部にあるクレジットのリンクを確認することをお勧めします。 lvmパーティションを表示するには、次のコマンドを使用します: lvscan それは次のように出力されるはずです: root@proxmox:~# lvscan ACTIVE '/dev/pve/swap' [15.00 GiB] inherit ACTIVE '/dev/pve/root' [96.00 GiB] inherit ACTIVE '/dev/pve/data' [804.02 GiB] inherit 次に、pve1という新しいボリュームグループと、スワップ、ルート、およびデータ用の一致する論理ボリュームを作成します。 まず、物理ボリューム: pvcreate /dev/md1 これにより出力されます Writing physical volume data to disk "/dev/md1" Physical volume "/dev/md1" successfully created このコマンド: pvscan は、新しい物理ボリュームを表示します: PV /dev/sda2 VG pve lvm2 [931.01 GiB / 16.00 GiB free] PV /dev/md1 lvm2 [931.01 GiB] Total: 2 [1.82 TiB] / in use: 1 [931.01 GiB] / in no VG: 1 [931.01 GiB]
Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。