Smart writing to hard drive