Proxmox · 6 min read · Nov 28, 2025
Proxmox VE 2.x Mit Software Raid
Proxmox VE 2.x Mit Software Raid
Proxmox Virtual Environment ist eine einfach zu bedienende Open Source-Virtualisierungsplattform zum Ausführen von virtuellen Appliances und virtuellen Maschinen. Proxmox unterstützt offiziell kein Software-Raid, aber ich habe festgestellt, dass Software-Raid sehr stabil ist und in einigen Fällen hatte ich damit mehr Glück als mit Hardware-Raid.
Ich gebe keine Garantie, dass dies für Sie funktioniert!
Übersicht
Zuerst installieren Sie Proxmox V2 auf die normale Weise mit der CD, die von Proxmox heruntergeladen wurde. Als nächstes erstellen wir ein RAID 1-Array auf der zweiten Festplatte und verschieben die Proxmox-Installation dorthin.
Dann passen wir die Grub-Einstellungen an, damit es mit der neuen Konfiguration bootet.
Danksagungen
Diese folgenden Tutorials sind das, was ich verwendet habe:
Ein besonderer Dank geht an Falko von HowtoForge, da ein Großteil dieses Materials aus seinem How-To wiederverwendet wurde. https://www.howtoforge.com/linux_lvm
Installation von Proxmox
Installieren Sie Proxmox von der neuesten heruntergeladenen CD von Proxmox http://www.proxmox.com/downloads/proxmox-ve/17-iso-images
Wenn Sie eine ext4-Installation möchten, geben Sie dies an der Boot-Eingabeaufforderung ein:
linux ext4Installationsanweisungen hier: http://pve.proxmox.com/wiki/Quick_installation
Melden Sie sich dann mit SSH an und führen Sie aus:
apt-get update
apt-get upgrade
Installation von Raid
Hinweis: Dieses Tutorial geht davon aus, dass Proxmox auf /dev/sda installiert ist und die Ersatzdisk /dev/sdb ist. Verwenden Sie den folgenden Befehl, um die aktuelle Partitionierung aufzulisten:
fdisk -l
Die Ausgabe sollte wie folgt aussehen:
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
Es gibt hier mehr, aber wir kümmern uns vorerst nur um die ersten beiden Festplatten. Wir können sehen, dass /dev/sda die Proxmox-Installation hat und /dev/sdb keine Partitionen hat.
Zuerst installieren wir Software-Raid, auch bekannt als mdraid:
apt-get install mdadm
Im Konfigurationsfenster des Pakets wählen Sie ok und dann all.
Als nächstes starten wir die Kernel-Module mit modprobe:
modprobe linear
modprobe raid0
modprobe raid1
modprobe raid5
modprobe raid6
modprobe raid10
Führen Sie jetzt aus:
cat /proc/mdstat
Die Ausgabe sollte wie folgt aussehen:
root@proxmox:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
unused devices:
root@proxmox:~#
Jetzt müssen wir die Partitionstabelle von sda nach sdb kopieren:
sfdisk -d /dev/sda | sfdisk –force /dev/sdb
Die Ausgabe sollte sein:
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, sagen wir, dann verwenden Sie dd(1)
, um die ersten 512 Bytes zu nullen: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
( Siehe 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.
Jetzt müssen wir die Partitionstypen auf Linux-Raid-Autodetect ändern:
fdisk /dev/sdb
root@proxmox:/# fdisk /dev/sdb
WARNING: DOS-kompatibler Modus ist veraltet. Es wird dringend empfohlen,
diesen Modus auszuschalten (Befehl ‘c’) und die Anzeigeeinheiten auf
Sektoren zu ändern (Befehl ‘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.
Wie wir sehen können, haben wir jetzt zwei Linux-Raid-Autodetect-Partitionen auf /dev/sdb.
Um sicherzustellen, dass keine Reste von vorherigen RAID-Installationen auf /dev/sdb vorhanden sind, führen wir die folgenden Befehle aus:
mdadm –zero-superblock /dev/sdb1
mdadm –zero-superblock /dev/sdb2
Wenn keine Reste von vorherigen RAID-Installationen vorhanden sind, wird jeder der obigen Befehle einen Fehler wie diesen ausgeben (was nichts ist, worüber man sich Sorgen machen muss):
root@proxmox:~# mdadm –zero-superblock /dev/sdb1
mdadm: Unrecognised md component device - /dev/sdb1
root@server1:~#
Andernfalls zeigen die Befehle überhaupt nichts an.
Jetzt müssen wir unsere neuen Raid-Arrays erstellen:
mdadm –create /dev/md0 –level=1 –raid-disks=2 missing /dev/sdb1
mdadm –create /dev/md1 –level=1 –raid-disks=2 missing /dev/sdb2
Dies wird anzeigen (antworten Sie ja):
root@proxmox:/# mdadm –create /dev/md0 –level=1 –raid-disks=2 missing /dev/sdb1
mdadm: Hinweis: dieses Array hat Metadaten am Anfang und
kann möglicherweise nicht als Boot-Gerät geeignet sein. Wenn Sie planen,
‘/boot’ auf diesem Gerät zu speichern, stellen Sie bitte sicher, dass
Ihr Bootloader md/v1.x-Metadaten versteht, oder verwenden Sie
–metadata=0.90
Fortfahren mit der Erstellung des Arrays? y
mdadm: Standardmäßig auf Version 1.2-Metadaten
mdadm: Array /dev/md0 gestartet.
root@proxmox:/#
Der Befehl
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:
Erhalte neue Beiträge in deinem Posteingang.
Kein Spam. Jederzeit abmelden.