Translate

lunes, octubre 09, 2017

Asignar en caliente espacio al un disco de la maquina virtual vmware alfresco (linux)

1.Tenemos que incrementar el disco asignando a datos en alfresco desde los ajustes de la maquina virtual vmware (en este caso al disco 2 le asignamos 500gb, antes tenia 100gb):.

 2.En la carpeta /sys/class/scsi_disk/2:0:1:0/ ejecutar:
 echo 1 > device/rescan

 3.Ahora con fdisk /dev/sdb tenemos que ver que ahora tiene 500GB

 4. hay que crear la unidad /dev/sdb3, estos son los pasos:
 fdisk /dev/sdb n(new),
 p(primary), 3 (partition numb) t(type) 8e(type LVM), w(write)

 5. Comando con el que nos aparecerá /dev/sdb3 (para no hacer reboot)
 partx –v –a /dev/sdb

 6. incluimos /dev/sdb3 en el volgroup
 pvcreate /dev/sdb3

7. extendemos el volGroup01 con /dev/sdb3

 vgextend volGroup01 /dev/sdb3

 8. extendemos todo el espacio libre al volgroup “alfresco”:

 lvextend –l +100%FREE /dev/volGroup01/alfresco

9. vemos los cambios aplicados:
 vgdisplay

10.ampliamos el sistema de ficheros con ls nueva capacidad:
 resize2fs –p /dev/mapper/volGroup01-alfresco


11. IMPORTANTE!
hay que editar el fichero  vim /etc/fstab para incluir las referencias de montaje nuevas y asi funcionen en el siguiente reboot de S.O

Otra forma (visual), tener cuidado porque se puede evitar el reboot haciéndolo con el primer procedimiento:

How to expand disk capacity for vmware linux virtual machine

First, make a clone of the vmware linux virtual machine. So even if you make serious mistake during the process, you still have all your data.
By default installation, linux virtual machine (Fedora, RHEL or CentOS) has two partitions, one for swapping, and the other one is a lv partition. The lvm partition mount as /, and cannot be resized by partition tools such as partition magic or gparted.
Before expansion, as shown below, we were almost run out of disk space:
The logical volume /dev/maper/VolGroup00 only has 16% free space.
Open virtual machine's settings, select hard disk and click "Utilities" button, and select "Expand":

Expand the disk size to 20GB:

Boot up, open a terminal and run
fdisk /dev/sda
Type "n" and hit enter. Then press "p" to create a primary partition. It asks you for a partition number, enter "3". Now you are asked which cylinder the partition should start at, the beginning of the drive is the default, so just hit Enter. Then you are asked for the last cylinder, the end of the drive is default so you can just press Enter again. Here are the commands and results inside fdisk:

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (1045-2610, default 1045): 
Using default value 1045
Last cylinder or +size or +sizeM or +sizeK (1045-2610, default 2610): 
Using default value 2610

Command (m for help): p

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1044     8281507+  8e  Linux LVM
/dev/sda3            1045        2610    12578895   83  Linux
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

After fdisk is done, reboot.
If system-config-lvm is not installed, use this command to install it first:
yum install system-config-lvm
Launch system-config-lvm, as in the following image, select "Partition 3" under the "Uninitialized Entities", then press "Initialize Entity" button to initialize it.


After this partition being initialized, it appears under the "Unallocated Volumes" node:

Press the "Add to existing Volume Group" to get it to join the "VolGroup00".

After it is done, select the logVol00 under VolGroup00, then press "Edit Properties" button:

Press the "Use remaining" button to make it use all the capacity, and then press the "Ok" button:
Now we have resized the disk capacity. Run df command to verify it:


Publicar un comentario