VMware Cloud Community
dbucher
Contributor
Contributor

Is VMware really unable to format my disks ? Do I really need to download a thirdparty for that ?

Dear all,

I'm publishing a new thread, because I think the first one was a very precise technical question, but this title is more in adequation with my real question.

The previous, more technical post is under : Error: Read-only file system during write on /dev/disks/naa.* : tried all forums with no solution !

My problem is very simple, I just want to format the disks on my server!

But it looks like VMware doesn't want or is unable to do such a simple task!

Do I need to burn a CD from a thirdparty and physically go to the datacenter to boot on a CD-ROM, only to format the disks?

Any help would be appreciated, because of course I could to all that, but I cannot believe VMware is so badly conceived!

Denis

P. S. Details about what I tried:

# partedUtil mklabel /dev/disks/naa.600605b009a647b01c5ed73926b7ede1 msdos

Error: Read-only file system during write on /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

WriteNewPtable: Unable to commit to device /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

"partedUtil delete partition" gives the same message.

"partedUtil setptbl" gives the same message.

"fdisk" (delete, new partitions, write) is of no use. (When I write there is no error but nothing has been written)

I tried to reboot, no change.

There are no Virtual machines at all on that server.

# partedUtil  getptbl /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

gpt

1215155 255 63 19521474560

1 63 8386622 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0

2 8386623 13629502 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0

Reply
0 Kudos
18 Replies
Rubeck
Virtuoso
Virtuoso

Have you tried using dd to clear out the existing partitioning information?

There's a guide on how to do this here VMware KB: Troubleshooting the Add Storage Wizard error: Unable to read partition information from t...

/Rubeck

Reply
0 Kudos
dbucher
Contributor
Contributor

Dear Rubeck,

Yes, thank you for the suggestion, but it doesn't work either :

# dd if=/dev/zero of="/dev/disks/naa.600605b009a647b01c5ed73926b7ede1" bs=512

count=34 conv=notrunc

dd: /dev/disks/naa.600605b009a647b01c5ed73926b7ede1: Read-only file system

Denis

Reply
0 Kudos
Rubeck
Virtuoso
Virtuoso

If you remove the VMFS overwrite flag does the same thing happen?

esxcfg-advcfg -s 0 /Disk/PreventVMFSOverwrite

/Rubeck

Reply
0 Kudos
dbucher
Contributor
Contributor

Yes, good question, I previously tried that, but it was unsuccessful...

# esxcfg-advcfg --get  /Disk/PreventVMFSOverwrite

Value of PreventVMFSOverwrite is 1

# esxcfg-advcfg --set 0  /Disk/PreventVMFSOverwrite

Value of PreventVMFSOverwrite is 0

# dd if=/dev/zero of="/dev/disks/naa.600605b009a647b01c5ed73926b7ede1" bs=512

count=34 conv=notrunc

dd: /dev/disks/naa.600605b009a647b01c5ed73926b7ede1: Read-only file system

Denis

Reply
0 Kudos
continuum
Immortal
Immortal

The disk in question has a vmkDiagnostic partition.
AFAIK you have to delete that partition first


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

Reply
0 Kudos
dbucher
Contributor
Contributor

Is there a way to delete that partition ?


Because :

# partedUtil delete /dev/disks/naa.600605b009a647b01c5ed73926b7ede1 2

Error: Read-only file system during write on /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

Unable to delete partition 2 from device /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

# partedUtil delete /dev/disks/naa.600605b009a647b01c5ed73926b7ede1 1

Error: Read-only file system during write on /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

Unable to delete partition 1 from device /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

Reply
0 Kudos
continuum
Immortal
Immortal

Have a look here:
VMware KB: Configuring a diagnostic coredump partition on an ESXi 5.x host

if that partition is undeleteable it is in use and you may have to provide a diagnostic partition elsewhere


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

Reply
0 Kudos
dbucher
Contributor
Contributor

Congratulations ! You found 50% of the cause of the problem :

# esxcli system coredump partition get

Active: naa.600605b009a647b01c5ed73926b7ede1:2

Configured: naa.600605b009a647b01c5ed73926b7ede1:2

This is what I did :

# esxcli system coredump partition set --enable false

# partedUtil delete /dev/disks/naa.600605b009a647b01c5ed73926b7ede1 2

It's now a lot better :

# partedUtil getptbl /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

gpt

1215155 255 63 19521474560

1 63 8386622 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0

But it's not 100% solved :

# partedUtil delete /dev/disks/naa.600605b009a647b01c5ed73926b7ede1 1

Error: Read-only file system during write on /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

Unable to delete partition 1 from device /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

But we are almost there, I think?

Thank you very much :-))

Denis

Reply
0 Kudos
continuum
Immortal
Immortal

Did you also create a new coredump partition ?
I think you need to specify a new one when you want to do this without reboot


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

Reply
0 Kudos
dbucher
Contributor
Contributor

VMware created/used a coredump partition by itself, on the USB boot disk.

But then, by unactivating that partition, I was able to recreate a coredump partition on the disk from the GUI and then recreate a storage.

Now, this is not clean as initially (some small holes and strangely coredump at the end) but I would say the problem is solved:

#  partedUtil  getptbl /dev/disks/naa.600605b009a647b01c5ed73926b7ede1

gpt

1215155 255 63 19521474560

1 63 8386622 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0

3 8388608 19521267711 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

2 19521267712 19521472511 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0

Denis

Reply
0 Kudos
speculatrix
Contributor
Contributor

I ended up booting ubuntu server in rescue mode and using “dd if=/dev/zero of=/dev/foo bs=65536 count=65536” to zero out the disks, I couldn’t persuade vsphere/vcenter to understand that I wanted to reuse the disks for something else.

Reply
0 Kudos
continuum
Immortal
Immortal

When you have to use Linux anyway wipe the complete disk - not just the first few GBs.
VMFS-format does a lousy job when cleaning up previous filesystems - I highly recommend to wipe the full volume with zeroes manually.


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

Reply
0 Kudos
NelsonCandela
Enthusiast
Enthusiast

I know this is very old, but I ran into the same issue with two identical sized M.2 SSD drives, one was usable, the other wasn't due to the mentioned reasons above. No matter what, I couldn't figure out a way to have the ESXi server claim the whole drive, it just wasn't doable.

What I ended up with was to run GParted live and deleting all drive contents, leaving the drive deleted/unformatted.

Booting up ESXi then I was able to claim the full disk as intended.

Reply
0 Kudos
dbutch1976
Hot Shot
Hot Shot

Same problem here attempting to configure VSAN in my lab. Running ESXi 8 on three nodes, each has the same problem on their identical M.2 cards. I previously attempted to create a VSAN and wanted to start over and wow did I get my knuckles rapped for it. Surely there is a better solution than using a 3rd party tool to delete all these partitions and unmount the disks?

Reply
0 Kudos
Nije2010
Contributor
Contributor

I had the same issue as i went along and tried to figure out a way to claim disks for vsan 8... 

I ended up with a simple solution after hours of research....

first: Determine the disk you want to format.
ls -lah /vmfs/devices/disks/

Find the naa.* disk, verify that the disk has multiple partitions. 

Remove partitions with mklabel (identify the )

"partedUtil mklabel /vmfs/devies/disks/naa.YOUR-DISK gpt"

This simple oneliner removed the bogus partitions, and i went straight into vcenter, and was able to claim the disks.

Reply
0 Kudos
ashokkumarn
VMware Employee
VMware Employee

mklabel doesn't help either:

 

[root@localhost:~] partedUtil mklabel /vmfs/devices/disks/naa.5002538c4089c28b gpt
Error: Read-only file system during write on /dev/disks/naa.5002538c4089c28b
WriteNewPtable: Unable to commit to device /vmfs/devices/disks/naa.5002538c4089c28b

 

is there a way to erase the partition?

Reply
0 Kudos
kgmartin
Contributor
Contributor

I had this problem as well trying to delete an old VMFSL partition on a 2nd disk.  mklabel didn't work for me either.

Every time I tried using the partedUtil to remove the partition, i would get an error pointing to it being ReadOnly.  This VMFSL partition was on a 2nd drive in my system and had once had ESXi installed there.  I was able to remove all of the other partitions from that drive with partedUtil, just not this one.

I found that the process in this article worked for me.  https://serverfault.com/questions/1064921/unable-to-delete-partition-2-from-device-dev-disks-naa-500...

Just booted the system to an older ESXi 6.7 install and jumped out from there to run partedUtil.

I had tried with a newer ESXi 8.02, but that still held on to the partition.  The key was using an install ISO prior to 7.x.

Reply
0 Kudos
dbutch1976
Hot Shot
Hot Shot

In the end I created a Windows 11 bootable USB stick, booted each esxi host with it and used the Windows installer to completely blank out the disks, problem solved. It's absolutely rediculous that I had to do this, but I got sick of messing around.

Reply
0 Kudos