#!/usr/bin/python import pyudev context = pyudev.Context() for device in context.list_devices(subsystem='block'): print device.device_node