Show the UUID of a filesystem or partition

ls /dev/disk* | xargs -n 1 -t sudo zdb -l | grep GPTE_
Show the UUID-based alternate device names of ZEVO-related partitions on Darwin/OS X. Adapted from the lines by dbrady at http://zevo.getgreenbytes.com/forum/viewtopic.php?p=700#p700 and following the disk device naming scheme at http://zevo.getgreenbytes.com/wiki/pmwiki.php?n=Site.DiskDeviceNames
Sample Output
sudo zdb -l /dev/disk0
Password:
sudo zdb -l /dev/disk0s1
sudo zdb -l /dev/disk0s2
sudo zdb -l /dev/disk0s3
sudo zdb -l /dev/disk0s4
sudo zdb -l /dev/disk4
sudo zdb -l /dev/disk4s1
sudo zdb -l /dev/disk4s2
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
sudo zdb -l /dev/disk5
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
sudo zdb -l /dev/disk5s1
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
        path: '/dev/dsk/GPTE_1928482A-7FE4-482D-B692-3EC6B03159BA'
sudo zdb -l /dev/disk7
sudo zdb -l /dev/disk7s1
sudo zdb -l /dev/disk7s2
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
sudo zdb -l /dev/disk8
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
sudo zdb -l /dev/disk8s1
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
sudo zdb -l /dev/disk8s1s1
sudo zdb -l /dev/disk8s1s1s1
sudo zdb -l /dev/disk8s1s1s2
sudo zdb -l /dev/disk8s1s2
sudo zdb -l /dev/disk8s1s3
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
        path: '/dev/dsk/GPTE_78301A52-4AFF-4D96-8DE9-E76ABC14909C'
sudo zdb -l /dev/disk8s1s4
sudo zdb -l /dev/disk8s1s4s1
macbookpro08-centrim:~ gjp22$ 

1
2012-10-06 20:19:45

3 Alternatives + Submit Alt

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: