From 789e3f91c75967243c0ac2dd2183484f95c921fd Mon Sep 17 00:00:00 2001 From: Daniel Jakots Date: Thu, 29 Dec 2016 12:13:06 -0500 Subject: [PATCH] mise a jour du resize avec lvm --- HowtoLVM.md | 58 ++++++++++++++++++++++------------------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/HowtoLVM.md b/HowtoLVM.md index eb9cbf1e..52bf33c9 100644 --- a/HowtoLVM.md +++ b/HowtoLVM.md @@ -363,52 +363,42 @@ Do you really want to remove active logical volume "testlvm2"? [y/n]: y ### Augmenter la taille d'un LV +`lvextend` peut se charger d'augmenter le système de fichier sous-jacent +(avec `-r`). On peut indiquer l'augmentation en relatif ou en absolu +(`-L+10G` ou `-L50G`). + ~~~ # umount /dev/mylvmtest/thirdlvmvol -# lvextend -L+1G /dev/mylvmtest/thirdlvmvol - Extending logical volume thirdlvmvol to 4,00 GB - Logical volume thirdlvmvol successfully resized +# lvextend -r -L+10G /dev/mylvmtest/thirdlvmvol +fsck from util-linux 2.25.2 +BACKUP: clean, 11/704854016 files, 89036065/2819416064 blocks + Size of logical volume mylvmtest/thirdlvmvol changed from 2.63 TiB (688334 extents) to 2.64 TiB (690894 extents). + Logical volume backup successfully resized +resize2fs 1.42.12 (29-Aug-2014) +Resizing the filesystem on /dev/mapper/myvmtest-thirdlvmvol to 2829901824 (1k) blocks. -# resize2fs -p /dev/mylvmtest/thirdlvmvol -# e2fsck -f /dev/mylvmtest/thirdlvmvol -C0 -e2fsck 1.35 (28-Feb-2004) -Passe 1: vérification inodes, blocs, et des tailles -Passe 2: vérification de la structure répertoire -Passe 3: vérification de lca connectivité répertoire -Pass 4: vérification des compteur de références -Pass 5: vérification de l'information du sommaire groupe -/dev/mylvmtest/thirdlvmvol: 11/393216 fichier (0.0% non - blocs - -# resize2fs -p /dev/mylvmtest/thirdlvmvol -resize2fs 1.35 (28-Feb-2004) -Resizing the filesystem on /dev/mylvmtest/thirdlvmvol to -Le système de fichiers /dev/mylvmtest/thirdlvmvol a main -8576 blocs. +# mount /dev/mylvmtest/thirdlvmvol ~~~ ### Réduire la taille d'un LV -~~~ - ACTIVE '/dev/mylvmtest/secondlvmvol' [60,00 GB] inherit +`lvreduce` peut se charger de réduire le système de fichier sous-jacent +(avec `-r`). On peut indiquer la réduction en relatif ou en absolu +(`-L-10G` ou `-L50G`). +~~~ # umount /dev/mylvmtest/secondlvmvol -# e2fsck -f /dev/mylvmtest/secondlvmvol -C0 +# lvreduce -L-300G /dev/mylvmtest/secondlvmvol +fsck from util-linux 2.25.2 +BACKUP: 11/783497216 files (0.0% non-contiguous), 98946865/3133988864 blocks +resize2fs 1.42.12 (29-Aug-2014) +Resizing the filesystem on /dev/mapper/mylvmtest-secondlvmvol to 2819416064 (1k) blocks. -# resize2fs /dev/mylvmtest/secondlvmvol 50G -resize2fs 1.41.12 (17-May-2010) -Resizing the filesystem on /dev/mylvmtest/secondlvmvol to 13107200 (4k) blocks. -The filesystem on /dev/mylvmtest/secondlvmvol is now 13107200 blocks long. - -# lvreduce -L-10G /dev/mylvmtest/secondlvmvol - WARNING: Reducing active logical volume to 50,00 GB - THIS MAY DESTROY YOUR DATA (filesystem etc.) -Do you really want to reduce secondlvmvol? [y/n]: y - Reducing logical volume secondlvmvol to 50,00 GB - Logical volume secondlvmvol successfully resized + Size of logical volume mylvmtest/secondlvmvol changed from 2.92 TiB (765134 extents) to 2.63 TiB (688334 extents). + Logical volume backup successfully resized # mount /dev/mylvmtest/secondlvmvol ~~~ @@ -457,4 +447,4 @@ On peut éventuellement les restaurer via la commande `vgcfgrestore`. ~~~ # dmestup info -c # dmestup info -~~~ \ No newline at end of file +~~~