Antonio da Silva Martins Junior
2021-Apr-09 19:02 UTC
[CentOS] Resize a VM: any risk involved ?
Hi,
Wow... I didn't know about "growpart" :)
I do, however, on XenServer (now XCP-NG) almost the same thing for
ages:
- shutdown the VM
- increase disk size on XCenter
- boot VM on maintenance mode (with DVD boot)
- do fdisk /dev/xvda, remove the desired partition (in your case 3),
and recreate it with the same initial block and occupying the rest of the
disk.
- make what's is need to use the new space on the partition, in my
case it's a LVM partition used as a PVE block. Than pvresize, vgextend,
etc...
Until now, no problems...
Att.,
Antonio.
Em qui., 8 de abr. de 2021 ?s 12:44, Nicolas Kovacs <info at
microlinux.fr>
escreveu:
> Hi,
>
> I'm currently fiddling with KVM, Proxmox and various VMs.
>
> I setup a very basic VM with a manual (fdisk) partitioning scheme: one
> /boot
> partition, one swap partition, and one root partition, the latter being the
> last partition and thus expandable).
>
> I'm starting with a reduced disk size (6 GB in total) and a minimal
> installation. The idea behind this approach is that I can clone this
> minimal VM
> and then eventually expand it to fit my needs.
>
> Here's how I expand the available disk size.
>
> First I increase the virtual disk in the hypervisor.
>
> Then I fire up the VM and do the following:
>
> # yum install cloud-utils-growpart
> # lsblk
> # growpart -v /dev/sda 3
> # resize2fs /dev/sda3
>
> Now here's my question (finally): is there any risk involved in this
sort
> of
> operation? Or can it be performed on a production system without having to
> worry about data loss?
>
> Cheers from the sunny South of France,
>
> Niki
>
> --
> Microlinux - Solutions informatiques durables
> 7, place de l'?glise - 30730 Montpezat
> Site : https://www.microlinux.fr
> Blog : https://blog.microlinux.fr
> Mail : info at microlinux.fr
> T?l. : 04 66 63 10 32
> Mob. : 06 51 80 12 12
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
>
--
*Antonio da Silva Martins Jr. *
*Analista de Suporte*
NPD - N?cleo de Processamento de Dados
UEM - Universidade Estadual de Maring?
email: *asmartins at uem.br* <asmartins at uem.br>
fone: +55 (44) 3011-4015 / 3011-4411
inoc-dba: 263076*100
"Real Programmers don?t need comments ? the code is obvious."
> Hi, > > Wow... I didn't know about "growpart" :) > > I do, however, on XenServer (now XCP-NG) almost the same thing for > ages: > > - shutdown the VMI thought we're talking about doing it online, which is quite a different thing because rereading partition layouts isn't always working as expected without a reboot. Regards, Simon> - increase disk size on XCenter > - boot VM on maintenance mode (with DVD boot) > - do fdisk /dev/xvda, remove the desired partition (in your case 3), > and recreate it with the same initial block and occupying the rest of the > disk. > - make what's is need to use the new space on the partition, in my > case it's a LVM partition used as a PVE block. Than pvresize, vgextend, > etc... > > Until now, no problems... > > Att., > > Antonio. > > > > > Em qui., 8 de abr. de 2021 ?s 12:44, Nicolas Kovacs <info at microlinux.fr> > escreveu: > >> Hi, >> >> I'm currently fiddling with KVM, Proxmox and various VMs. >> >> I setup a very basic VM with a manual (fdisk) partitioning scheme: one >> /boot >> partition, one swap partition, and one root partition, the latter being >> the >> last partition and thus expandable). >> >> I'm starting with a reduced disk size (6 GB in total) and a minimal >> installation. The idea behind this approach is that I can clone this >> minimal VM >> and then eventually expand it to fit my needs. >> >> Here's how I expand the available disk size. >> >> First I increase the virtual disk in the hypervisor. >> >> Then I fire up the VM and do the following: >> >> # yum install cloud-utils-growpart >> # lsblk >> # growpart -v /dev/sda 3 >> # resize2fs /dev/sda3 >> >> Now here's my question (finally): is there any risk involved in this >> sort >> of >> operation? Or can it be performed on a production system without having >> to >> worry about data loss? >> >> Cheers from the sunny South of France, >> >> Niki >> >> -- >> Microlinux - Solutions informatiques durables >> 7, place de l'?glise - 30730 Montpezat >> Site : https://www.microlinux.fr >> Blog : https://blog.microlinux.fr >> Mail : info at microlinux.fr >> T?l. : 04 66 63 10 32 >> Mob. : 06 51 80 12 12 >> _______________________________________________ >> CentOS mailing list >> CentOS at centos.org >> https://lists.centos.org/mailman/listinfo/centos >> > > > -- > *Antonio da Silva Martins Jr. * > *Analista de Suporte* > NPD - N?cleo de Processamento de Dados > UEM - Universidade Estadual de Maring? > email: *asmartins at uem.br* <asmartins at uem.br> > fone: +55 (44) 3011-4015 / 3011-4411 > inoc-dba: 263076*100 > > "Real Programmers don?t need comments ? the code is obvious." > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >