lvm:start
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| lvm:start [2016/12/14 23:51] – créée jonathan | lvm:start [2018/02/22 01:23] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 32: | Ligne 32: | ||
| * Pour " | * Pour " | ||
| < | < | ||
| - | rechercher la commande ... :) | + | mkfs -t xfs / |
| </ | </ | ||
| Ligne 56: | Ligne 56: | ||
| ===== Supprimer un volume ===== | ===== Supprimer un volume ===== | ||
| - | TODO | + | Les manipulations doivent être effectuées sur une partition démontée : |
| + | < | ||
| + | umount / | ||
| + | </ | ||
| + | Personnellement, | ||
| + | Booter sur un liveCD, ouvrir un terminal et monter toutes les partitions LVM disponibles : | ||
| + | < | ||
| + | vgchange -a y | ||
| + | </ | ||
| + | Supprimer la partition : | ||
| + | < | ||
| + | lvremove / | ||
| + | </ | ||
| - | ===== Étendre/Agrandir | + | ===== Étendre |
| + | __**À revoir**__ | ||
| + | Après avoir agrandit la taille de la partition, de la " | ||
| + | Ajouter l' | ||
| + | < | ||
| + | lvresize -l +100%FREE | ||
| + | </ | ||
| + | Enfin, redimensionner le système de fichiers : | ||
| + | * Pour " | ||
| + | < | ||
| + | resize2fs / | ||
| + | </ | ||
| + | |||
| + | * Pour " | ||
| + | < | ||
| + | xfs_growfs / | ||
| + | </ | ||
| + | ===== Étendre | ||
| ==== Ajouter l' | ==== Ajouter l' | ||
| Ligne 129: | Ligne 158: | ||
| ==== Agrandir le volume logique ==== | ==== Agrandir le volume logique ==== | ||
| Créer un volume physique LVM avec la nouvelle partition : | Créer un volume physique LVM avec la nouvelle partition : | ||
| - | ( sda4 n' | ||
| < | < | ||
| - | pvcreate /dev/sda4 | + | pvcreate /dev/sda3 |
| - | Physical volume "/dev/sda4" successfully created | + | Physical volume "/dev/sda3" successfully created |
| </ | </ | ||
| Ligne 138: | Ligne 166: | ||
| < | < | ||
| vgdisplay | grep "VG Name" | vgdisplay | grep "VG Name" | ||
| - | VG Name debian8-vg | + | VG Name debian |
| </ | </ | ||
| Étendre ce volume groupe au nouveau volume physique : | Étendre ce volume groupe au nouveau volume physique : | ||
| < | < | ||
| - | vgextend | + | vgextend |
| Volume group " | Volume group " | ||
| </ | </ | ||
| Ligne 148: | Ligne 176: | ||
| Étendre le volume logique : | Étendre le volume logique : | ||
| < | < | ||
| - | lvextend /dev/tl-debian8-vg/root /dev/sda4 | + | lvextend /dev/debian-vg/root /dev/sda3 |
| - | Extending logical volume root to 200 GiB | + | Extending logical volume root to 50 GiB |
| Logical volume root successfully resized | Logical volume root successfully resized | ||
| </ | </ | ||
| Ligne 157: | Ligne 185: | ||
| * Pour " | * Pour " | ||
| < | < | ||
| - | resize2fs / | + | resize2fs / |
| </ | </ | ||
| * Pour " | * Pour " | ||
| < | < | ||
| - | xfs_growfs / | + | xfs_growfs / |
| </ | </ | ||
| - | ===== Réduire un volume | + | ===== Réduire un volume ===== |
| - | TODO | + | Exemple, retirer 10Go à la partition /home : |
| + | < | ||
| + | df -h | head -1 && df -h | grep home | ||
| + | Sys. de fichiers | ||
| + | / | ||
| + | </ | ||
| + | Les manipulations doivent être effectuées sur une partition démontée : | ||
| + | < | ||
| + | umount / | ||
| + | </ | ||
| + | Personnellement, | ||
| + | Booter sur un liveCD, ouvrir un terminal et monter toutes les partitions LVM disponibles : | ||
| + | < | ||
| + | vgscan -c --mknodes | ||
| + | vgchange -a y | ||
| + | </ | ||
| + | Vérifier la partition qui va être manipulée, par exemple pour extX : | ||
| + | < | ||
| + | e2fsck / | ||
| + | </ | ||
| + | Ou directement corriger les éventuelles erreurs sans poser de questions : | ||
| + | < | ||
| + | fsck -y / | ||
| + | </ | ||
| + | Puis réduire la partition de " | ||
| + | < | ||
| + | lvreduce -rL -10G / | ||
| + | </ | ||
| + | Les options utilisées : | ||
| + | < | ||
| + | -L, --size [-]LogicalVolumeSize[bBsSkKmMgGtTpPeE] | ||
| + | Reduce or set the logical volume size in units of megabytes. A size suffix of k for | ||
| + | kilobyte, m for megabyte, g for gigabytes, t for terabytes, p for petabytes or e for | ||
| + | exabytes is optional. With the - sign the value will be subtracted from the logical | ||
| + | volume' | ||
| + | -r, --resizefs | ||
| + | Resize underlying filesystem together with the logical volume using fsadm(8). | ||
| + | </ | ||
| + | < | ||
| + | fsadm utility checks or resizes the filesystem on a device. It tries to use the same API | ||
| + | for ext2, ext3, ext4, ReiserFS and XFS filesystem. | ||
| + | </ | ||
lvm/start.1481755902.txt.gz · Dernière modification : (modification externe)
