Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen


Warning
titleAdvanced Topic

Warning - this is an advanced topic. Always backup your data first.

Erweitern des Stores mit LVM

Die meisten Linux / CentOS Installationen von uns arbeiten mit LVM. Dies kann man - vorausgesetzt das System erkennt eine Plattenvergrößerung oder neue Platte, wie folgt erweitern. Hier die Prozedur für eine Plattenerweiterung.

Schritt 1 - Feststellen der aktuellen config


Translations Ignore


Code Block
languagebash
titleDisplay of discs
# FallsIf the diemachine Maschinehas nochnot nichtyet neugestartetbeen wurderebooted, kannthe derSCSI SCSIbus Buscan mitbe folgendenscanned Befehlto gescanneddetect werden,new damitdisks neuewith Plattenthe erkanntfollowing werdencommand
# Ggf - falls mehrere SCSI Adapter vorhanden sind host0 mit host1 oder host2 ... nochmals probieren bis die Platte gefunden wird
echo "- - -" > /sys/class/scsi_host/host0/scan
# FreierShow Platzfree anzeigenspace
df -h
# PartitionenShow anzeigenpartitions
fdisk -l
# Show Festplattenhard anzeigendrives
ls /dev/sd*
# PhysischeView Volumesphysical anzeigenvolumes diemanaged durchby LVM verwaltet werden
lvm pvs
# LogischeDisplay Volumeslogical anzeigenvolumes diemanaged durchby LVM verwaltet werden
lvm lvs
# LogischeDisplay Volumelogical Gruppenvolume anzeigengroups diemanaged durchby LVM verwaltet werden
lvm vgs
# WoWhere istis waswhat gemountedmounted
mount



Die Informationen oben werden nun unten gebraucht. 

Schritt 2 - Anlegen einer neuen Partition

Hier ist es erforderlich, dass man weiß, wo der zusätzlicher Platz zu finden ist. Es gibt 2 Varianten - entweder eine neue Platte, oder eine erweiterte Platte. 

In beiden Fällen, wird eine neue Partition angelegt. Hier in diesen Beispiel, wurde die bestehende Platte erweitert. Falls eine neue Platte hinzugefügt wurde, dann ist es auf /dev/sdb oder /dev/sdc etc. zu finden.

Die Befehle unten sowie die Partitionsnummer (bei einer neuen Platte ist die Partition dann 1), entsprechend anpassen.

Translations Ignore


Code Block
languagebash
titlePartitioning with fdisk
fdisk /dev/sda
 
# --> BearbeitenEdit derthe Partitionenpartitions aufon /dev/sda
 
n
# --> NeueCreate Partitionnew anlegenpartition
p
# --> NeueNew primary partition
3
# --> Create Neuenew Partitionpartition 3 anlegen(view (Ausgabeoutput beiat fdisk -1 oben betrachtenabove)
Enter
# --> BestätigungConfirmation dassthat derthe erstefirst verfügbareravailable Zylindercylinder verwendetshould werdenbe sollused
Enter
# --> Confirmation Bestätigungthat dassthe derlast letzteavailable verfügbarercylinder Zylinderis verwendetto werdenbe sollused (ergibtgives inthe Summemaximum diesize maximalein Größetotal)
t
# --> TypChange derpartition Partition änderntype
3
# --> PartitionEdit partition 3 bearbeiten
8e
# --> Linux LVM
w
# --> SchreibenWrite
 
reboot now




Schritt 3 - Hereinnahme in LVM - Device Erzeugen

Translations Ignore


Code Block
languagebash
titleCreate device for LVM
# Here Hieris diethe Ausgabeprevious vorheroutput vonof /dev/sd* --> dasthis hieris istthe dienew neuedisk Platte (diethe 3.3rd Partitionpartition aufon /dev/sda, sprichthe diefirst erste Festplattedisk)
lvm pvcreate /dev/sda3



Schritt 4 - Volume Group erweitern

Translations Ignore


Code Block
languagebash
titleExtend LVM
# HierHere we wirdneed diethe Ausgabeoutput vonof lvm vgs benötigt- -the dername Nameof desthe Volumevolume Groupsgroup
lvm vgextend "vg_testdb5" /dev/sda3



Schritt 5 - Logical Volume erweitern

Translations Ignore


Code Block
languagebash
titleExtend LVM
# HierHere wirdthe dieoutput Ausgabeof von lvm lvs benötigtis needed - the dername Nameof desthe Logischenlogical Volumesvolume - diesthis is wirdcombined mitwith denthe vgs kombiniert,to damitcreate derthe Pfadpath zumto Devicethe entstehtdevice
lvm lvresize -l +100%FREE /dev/vg_testdb5/lv_root



Schritt 6 - File System erweitern

Translations Ignore


Code Block
languagebash
titleExtend LVM - ext filesystems
# GleicherSame pfadpath wieas vorherigerprevious Befehlcommand
resize2fs /dev/vg_testdb5/lv_root



Translations Ignore


Code Block
languagebash
titleExtend LVM - xfs filesystems
# Mount Point ausfrom fstab
xfs_growfs /srv/jtel/shared



Schritt 7 - Endergebnis prüfen!

Translations Ignore


Code Block
languagebash
titleCheck final result
df -h




...