check for availability of external storage prior to writing to it

Signed-off-by: Umair Khan <omerjerk@gmail.com>