Python - reading directly from the hard drive

I want to read bytes directly from the hard drive, preferably using python. How can I do this, if possible. Also, can I write directly to the hard drive and how?

I want to do this in order to make a full clone of the hard drive, and then restore from this backup. I am pretty sure that there are simpler ways to get what I want to do, and this is partly just curiosity;)

+3
source share
1 answer

In linux you can open('/dev/sdX', 'r').

However, it is easier to use the command line utility dd(but it will only work if both disks are the same).

+5
source

All Articles