Seguem as atividades necessárias para redimensionar um volume de discos do tipo LVM de uma máquina virtual de Check Point.
Atenção! Isso requer uma janela de manutenção!
Atenção Novamente! Faça um snapshot da VM antes da atividade.
- Desligue a VM a ser dimensionada.
- Antes de começar a atividade em si, não se esqueça de ter backups ou pelo menos um snapshot, afinal estamos mexendo com a estrutura de dados do sistema. Se algo der errado, você precisará restaurar o backup em uma nova VM ou então restaurar o snapshot (mais prático).
- Conecte no seu host de VMs.
- Siga os seguintes passos descritos nas imagens para o snapshot:
- Clique com o botão direito na sua VM:
- Procure a opção Snapshot e selecionar abrindo a nova aba para selecionar o take snapshot.
- Seguindo irá abrir uma nova tela onde você vai nomear e descrever o snapshot
- Após seguir o passo anterior, apenas clique no botão Take snapshot
- .
- Adicionando um Hard Disk.
- Clique com o botão direito em cima da sua VM e selecione a opção edit settings.
- Vai abriu uma nova tela e você deverá clicar em add hard disk.
- Selecione New standard hard disk.
- Após ter adicionado o novo hard disk, desça com a barra lateral até achar “New hard disk”.
- Altere o tamanho do disco para o valor necessário clique para salvar.
- Agora antes de subir novamente a VM, vá em edit settings como já expliquei anteriormente e adicione um outro dispositivo do tipo serial port
- Vai aparecer um novo logo após que você selecionar, você poderá escolher uma saída de sua preferência e por fim salve novamente.
- Esse serial apontado pra uma saída, te proporcionará acompanhar o menu de boot da VM.
- Ligue a VM
- Ao inicializar, fique atento ao menu de boot:
- Selecione a opção “Start in maintenance mode 64bit”, e digite a senha de administrador.
- Após o carregamento do sistema, utilize o comando “fdisk -l” (sem as aspas).
- Efetue o comando “fdisk /dev/sdb” (sem as aspas e vai depender de quantos discos você já possui. O segundo disco é o sdb, o terceiro sdc, o quarto sdd e assim por diante. O alvo geralmente será o último disco adicionado).
- Siga à partir da etapa 8 do sk:
- https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk94671&partition=Advanced&product=Quantum
Caso o sk não esteja disponível para leitura, segue o techo:
- Now, we will create a partition on the new disk.
- On disk smaller than 2TB, run the following command:
fdisk /dev/<Name_of_Disk_Device>
. In our case,fdisk /dev/sdb
You should see the following prompt: "Command (m for help):"- Press 'n' in order to create a new partition.
- For "Partition type", select 'p'
- For "Partition number", press '1'
- For "First sector", press Enter (will choose the default first sector)
- For "Last sector", press Enter (will choose the default last sector)
- Press 't' in order to modify the partition type.
- For "Hex code", select '8e' (Linux LVM code).
- Press 'w' in order to save changes and exit.
- On disk equal or larger than 2TB, run the following command (relevant for 3.10 kernel systems only):
gdisk /dev/<Name_of_Disk_Device>
. In our case,gdisk /dev/sdb
You should see the following prompt: "Command (? for help):”- Press 'n' in order to create a new partition.
- For "Partition number", press '1'
- For "First sector", press Enter (will choose the default first sector)
- For "Last sector", press Enter (will choose the default last sector)
- For “Hex code or GUID”, select ‘8e00’ (Linux LVM code).
- Press 'w' in order to save changes and ‘Y’ in order to approve and exit.
- On disk smaller than 2TB, run the following command:
- Now run
fdisk –l
on your new disk again (step 7), you should see the new partition:
On XFS, the sector numbers are slightly different but the output is pretty much the same: - Run the
pvcreate /dev/<Name_of_Disk_partition>
command to create a physical volume (in our case:pvcreate /dev/sdb1
): - Run the
pvdisplay /dev/<Name_of_Disk_partition>
command to view the new physical volume (in our case:pvdisplay /dev/sdb1
): - Run the
vgscan --mknodes
command to scan all disks, rebuild caches, create any missing files in /dev and remove unused ones. - Run the
vgextend vg_splat /dev/<Name_of_Disk_partition>
command to add the volume to the existing volume group: - Run the
vgdisplay
command to see that the new space has been added to the overall volume group: - The extra space has been added, but the system has added the space for additional backups at the moment. To confirm, download LVM manager tool from sk95566, and move it to your VM as described in the sk's instructions.
- Run the lvm_manager and you will be requested to select an action. Type "1" to select "View LVM storage overview".
- You will see a table describing partition, their sizes and the amount of used space. You can see that the extra space has been added in the "free" row. Press "Enter" to go back to the "Select action" menu.
Note: The added free space might be smaller than the size of the added disk, since the lvm_manager tool counts the amount of space needed for an upgrade (see "upgrade" row in the table). - From the "Select action" menu, type "2" to select "Resize lv_current/lv_log Logical Volume". On the next menu, type "2" for extending "lv_log" Logical Volume. (Note: sk94671 refers to adding storage on VM to the /var/log partition.)
- You will see the overview table from step 15, and below you will see a range of sizes that can be assigned to lv_log Logical Volume (see sk95566 for more information on size restrictions). Type your desired size for lv_log Logical volume size.
- You will see the following note:
Type "y" to continue or "n" to stop. - During the resize process you will be updated on the process:
- When the resizing process completes successfully, you will see the following screen:
Press "Enter" for reboot. - After reboot, run LVM manager, type "1" for "View LVM storage overview". Verify that "lv_log" size is as required.
Note: In GAIA R77.20, the messages are somewhat different
Note that all Check Point products will be shutdown during the resizing operation and the machine will be rebooted automatically at the end of the process.
This may take several minutes.
Are you sure you want to continue?(Y/N)[N]y
Stopping Check Point products. This may take several minutes ...
Resizing Logical Volume ...
Progress: 40%
Progress: 100%
********************************************************************
Operation ended successfully.
Logical Volume size changed from 10G to 37G.
Press ENTER for reboot.
Reboot ...
Broadcast message from admin ...:
The system is going down for reboot NOW!
Note that a backup Logical Volume was created and will be removed after reboot.
------------------