VMware Cloud Community
chukarma
Enthusiast
Enthusiast
Jump to solution

Format a LUN with VMDK in it

Hi All,

Hopefully this is an easy one. I have a LUN that has a few vmdks on it. Is there a quick command line to use for formatting this LUN?

Thanks,

Daniel

Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Yup, Add Storage, select LUN A, should pop a warning saying it will delete all data on volume, OK, name, next next next. That's it, all VMDKs gone.

Or you could use vmkfstools from the service console.

vmkfstools -C vmfs3 -S VolName /path/to/device




www.phdvirtual.com

View solution in original post

Reply
0 Kudos
7 Replies
admin
Immortal
Immortal
Jump to solution

Just use 'Add Storage' under the Configuration->Storage tab in the VI client, this will reformat the volume as VMFS (wiping out and existing VMDKs).

Alex




www.phdvirtual.com

Reply
0 Kudos
chukarma
Enthusiast
Enthusiast
Jump to solution

Sorry, I should have been more clear. Here's the scenario.

I have LUNA - currently being used by a cluster of 4 ESX hosts. There are 2 VMs VMDK currently stored on LUNA

I could go to LUN A and manually remove those VMDK files. What I am looking for is a way to do this quickly because I have LUNB, LUNC, LUND...that have similar set up (for testing purpose).

So, either manually go to each LUNs and delete the VMDK manually or find a way to do it quicker. Is there such a way?

Reply
0 Kudos
mcowger
Immortal
Immortal
Jump to solution

vmkfstools can format a LUN.






--Matt

VCP, vExpert, Unix Geek

--Matt VCDX #52 blog.cowger.us
admin
Immortal
Immortal
Jump to solution

Yup, Add Storage, select LUN A, should pop a warning saying it will delete all data on volume, OK, name, next next next. That's it, all VMDKs gone.

Or you could use vmkfstools from the service console.

vmkfstools -C vmfs3 -S VolName /path/to/device




www.phdvirtual.com

Reply
0 Kudos
Texiwill
Leadership
Leadership
Jump to solution

Hello,

Do you want the data cleared from the LUN or do you want the Table of contents to have their entry removed? Delete from disk or a format will not actually delete the blocks of data from a forensic recovery.....


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
Reply
0 Kudos
aleph0
Hot Shot
Hot Shot
Jump to solution

to have more control on the task format one LUN ay a time from VI client as suggested in previous posts

however you can try something like this if you want all LUNS formatted : i've not tried it

I'm not sure that's what you want so USE IT AT YOUR OWN RISK and ON TEST ENVIRONMENT

-


#!/bin/bash

for i in `find /vmfs/volumes/ -name <LUN_Name> `

do

echo "Formatting $i"

<command to format LUN parametrized with $i>

done

-


I'm not sure that's what you want so USE IT AT YOUR OWN RISK and ON TEST ENVIRONMENT

\aleph0

____________________________

(in italian)

###############

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

\aleph0 ____________________________ http://virtualaleph.blogspot.com/ ############### If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
Reply
0 Kudos
chukarma
Enthusiast
Enthusiast
Jump to solution

Thanks for the options.

Reply
0 Kudos