VMware Cloud Community
lpenrod
Contributor
Contributor

Can't move ISO

I can't move an ISO because one of my VM's has it mounted. What is the easiest way to tell where it is mounted?

Reply
0 Kudos
4 Replies
vlchild
Enthusiast
Enthusiast

A command would be cool for this, not sure if there is one. this is how I would do it though, create a file in /tmp called look.sh with the following contents.

find /vmfs/volumes | grep vmx | grep -v vmxf > /tmp/list

for i in $(cat /tmp/list)

do

cat $i >> /tmp/all_files

done

chmod 755 look.sh

type './look.sh'

then 'vi all_files'

type '/ISO_NAME' and that will take you to the line it is mounted. scroll up a little and you will see guest name.

I am sure this can be refined, I am not a script writer and this is very convoluted.

Lee

Reply
0 Kudos
vlchild
Enthusiast
Enthusiast

See, a little better way. Just put this in the /tmp/look.sh file, set permissions to 755, run it and it streams the output to the screen. Scroll back and find the ISO name you put in the script and the lines above it it the Guest name.

-


find /vmfs/volumes -name *.vmx > /tmp/list

for i in $(cat /tmp/list)

do

echo $i

#Replace 'ISO_NAME' with your ISO name

grep ISO_NAME $i

#If someone smarter than me can make this line work it would rock

#if [[grep W2K $i] = 1] then echo $i

done

-


Lee

Reply
0 Kudos
vlchild
Enthusiast
Enthusiast

I hate stuff like this, it consumes me until I get it right:

Create a file called /tmp/lookup.sh, insert between the horz lines below (edit the W2K for part or all of ISO name you are looking for), set to chmod 755 and then cd to /tmp, type './lookup.sh'.

It takes a little while to run, depending on number of files and such. But in the end will output the vmx files containing the ISO.

-


find /vmfs/volumes -name *.vmx > /tmp/list

for i in $(cat /tmp/list)

do

#by making case insensitive this line returns all files containing '.iso' in either case

if grep -qi .iso $i

then echo $i

fi

done

-


Lee

Reply
0 Kudos
azn2kew
Champion
Champion

You can use the script below to disconnect CD-ROM so you can move your ISO.

http://communities.vmware.com/thread/89892

"Reading Is Fundamental" There is no limit to education

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!! Regards, Stefan Nguyen VMware vExpert 2009 iGeek Systems Inc. VMware vExpert, VCP 3 & 4, VSP, VTSP, CCA, CCEA, CCNA, MCSA, EMCSE, EMCISA
Reply
0 Kudos