Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Content imported from a Scroll Translations translation file.
Sv translation
languageen


Warning
titleAdvanced Topic

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

Expanding the store with LVM

Most of our Linux / CentOS installations work with LVM. This can be extended - provided the system recognizes a plate enlargement or new plate - as follows. Here is the procedure for a disk expansion.

Step 1 - Determining the current config


Translations Ignore


Code Block
languagebash
titleDisplay of discs
# If the machine has not yet been rebooted, the SCSI bus can be scanned to detect new disks with the following command
# 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
# Show free space
df -h
# Show partitions
fdisk -l
# Show hard drives
ls /dev/sd*
# View physical volumes managed by LVM
lvm pvs
# Display logical volumes managed by LVM
lvm lvs
# Display logical volume groups managed by LVM
lvm vgs
# Where is what mounted
mount



The information above is now needed below. 

Troubleshooting (already):

Sometimes, you might see output from frisk -l which looks strange. 

For example, you have several disks reported in /dev like this:

/dev/sda
/dev/sda1
/dev/sda2
/dev/sda3

However, fdisk -l reports something strange like this:


Device Boot Start End Blocks Id System
/dev/sda1 1 134217727 67108863+ ee GPT
Partition 1 does not start on physical sector boundary.

Therefore, not all of the /dev/sda* disks are visible. This means the disk has been resized in the background, but the OS cannot read the partitions correctly.

The best way to fix this is using parted.

Run parted on the disk, and then input print.

You will be then asked for a couple of fixes. Input Fix at each point, then then quit.

Now running fdisk -l should give the correct output.

Here is an example run:

Code Block
[root@con-jtel-dbm-2 ~]# parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? Fix                                                    
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 134217728 blocks) or continue with the current setting? 
Fix/Ignore? Fix                                                           
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 137GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  211MB   210MB   fat16        EFI System Partition  boot
 2      211MB   1285MB  1074MB  xfs
 3      1285MB  68.7GB  67.4GB                                     lvm
(parted) quit                                                             


Step 2 - Creating a new partition

Here it is necessary to know where the additional space can be found. There are 2 variants - either a new plate, or an extended plate. 

In both cases, a new partition is created. Here in this example, the existing plate was extended. If a new disk was added, it can be found on /dev/sdb or /dev/sdc etc.

Adjust the commands below and the partition number (for a new disk, the partition will be 1) accordingly.

Translations Ignore


Code Block
languagebash
titlePartitioning with fdisk
fdisk /dev/sda
 
# --> Edit the partitions on /dev/sda
 
n
# --> Create new partition
p
# --> New primary partition
3
# --> Create new partition 3 (view output at fdisk -1 above)
Enter
# --> Confirmation that the first available cylinder should be used
Enter
# --> Confirmation that the last available cylinder is to be used (gives the maximum size in total)
t
# --> Change partition type
3
# --> Edit partition 3
8e
# --> Linux LVM
w
# --> Write 
fdisk -l  
# --> Check result




Step 3 - Adoption into LVM - Create Device

Translations Ignore


Code Block
languagebash
titleCreate device for LVM
# Here is the previous output of /dev/sd* --> this is the new disk (the 3rd partition on /dev/sda, the first disk)
lvm pvcreate /dev/sda3



Step 4 - Expand Volume Group

Translations Ignore


Code Block
languagebash
titleExtend LVM
# Here we need the output of lvm vgs - the name of the volume group
lvm vgextend "vg_testdb5" /dev/sda3



Step 5 - Extend Logical Volume

Translations Ignore


Code Block
languagebash
titleExtend LVM
# Here the output of lvm lvs is needed - the name of the logical volume - this is combined with the vgs to create the path to the device
lvm lvresize -l +100%FREE /dev/vg_testdb5/lv_root



Step 6 - Extend File System

Translations Ignore


Code Block
languagebash
titleExtend LVM - ext filesystems
# Same path as previous command
resize2fs /dev/vg_testdb5/lv_root



Translations Ignore


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



Step 7 - Check final result!

Translations Ignore


Code Block
languagebash
titleCheck final result
df -h




Partitionierung mit Device für erzeugen erweitern erweitern erweiternEndergebnis prüfen
Sv translation
languagede


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
title
Anzeige der disks
Display of discs
# If the machine has not yet been rebooted, the SCSI bus can be scanned to detect new disks with the following command
# 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
# Show free space
# Freier Platz anzeigen

df -h
# 
Partitionen
Show 
anzeigen
partitions
fdisk -l
# 
Festplatten
Show hard 
anzeigen
drives
ls /dev/sd*
# 
Physische
View 
Volumes
physical 
anzeigen
volumes 
die
managed 
durch
by LVM
verwaltet werden

lvm pvs
# 
Logische
Display 
Volumes
logical 
anzeigen
volumes 
die
managed 
durch
by LVM
verwaltet werden

lvm lvs
# 
Logische
Display 
Volume
logical 
Gruppen
volume 
anzeigen
groups 
die
managed 
durch
by LVM
verwaltet werden

lvm vgs
# 
Wo
Where 
ist
is 
was
what 
gemounted
mounted
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
title
Partitioning with fdisk
fdisk /dev/sda
 
# --> 
Bearbeiten
Edit 
der
the 
Partitionen
partitions 
auf
on /dev/sda
 
n
# --> 
Neue
Create 
Partition
new 
anlegen
partition
p
# --> 
Neue
New primary partition
3
# --> Create 
Neue
new 
Partition
partition 3 
anlegen
(view 
(Ausgabe
output 
bei
at fdisk -1 
oben betrachten
above)
Enter
# --> 
Bestätigung
Confirmation 
dass
that 
der
the 
erste
first 
verfügbarer
available 
Zylinder
cylinder 
verwendet
should 
werden
be 
soll
used
Enter
# --> Confirmation 
Bestätigung
that 
dass
the 
der
last 
letzte
available 
verfügbarer
cylinder 
Zylinder
is 
verwendet
to 
werden
be 
soll
used (
ergibt
gives 
in
the 
Summe
maximum 
die
size 
maximale
in 
Größe
total)
t
# --> 
Typ
Change 
der
partition 
Partition ändern
type
3
# --> Edit 
Partition
partition 3
bearbeiten

8e
# --> Linux LVM
w
# --> 
Schreiben
Write
 
reboot now




Schritt 3 - Hereinnahme in LVM - Device Erzeugen

Translations Ignore


Code Block
languagebash
title
Create device for LVM
# Here 
Hier
is 
die
the 
Ausgabe
previous 
vorher
output 
von
of /dev/sd* --> 
das
this 
hier
is 
ist
the 
die
new 
neue
disk 
Platte
(
die
the 
3.
3rd 
Partition
partition 
auf
on /dev/sda, 
sprich
the 
die
first 
erste Festplatte
disk)
lvm pvcreate /dev/sda3



Schritt 4 - Volume Group erweitern

Translations Ignore


Code Block
languagebash
titleExtend LVM
# Here 
Hier
we 
wird
need 
die
the 
Ausgabe
output 
von
of lvm vgs 
benötigt
- 
-
the 
der
name 
Name
of 
des
the 
Volume
volume 
Groups
group
lvm vgextend "vg_testdb5" /dev/sda3



Schritt 5 - Logical Volume erweitern

Translations Ignore


Code Block
languagebash
titleExtend LVM
# 
Hier
Here 
wird
the 
die
output 
Ausgabe
of 
von
lvm lvs 
benötigt
is needed - 
der
the name 
Name
of 
des
the 
Logischen
logical 
Volumes
volume - 
dies
this is 
wird
combined 
mit
with 
den
the vgs 
kombiniert,
to 
damit
create 
der
the 
Pfad
path 
zum
to 
Device
the 
entsteht
device
lvm lvresize -l +100%FREE /dev/vg_testdb5/lv_root



Schritt 6 - File System erweitern

Translations Ignore


Code Block
languagebash
titleExtend LVM
- ext filesystems
# 
Gleicher
Same 
pfad
path 
wie
as 
vorheriger
previous 
Befehl
command
resize2fs /dev/vg_testdb5/lv_root



Translations Ignore


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



Schritt 7 - Endergebnis prüfen!

Translations Ignore


Code Block
languagebash
title
Check final result
df -h




Sv translation
languagefr


Warning
titleSujet avancé

Attention - il s'agit d'un sujet avancé. Sauvegardez toujours vos données en premier.

Agrandir le magasin avec LVM

La plupart de nos installations Linux / CentOS fonctionnent avec LVM. Elle peut être étendue - à condition que le système reconnaisse un élargissement de la plaque ou une nouvelle plaque - comme suit. Voici la procédure à suivre pour une extension de disque.

Étape 1 - Détermination de la configuration actuelle


Translations Ignore


Code Block
languagebash
titleAffichage de disques
# Si la machine n'a pas encore été redémarrée, le bus SCSI peut être scanné pour détecter de nouveaux disques avec la commande suivante # Ggf - falls mehrere Adapter SCSI vorhanden sind host0 mit host1 oder host2 ... nochmals probieren bis die Platte gefunden wird echo "- - -" > /sys/class/scsi_host/host0/scan # Afficher l'espace libre df -h # Afficher les partitions fdisk -l # Afficher les disques durs ls /dev/sd* # Afficher les volumes physiques gérés par LVM lvm pvs # Afficher les volumes logiques gérés par LVM lvm lvs # Afficher les groupes de volumes logiques gérés par LVM lvm vgs # Où est ce qui est monté



Les informations ci-dessus sont maintenant nécessaires ci-dessous. 

Dépannage (déjà) :

Parfois, vous pouvez voir les résultats de la recherche -l, ce qui semble étrange. 

Par exemple, vous avez plusieurs disques signalés dans /dev comme ceci :

/dev/sda
/dev/sda1
/dev/sda2
/dev/sda3

Cependant, fdisk -l rapporte quelque chose d'étrange comme ceci :


Appareil Démarrage Début Fin Blocs Id Système
/dev/sda1 1 134217727 67108863+ ee GPT
La partition 1 ne commence pas à la limite physique du secteur.

Par conséquent, tous les disques /dev/sda* ne sont pas visibles. Cela signifie que le disque a été redimensionné en arrière-plan, mais que le système d'exploitation ne peut pas lire les partitions correctement.

La meilleure façon de remédier à cette situation est d'utiliser parted.

Exécutez "parted" sur le disque, puis entrez imprimer.

On vous demandera ensuite de faire quelques corrections. Saisissez Fixer à chaque point, puisquitter.

Maintenant, l'exécution de fdisk -l devrait donner la sortie correcte.

Voici un exemple d'exécution :

Code Block
[root@con-jtel-dbm-2 ~]# parted /dev/sda GNU Parted 3.1 Using /dev/sda Bienvenue à GNU Parted! Tapez "aide" pour afficher une liste de commandes. Erreur d'impression (partielle): La table GPT de sauvegarde n'est pas à la fin du disque, comme elle devrait l'être. Cela pourrait signifier qu'un autre système d'exploitation pense que le disque est plus petit. Réparer, en déplaçant la sauvegarde vers la fin (et en retirant l'ancienne sauvegarde)? Réparer/Ignorer/Annuler? Correction de l'avertissement: Tout l'espace disponible pour /dev/sda ne semble pas être utilisé, vous pouvez fixer le GPT pour utiliser tout l'espace (134217728 blocs supplémentaires) ou continuer avec le réglage actuel? Réparer/Ignorer? Corriger le modèle: Msft Virtual Disk (scsi) Disque /dev/sda : 137GB Taille du secteur (logique/physique): 512B/4096B Table de partition : gpt Disk Flags: Numéro Début Fin Taille Système de fichiers Nom Drapeaux 1 1049kB 211MB 210MB fat16 Système EFI Partition boot 2 211MB 1285MB 1074MB xfs 3 1285MB 68.7GB 67.4GB lvm (parted) quit 


Étape 2 - Créer une nouvelle partition

Il est nécessaire ici de savoir où se trouve l'espace supplémentaire. Il existe deux variantes : soit une nouvelle plaque, soit une plaque étendue. 

Dans les deux cas, une nouvelle partition est créée. Dans cet exemple, la plaque existante a été étendue. Si un nouveau disque a été ajouté, il peut être trouvé sur /dev/sdb ou /dev/sdc etc.

Ajustez les commandes ci-dessous et le numéro de partition (pour un nouveau disque, la partition sera 1) en conséquence.

Translations Ignore


Code Block
languagebash
titlePartitionnement avec fdisk
fdisk /dev/sda   # --> Edit the partitions on /dev/sda   n # --> Create new partition p # --> New primary partition 3 # --> Create new partition 3 (view output at fdisk -1 above) Enter # --> Confirmation that the first available cylinder should be used Enter # --> Confirmation that the last available cylinder is to be used (gives the maximum size in total) t # --> Change partition type 3 # --> Edit partition 3 8e # --> Linux LVM w # --> Write fdisk -l   # --> Check result 




Étape 3 - Adoption dans LVM - Créer un appareil

Translations Ignore


Code Block
languagebash
titleCréer un appareil pour LVM
# Voici la sortie précédente de /dev/sd* --> c'est le nouveau disque (la 3ème partition de /dev/sda, le premier disque) lvm pvcreate /dev/sda3



Étape 4 - Élargir le groupe de volume

Translations Ignore


Code Block
languagebash
titleÉtendre LVM
# Ici nous avons besoin de la sortie de lvm vgs - le nom du groupe de volume lvm vgextend "vg_testdb5" /dev/sda3



Étape 5 - Étendre le volume logique

Translations Ignore


Code Block
languagebash
titleÉtendre LVM
# Ici la sortie de lvm lvs est nécessaire - le nom du volume logique - celui-ci est combiné avec les vgs pour créer le chemin vers le périphérique lvm lvresize -l +100%FREE /dev/vg_testdb5/lv_root



Étape 6 - Étendre le système de fichiers

Translations Ignore


Code Block
languagebash
titleExtend LVM - systèmes de fichiers ext
# Même chemin que la commande précédente resize2fs /dev/vg_testdb5/lv_root



Translations Ignore


Code Block
languagebash
titleÉtendre les systèmes de fichiers LVM - xfs
# Point de montage de fstab xfs_growfs /srv/ jtel/shared



Étape 7 - Vérifiez le résultat final !

Translations Ignore


Code Block
languagebash
titleVérifier le résultat final
df -h