Check out MACROS: Mount Drive, Unmount Drive, Check if Drive is Mounted for some good pointers.
For more information, see the wiki Searching the Forum for Answers section.