Menü Schließen

Proxmox VE Cluster LVMthin Festplatte ersetzen

Proxmox VE Logo

Installiert ist in einer Testumgebung ein Proxmox VE 7.1 Cluster mit 3 Knoten. Für die virtuellen Maschinen liegt ein LVMthin auf allen 3 Knoten. Nachdem eine Festplatte auf einem Knoten ausgefallen ist und eine andere eingebaut wurde, musste diese für das vorhandene LVMThin Storage (vmstorage) konfiguriert werden. Die Schritte gehen, soweit ich sehen konnte nicht über die GUI, weshalb ich die neue HDD über die Konsole wie nachfolgend ins bestehende LVMThin aufgenommen habe.

Proxmox VE Menu Disks
Proxmox VE Menu Disks
Proxmox VE Übersicht Disks
Proxmox VE Übersicht Disks
  1. formatieren der neuen / alten Festplatte
# fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7B01CB69-B2D2-40F5-9CB8-10C91C458F76

Command (m for help): g
Created a new GPT disklabel (GUID: 78F8B82B-1EE7-594A-9AD5-F9B8E7380360).

Command (m for help): n
Partition number (1-128, default 1):<Enter>
First sector (2048-500118158, default 2048):<Enter>
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-500118158, default 500118158):<Enter>

Created a new partition 1 of type 'Linux filesystem' and of size 238.5 GiB.
Partition #1 contains a vfat signature.

Do you want to remove the signature? [Y]es/[N]o: y

The signature will be removed by a write command.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 8e
Type of partition 1 is unchanged: Linux filesystem.

Command (m for help): p
Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Disk model: Samsung SSD 850
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 78F8B82B-1EE7-594A-9AD5-F9B8E7380360

Device     Start       End   Sectors   Size Type
/dev/sda1   2048 500118158 500116111 238.5G Linux filesystem

Filesystem/RAID signature on partition 1 will be wiped.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

2. Nun die neue Partition als Phyisical Volume (PV) für das neue LVM vorbereiten. Die Optionen -ff = force und -y=alles mit Ja beantworten, setzen wobei die metadatasize beim LVM2 default mit 512Byte gentutzt wird:

# pvcreate -y -ff /dev/sda1
Physical volume "/dev/sda1" successfully created.

Status des erstellten Physical Volume anzeigen

# pvs
# pvdisplay

Nun wird die Volume Group (VG) mit dem Namen “vmstorage” erstellt:

# vgcreate vmstorage /dev/sda1

Status der soeben anagezeigten Volume Group anzeigen

# pvdisplay
# vgdisplay

Jetzt kann das logische Volumen (LV) über die gesamte Größe der Volume Group (VG), mit dem freien Namen “vmstorage” mit dem Namen des Logical Volume (LV) “vmdata” erstellt werden (-l=Größe, -T=thin, -n=Name)

# lvcreate -l100%FREE -T -n vmdata vmstorage

Status des eben erstellten logischen Volumen anzeigen:

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               vmstorage
  PV Size               238.47 GiB / not usable <1.32 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              61049
  Free PE               0
  Allocated PE          61049
  PV UUID               T43wrv-fscd-RekN-q4oq-UhTC-7kpw-J8W61w

# vgdisplay
 
  --- Volume group ---
  VG Name               vmstorage
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               238.47 GiB
  PE Size               4.00 MiB
  Total PE              61049
  Alloc PE / Size       61049 / 238.47 GiB
  Free  PE / Size       0 / 0
  VG UUID               yURkDu-QVK4-C5MH-3lHV-kOhi-tBhD-B27fNG

Danach wird in der Proxmox VE GUI sofort das vorhandene LVMthin als gefundenes Storage angezeigt.

Thats it … Have Fun!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert