VMware Cloud Community
kitarra
Enthusiast
Enthusiast

failed to update disk partition information - step by step fix

As I have encountered this more than once and have noticed that this is a common threat in the forum. However the answers are often not detailed enough for newbies. So this is a how to guide to fix the following error:


"Failed to update disk partition information"

The basic process can be found here. . However this is not helpful if someone does not know Linux very well.


I have found the error most frequently when there are more than three partitions on any individual fixed drive. I suspect that VMFS wishes to be primary. However if you want to place it on the same drive as the ESX base install there is no way that it can be primary and this balks at the idea of formatting.


This is a step by step process.


1. Log on to the console or use putty to connect to the ESX host remotely. If you have not created a user for yourself you will not be able to log in through putty.


2. SU to root. This must be done using the su - root command. If you do not use the - then you will not get root's path and thus get error messages that say that commands cannot be found.


3. Run fdisk -l. This will give you a list of all of your current partitions. This is important because they are numbered. If you are using SCSI you should see that all partitions start with /dev/sda# where # is a number from 1 to what ever. Remember this list of number as you are going to be adding at least one more and will have to refer to the new partition by it's number.


4. Run fdisk /dev/sda. This will allow you to create a partition on the the first drive. If you have more than one SCSI drive (usually the case with more than one RAID container) then you will have to type the letter value for the device you wish to create the partition on (sdb, sdc, and so on).


5. You are now in the fdisk program. If you get confused type "m" for menu. This will list all of your options. There are a lot of them. You will be ignoring most of them.


6. Type "n". This will create a new partition. It will ask you for the starting cylinder. Unless you have a very good reason hit "enter" for default. The program will now offer you a second option that says ending cylinder. If you press enter you will select the rest of the space. In most cases this is what you want.


7. Once you have selected start and end cylinder you should get a success message. Now you must set the partition type or it's ID. This is option "t" on the menu.


8. Type "t". It will ask you for partition number. This is where that first fdisk is useful. You need to know what the new partition number is. It will be one more than the last number on fdisk. Type this number in.


9. You will now be prompted for the hex code for the partition type. You can also type "L" for a list of codes. The code you want is "fb". So type "fb" in the space. This will return that the partition has been changed to fb (unknown). That is what you want.


10. Now that you have configured everything you want to save it. To do so choose the "w" option to write the table to disk and exit.


11. Because the drive is being used by the console OS you will probably get an error that says "WARNING: Re-reading the partition table failed with error 16: device or resource busy." This is normal. You will need to reboot.


12. To reboot the server type "reboot" at the prompt.


13. Once you have rebooted you can now format the partition VMFS. DO NOT do this from the GUI. You must once again log into the console or remote in through putty.


14. Once you have su'd to root you must type in "vmkfstool -C vmfs3 /vmfs/device/disks/vmhba0:0:0:#" Were # is the number of the new partition. You shoulder now get a "successfully created new volume" message. If you get an error you probably chose the wrong partition. Do an fdisk - l and choose the number with the "unknown" partition type. Note: IF you have more than one SCSI disk or more than one container the first 0 may need to be a 1 as well.


15. Go to the GUI and in configuration/storage select refresh. You should now see your new VMFS volume.

Hope this helps.

Reply
0 Kudos
15 Replies
RParker
Immortal
Immortal

You totally ROCK!!!

I was stuck, but you saved me. I owe you!

Thanks very much Smiley Happy

Reply
0 Kudos
dsolerdelcampo
Enthusiast
Enthusiast

Just wonderful! It helps me a lot.

Thank you

Reply
0 Kudos
chriswong
Contributor
Contributor

I'm getting a little different results. I'm running ESX 3.0.2 and when I try to use "n" to create a new partition, I see a prompt for "e" or "p" for extended or primary, and the valid number ranges for both seem to be 1-4.

Here's an fdisk -l:

\[root@rnvs3 root]# fdisk -l

Disk /dev/sda: 2099.9 GB, 2099996014592 bytes

255 heads, 63 sectors/track, 255309 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 255309 2050769478+ fb Unknown

Disk /dev/sdb: 1499.9 GB, 1499997157376 bytes

255 heads, 63 sectors/track, 182364 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sdb1 1 182364 1464838766 fb Unknown

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes

255 heads, 32 sectors/track, 35132 cylinders

Units = cylinders of 8160 * 512 = 4177920 bytes

Device Boot Start End Blocks Id System

/dev/cciss/c0d0p1 * 1 25 101984 83 Linux

/dev/cciss/c0d0p2 26 25725 104856000 83 Linux

/dev/cciss/c0d0p3 25726 26127 1640160 82 Linux swap

/dev/cciss/c0d0p4 26128 35132 36740400 f Win95 Ext'd (LBA)

/dev/cciss/c0d0p5 26128 26152 101984 fc Unknown

I'm basically trying to create a local VMFS partition in partition 6 like on my other ESX server, and that was created in the VI Client before the other VMFS partitions on the SAN were added to the server, so I wasn't even aware that this was a problem until I tried it on 2 new ESX servers we added in a cluster...

Reply
0 Kudos
blaine74
Contributor
Contributor

Merci beaucoup !

Reply
0 Kudos
KenKi
Contributor
Contributor

You probably found an answer by now, but it doesnt matter if you use e (extended), or p (primary)

Ken.

Reply
0 Kudos
chriswong
Contributor
Contributor

Duh, my mistake. I wasn't paying as close attention to my fdisk -l output. I should have been using:

fdisk /dev/cciss/c0d0

as that was the disk I was trying to create a new VMFS partition on. Thanks so much for the instructions...

Reply
0 Kudos
kitarra
Enthusiast
Enthusiast

Glad I could help!

Reply
0 Kudos
kitarra
Enthusiast
Enthusiast

Actually you can't use primary because you can only have 3 primaries and 1 extended partition or 4 primaries. Since this condition is caused by having too many paritions by default this puts you in a position of already having 3 primaries. Trying to create another primary would be bad juju.

Reply
0 Kudos
kitarra
Enthusiast
Enthusiast

You are very welcome!

Reply
0 Kudos
KenKi
Contributor
Contributor

I followed this procedure yesterday, and it worked well. My situation was slightly different, so I wanted to share it.

I already had a 667GB vmfs partition on a Dell EMC san box. The actual size of the lun was 1.3 TB, So I had to create a new VMFS partition on the end of the existing lun

Initially I could not see more than the 667GB when I looked at the disk through fdisk. This drove me nuts.

I had to run the command esxcfg-rescan vmhbaX where X is the vmhba #. To find the vmhba#, use esxcfg-mpath -l

Once I performed the rescan, I was able to see the actual size of 1.3TB in fdisk and create my second primary partition.

Thanks for the great step by step. I just wanted to add the info above for anyone that might run in to this problem.

Ken.

Reply
0 Kudos
oreeh
Immortal
Immortal

Would you mind creating a document for this (on the left is a link "Convert thread to document")?

Thanks

Reply
0 Kudos
kitarra
Enthusiast
Enthusiast

Didn't know that could be done, but it is now! Thank you for the tip.

Reply
0 Kudos
drawful
Contributor
Contributor

This was a great help for me as well, not having much Linux experience. I only wanted to add that on an ESX 3.0.2 system, there were some semantics that stumbled me with this document. I had no trouble until I need to create the file system on my new partition, the command as I needed it was:

vmkfstools -C vmfs3 /vmfs/devices/disks/vmhba0:0:0:#

But after the changes, the new partition displayed in the virtual center. Thanks for the education.

Reply
0 Kudos
nemesiz
Contributor
Contributor

Hey There! before anything thanks for your grate post!!

i read the post Completely but there is a big problem for me!

i'v 3 more Data Store with 2TB for each of them, and i want to add another 2TB Data Store.

when i use "fdisk -l" above the forth one (new one) i get GPT error:

WARNING: GPT (GUID Partition Table) detected on '/dev/sde'! The util fdisk doesn't support GPT. Use GNU Parted.

i ignored that and fdisk my LUN with "fdisk /dev/sde" m n t w and then reboot

but when i try to format my LUN with "vmkfstool -C vmfs3 /vmfs/device/disks/egui.22***********f0" i get a an error and thats ERROR: Permition Denied,

btw after creating partition and reboot in my fdisk -l i'v still GTP error!

sry for bad eng.. thnx

Reply
0 Kudos
rodmart
Contributor
Contributor

Hi,

all information posted is very useful, thanks to all community.

I was getting exactly the same error, but my scenario was so different, It started to shows after I was and error on a RAID0 Array, one of my "co-worker" take out a disk of this array, obviuously I lost connectivity with some VMs, because the array was damaged. This situation also was affecting visibilty of my others datastores, I was able to see them from Storage adapters Tab but not from the Storage View. To correct this, I had to go to my array GUI app and unpresent and delete that array, after that I was able to see the others datastores again. I'm not sure but, I think service console get stuck when RAID 0 hardware errors.

This workaround works for me, I could delete that array because the VMs inside were an old backup that I had.

I hope it helps for someone.

regards

Reply
0 Kudos