ensure no files is going to specified device before deleting
sort the order to validate the deleting of device