VMware Cloud Community
drakeramoride
Enthusiast
Enthusiast

How can expand a Linux VM disk?

Hello Everybody and thanks for your time, I have a VM with Debian under a VMware ESXi 6.5 This VM has 50Gb of space but I need more.

So I expand the disk from 50Gb to 250Gb so now I have this:

root@xxx:~# fdisk -l Disco /dev/sda: 250 GiB, 268435456000 bytes, 524288000 sectores

Unidades: sectores de 1 * 512 = 512 bytes

Tamaño de sector (lógico/físico): 512 bytes / 512 bytes

Tamaño de E/S (mínimo/óptimo): 512 bytes / 512 bytes

Tipo de etiqueta de disco: dos

Identificador del disco: 0xc483268d

Disposit.  Inicio  Comienzo    Final  Sectores Tamaño Id Tipo

/dev/sda1  *          2048 102762495 102760448    49G 83 Linux

/dev/sda2        102764542 104855551  2091010  1021M  5 Extendida

/dev/sda5        102764544 104855551  2091008  1021M 82 Linux swap / Solaris

I have /dev/sda with 250 GB And the question is, how can add the space to /dev/sda1 partition to have 250Gb in it?

Thank you

0 Kudos
1 Reply
continuum
Immortal
Immortal

Next time you boot log in as root and disable swap.

Then delete /dev/sda5 and /dev/sda2.

Then expand the vmdk and on next boot expand /dev/sda1.

Thats when you already expanded the vmdk.

If you have not expanded the vmdk yet I would rather add another vmdk and use it for /home or /var or for where ever you need the additional space.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos