Usei o Gparted Live cd para redimensionar um grupo de volumes e uma partição lógica quando reinicio e tento usar, lvextend –l +100%FREE /dev/vda5
recebo esta mensagem:
Path required for Logical Volume "–l"
Please provide a volume group name
Run `lvextend --help' for more information.
Aqui está pvs
minha lvs
saída vgs
:
VG #PV #LV #SN Attr VSize VFree
d8dev-vg 1 2 0 wz--n- 9.76g 5.01g
PV VG Fmt Attr PSize PFree
/dev/vda5 d8dev-vg lvm2 a-- 9.76g 5.01g
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
root d8dev-vg -wi-ao--- 3.75g
swap_1 d8dev-vg -wi-ao--- 1020.00m
e aqui está df -h
a saída
Filesystem Size Used Avail Use% Mounted on
udev 487M 4.0K 487M 1% /dev
tmpfs 100M 632K 99M 1% /run
/dev/dm-0 3.7G 3.2G 325M 91% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 498M 184K 497M 1% /run/shm
none 100M 0 100M 0% /run/user
/dev/vda1 236M 37M 188M 17% /boot
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/a5516e7a4136a510a3b6b388a57b266067cce4b2240db77a859910d3c741f988
shm 64M 0 64M 0% /var/lib/docker/containers/f5c852ead8bd3578b63fd5a259586c5a9c4b375b8505bb339e9f3c27cabc130f/shm
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/074360c189d2dae1477d9eeed419a86880355cab68c266155eb649aaee9e80ff
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/921ae5230e127989f8f12ecbd52a454965ed385531397fc46cfc5a82392ec876
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/eda6cf31040113c7216c4e07071596c724288071a94869b3606e90ea9fdc6034
shm 64M 0 64M 0% /var/lib/docker/containers/27d44748763ef03fea24464e11dde5498329ce438002812cc5168379825c5003/shm
shm 64M 0 64M 0% /var/lib/docker/containers/7a79506bb707843b3eea9d062f934e5f53a8ca72326a497559b0cd391f5f271b/shm
shm 64M 0 64M 0% /var/lib/docker/containers/78fbe6d2bccc7d29f08051a9ab4d2f02b0794fd7a95e28446e208184fa84b149/shm
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/d06efbeda0bcf8352e88aa078d23caf3855ae14dbd9100980c3431dfce5870a7
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/10dd1eb657163fb314d1fd5e7951645e957365b9760b46846491c8374e106039
shm 64M 0 64M 0% /var/lib/docker/containers/90a5ef4a9a761778fbad4bd052426263f5fe14d5248aaf7cdecd87013fb2c706/shm
shm 64M 0 64M 0% /var/lib/docker/containers/dd20465dc2764916efb2d29887dfe76d3bf8cf823b9e032d7ec399aa40dc083f/shm
none 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/966dc571c622e09757ceebbfefd540a6ab4b27922b2fbab8615277e343a67357
shm 64M 0 64M 0% /var/lib/docker/containers/312cceb4eb20613ad493df37097ab47a204da19669c3aa065feb7fc9818c126c/shm
Eu tentei esses comandos
lvextend –l +100%FREE /dev/vda5
lvextend –l +100%FREE d8dev-vg
lvextend –l +100%FREE /dev/root
Mas tudo na mesma saída
Path required for Logical Volume "–l"
Please provide a volume group name
EDITAR:Eu fiz lvextend /dev/dm-0 /dev/vda5
agora minha lvs
saída é:
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
root d8dev-vg -wi-ao--- 8.76g
swap_1 d8dev-vg -wi-ao--- 1020.00m
Mas /dev/dm-0
ainda é baixo:
Filesystem Size Used Avail Use% Mounted on
udev 487M 4.0K 487M 1% /dev
tmpfs 100M 632K 99M 1% /run
/dev/dm-0 3.7G 3.2G 325M 91% /
EDITAR 2: vgdisplay
e lvdisplay
:
--- Volume group ---
VG Name d8dev-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 9.76 GiB
PE Size 4.00 MiB
Total PE 2498
Alloc PE / Size 2498 / 9.76 GiB
Free PE / Size 0 / 0
VG UUID AGVHqT-IO1R-l3uB-AeN4-q62b-z33r-b4NwS7
--- Logical volume ---
LV Path /dev/d8dev-vg/root
LV Name root
VG Name d8dev-vg
LV UUID qet8dK-Izh1-uJul-2T0R-rDyy-ONNH-Xwvs2h
LV Write Access read/write
LV Creation host, time d8dev, 2016-05-19 08:17:01 -0700
LV Status available
# open 1
LV Size 8.76 GiB
Current LE 2243
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Logical volume ---
LV Path /dev/d8dev-vg/swap_1
LV Name swap_1
VG Name d8dev-vg
LV UUID 4mbhDG-PmAN-Fym3-yXSI-gRkd-owki-eYqWqj
LV Write Access read/write
LV Creation host, time d8dev, 2016-05-19 08:17:01 -0700
LV Status available
# open 2
LV Size 1020.00 MiB
Current LE 255
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
DF -º
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 487M 4.0K 487M 1% /dev
tmpfs tmpfs 100M 632K 99M 1% /run
/dev/dm-0 ext4 3.7G 3.2G 325M 91% /
none tmpfs 4.0K 0 4.0K 0% /sys/fs/cgroup
none tmpfs 5.0M 0 5.0M 0% /run/lock
none tmpfs 498M 184K 497M 1% /run/shm
none tmpfs 100M 0 100M 0% /run/user
/dev/vda1 ext2 236M 37M 188M 17% /boot
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/a5516e7a4136a510a3b6b388a57b266067cce4b2240db77a859910d3c741f988
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/f5c852ead8bd3578b63fd5a259586c5a9c4b375b8505bb339e9f3c27cabc130f/shm
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/074360c189d2dae1477d9eeed419a86880355cab68c266155eb649aaee9e80ff
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/921ae5230e127989f8f12ecbd52a454965ed385531397fc46cfc5a82392ec876
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/eda6cf31040113c7216c4e07071596c724288071a94869b3606e90ea9fdc6034
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/27d44748763ef03fea24464e11dde5498329ce438002812cc5168379825c5003/shm
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/7a79506bb707843b3eea9d062f934e5f53a8ca72326a497559b0cd391f5f271b/shm
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/78fbe6d2bccc7d29f08051a9ab4d2f02b0794fd7a95e28446e208184fa84b149/shm
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/d06efbeda0bcf8352e88aa078d23caf3855ae14dbd9100980c3431dfce5870a7
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/10dd1eb657163fb314d1fd5e7951645e957365b9760b46846491c8374e106039
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/90a5ef4a9a761778fbad4bd052426263f5fe14d5248aaf7cdecd87013fb2c706/shm
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/dd20465dc2764916efb2d29887dfe76d3bf8cf823b9e032d7ec399aa40dc083f/shm
none aufs 3.7G 3.2G 325M 91% /var/lib/docker/aufs/mnt/966dc571c622e09757ceebbfefd540a6ab4b27922b2fbab8615277e343a67357
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/312cceb4eb20613ad493df37097ab47a204da19669c3aa065feb7fc9818c126c/shm
Responder1
Ao trabalhar com LVM (Logical Volume Manager) você deve ter em mente que a ordem de operação é imperativa. Se você não seguir a ordem, corre o risco de perder seus dados.
Se você já possui um PV
(Volume Físico) e um VG
(Grupo de Volumes), é mais fácil estender o grupo de volumes adicionando dispositivos adicionais.
Para estender o grupo de volumes, por exemplo, vg1
você pode fazer o seguinte:
vgextend vg1 /dev/vda5
Depois de estender o grupo de volumes, precisamos redimensionar nosso LV
(Volume Lógico)
Para estender o LV
você pode usar o seguinte
lvextend /dev/vg1/your_lv /dev/vda5
Neste estágio, apenas o volume lógico foi estendido, mas não o sistema de arquivos.
Para estender o sistema de arquivos, você pode usar resize2fs
seguido do caminho para o arquivo LV
. Por exemplo:
resize2fs /dev/vg1/your_lv
Obs: lvextend
possui a -r
flag que chama resize2fs
em background e faz essa operação automaticamente.
Para resumir o acima:
- Estenda o grupo de volumes
- Estenda o volume lógico
- Redimensionar o sistema de arquivos
Para reduzir um sistema de arquivos (não é possível com xfs
), siga o seguinte procedimento:
- Reduza o sistema de arquivos
- Reduza o tamanho do volume lógico
- Remova o dispositivo, por exemplo,
/dev/vda5
do grupo de volumes