I am trying to get raw disk access using python on windows to drives >2TB using python.
Everything works great for disks under 2TB using wmi to find details about the disk size but for a 4TB drive it only sees the first 2TB.
I assume it is because wmi is a wrapper for a wmi32 call so can only address up to 2TB 2^32.
Sample code:
import wmi
w=wmi.WMI()
w.Win32_DiskDrive()
w.Win32_DiskDrive()[4].size
w.Win32_DiskDrive()[4].DeviceID
u'2199020382720'
u'\\.\PHYSICALDRIVE6'
I can then use the DeviceID to access the raw disk like a file.
in=open('\\\\.\\PHYSICALDRIVE6',"rb")
in.seek(1024)
data=in.read(512)
My question is if there is any way to access the full 4TB under python in windows. I have looked for a wmi64 module to no avail. I have looked at wmic command line stuff but that appears to be the same 32 bit wrapper. My OS is Win7 64 bit and python is compiled for 64bit.
If i try and seek past the 2TB I get a IOError [Errno13] Permission Denied
Is there any way or module under python that will allow me raw disk access above 2TB?
Thanks.