kvm disk info

while read X ; do printf "$X --"; virsh dumpxml $X | egrep "source dev|source file"; done< <(virsh list | awk '$1 ~ /^[1-9]/ { print $2 }')
This will strip out the relivent disk information from kvm. I'm using it to find disks on a SAN which are no longer in use.
Sample Output
name0 --      <source dev='/dev/mapper/name0-os'/>
      <source file='/dev/mapper/name0-data'/>
name1 --      <source dev='/dev/mapper/name1-os'/>
      <source file='/dev/mapper/name1-data'/>

By: hugme
2013-07-29 17:32:59

What Others Think

many people have no any idea where is alarm clock in window 10 PC,and how to open this tool where are alarms in windows 10 so,it is very simple,just click this link and get the best way to find how can do set the clock.
KGF123 · 8 weeks and 1 day ago
It's really amazing to check out these commands everyday and being updated on the code. I have been trying them on my essay writing service blogs and making everything possible when i debug the code.
BrendaMadden · 5 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: