1

Is there a way to assign permissions to a regular user to access a physical device/drive on Windows?

The idea is to bypass "error: Cannot open the raw disk '\.\PhysicalDrive1'. Otherwise, it looks like I might have to disable UAC and run everything as an Administrator, which isn't ideal!

3

In short you can't easily. Here's why:

Using PowerShell we can get the ACLs for a physical "raw" disk drive:

PS C:\> [io.directory]::GetAccessControl("\\.\PHYSICALDRIVE1") | Format-List


Path   :
Owner  : BUILTIN\Administrators
Group  : NT AUTHORITY\SYSTEM
Access : Everyone Allow  ExecuteFile, ReadAttributes, ReadPermissions, Synchronize
         NT AUTHORITY\RESTRICTED Allow  ExecuteFile, ReadAttributes, ReadPermissions, Synchronize
         NT AUTHORITY\SYSTEM Allow  FullControl
         BUILTIN\Administrators Allow  FullControl
Audit  :
Sddl   : O:BAG:SYD:(A;;FX;;;WD)(A;;FX;;;RC)(A;;FA;;;SY)(A;;FA;;;BA)

So only SYSTEM and Administrators have permissions that allow write access to the drive defeating your initial request.

There seem to be third party tools (such as User-mode Raw Disk Access) that work around this but it doesn't seem to be something that Microsoft were intending to support on fixed (non-removable) disks. See Changes to the file system and to the storage stack to restrict direct disk access and direct volume access in Windows Vista and in Windows Server 2008 (archive.org link because original article has been removed) for Microsoft's take.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.