Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 215516

Problem to expand disk size of VM Linux guest

$
0
0

Dear,

 

I went through a problem a long time ago and today it happened again, let's put a solution that I found with possible cause that I believe to be.

The problem is regarding the impossibility of expanding a disk in Linux operating system after virtual disk expansion in ESXi.

I'm not sure the cause of the problem, but I've noticed that every time I've found it in VMs with Thin-Provison virtual disks and Debian Linux systems.

 

1º As property of the VM are edited in ESXi to increase the virtual disk size.

2º SCSI devices are rescan in the operating system.

3º In fdisk or cfdisk the total size of the disk is recognized, but the additional space for partition expansion or creation of a new partition is not recognized.

 

     Attached error print: cfdisk-error.jpg

 

The problem occurs because of an error in the GPT table, for correction follows the following steps.

In MBR disks this problem does not occur, if occur it is related with another factor.

 

4º In VMware Migrate VM to another Datastore by changing the virtual disk format to Thick-Provison.

5º Install the "gdisk" package which is a utility for management of GPT disks. In my case "aptitude install gdisk"

6º Execute the gdisk command informing the device that repairs. In my case "gdisk / dev / sdd"

7º Open the options menu with "?", select the "v" option to check, verified the error select the "x" option for the advanced menu, select the "e" option to repair, select the "w" option to save and exit.

 

8º Rescan the SCSI devices again with the commands. NOTE: Keep an eye on the SCSI devices and IDs of your operating system.

     * Rescan new devices

          Echo "- - -"> / sys / class / scsi_host / host'x '/ scan

     * Rescan devices geometry

          Echo '1'> / sys / class / scsi_disk / 0 \: 0 \: 0 \: 0 / device / rescan

 

9º Run fdisk or cfdisk again to increase the partition or create a new partition. (Recommend creating new partition for LVM environments)

 

     Attached print the corrected disk: "cfdisk-success.jpg"

 

10º Scan SCSI devices again in the operating system (Step 8º)

11º Case of the operating system kernel does not recognize the new partition, install the "parted" utility and run the "partprobe -s" command. In my case "aptitude install parted" and "partprobe -s"

12º Increase the desired file system. (In my case: "pvcreate / dev / sdd2"; "vgextend vg_bkp_tmp / dev / sdd2"; "lvextend -l + 100% FREE / dev / vg_bkp_tmp / lv_bkp_tmp" and "xfs_growfs / dev / mapper / vg_bkp_tmp-lv_bkp_tmp")

 

     Attached print with the final result "all-success-expand.jpg"

 

Att ...

 

Vinicius Rodrigues de Paula

IT Infrastructure Analyst


Viewing all articles
Browse latest Browse all 215516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>