Getting a List of Disks

Does anyone have a way to get a list of all mounted volumes, including hard disks, network shares, and removable media (including CD’s). I’ve tried using the shell command “ls /Volumes”, the only problem being that in the case of some removable media the name listed here does not match the name that the Finder knows the volume by.

Please disregard my previous stupidity, Standard Additions has just such functionality.

Well, I talk to myself a lot in the real world, so why not online!? Anyway, the list disks command works, but with disks that have names longer than 31 characters, the name is truncated and concatenated with junk. So my original query stands.

Does work this UNTESTED code?

It does indeed, thank you very much!