{"action":"created","issue":{"url":"https://api.github.com/repos/t-d-k/LibreCrypt/issues/30","labels_url":"https://api.github.com/repos/t-d-k/LibreCrypt/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/t-d-k/LibreCrypt/issues/30/comments","events_url":"https://api.github.com/repos/t-d-k/LibreCrypt/issues/30/events","html_url":"https://github.com/t-d-k/LibreCrypt/issues/30","id":98581164,"number":30,"title":"Drive appears unformatted in Windows 8.1 x64 after mounting","user":{"login":"bparker06","id":2433242,"avatar_url":"https://avatars.githubusercontent.com/u/2433242?v=3","gravatar_id":"","url":"https://api.github.com/users/bparker06","html_url":"https://github.com/bparker06","followers_url":"https://api.github.com/users/bparker06/followers","following_url":"https://api.github.com/users/bparker06/following{/other_user}","gists_url":"https://api.github.com/users/bparker06/gists{/gist_id}","starred_url":"https://api.github.com/users/bparker06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparker06/subscriptions","organizations_url":"https://api.github.com/users/bparker06/orgs","repos_url":"https://api.github.com/users/bparker06/repos","events_url":"https://api.github.com/users/bparker06/events{/privacy}","received_events_url":"https://api.github.com/users/bparker06/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/t-d-k/LibreCrypt/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/t-d-k/LibreCrypt/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"linux-modder","id":5921776,"avatar_url":"https://avatars.githubusercontent.com/u/5921776?v=3","gravatar_id":"","url":"https://api.github.com/users/linux-modder","html_url":"https://github.com/linux-modder","followers_url":"https://api.github.com/users/linux-modder/followers","following_url":"https://api.github.com/users/linux-modder/following{/other_user}","gists_url":"https://api.github.com/users/linux-modder/gists{/gist_id}","starred_url":"https://api.github.com/users/linux-modder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linux-modder/subscriptions","organizations_url":"https://api.github.com/users/linux-modder/orgs","repos_url":"https://api.github.com/users/linux-modder/repos","events_url":"https://api.github.com/users/linux-modder/events{/privacy}","received_events_url":"https://api.github.com/users/linux-modder/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-08-02T03:20:53Z","updated_at":"2015-08-12T01:22:25Z","closed_at":null,"body":"I created a whole drive LUKS container for my USB drive on Ubuntu 14.04 formatted as NTFS, there are no partitions on the drive, inside or outside the container. The container mounts successfully in LibreCrypt by going to File -> Linux container -> Open LUKS partition and checking the \"entire drive\" checkbox. It assigns the drive letter but windows thinks the drive is unformatted. Any ideas? When I do a LUKS info dump I get this:\r\n\r\nApplication version   : v6.2.5613.42403\r\nDriver ID             : v5.00.0000\r\nUnable to read LUKS header; this does not appear to be a LUKS container.\r\n"},"comment":{"url":"https://api.github.com/repos/t-d-k/LibreCrypt/issues/comments/130129384","html_url":"https://github.com/t-d-k/LibreCrypt/issues/30#issuecomment-130129384","issue_url":"https://api.github.com/repos/t-d-k/LibreCrypt/issues/30","id":130129384,"user":{"login":"Marco01809","id":1313295,"avatar_url":"https://avatars.githubusercontent.com/u/1313295?v=3","gravatar_id":"","url":"https://api.github.com/users/Marco01809","html_url":"https://github.com/Marco01809","followers_url":"https://api.github.com/users/Marco01809/followers","following_url":"https://api.github.com/users/Marco01809/following{/other_user}","gists_url":"https://api.github.com/users/Marco01809/gists{/gist_id}","starred_url":"https://api.github.com/users/Marco01809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marco01809/subscriptions","organizations_url":"https://api.github.com/users/Marco01809/orgs","repos_url":"https://api.github.com/users/Marco01809/repos","events_url":"https://api.github.com/users/Marco01809/events{/privacy}","received_events_url":"https://api.github.com/users/Marco01809/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T01:22:25Z","updated_at":"2015-08-12T01:22:25Z","body":"So I was poking around in the LibreCrypt v6.2-beta source code for a bit but couldn't really find the problem, just wanted to share what I found out so far. All of the following are just vague guesses as I'm not familiar with either Pascal or Delphi, even less so with the internals of FreeOTFE/LibreCrypt.\r\nI found the `IsLUKSVolume()` function in `OTFEFreeOTFEBase_U.pas`, which compares the first bytes of the selected volume with the LUKS_MAGIC `\"LUKS\\xba\\xbe\"`. I counterchecked that with a LUKS container created the way I described in my previous post:\r\n`# hexdump --length 16 -C /dev/sdb`\r\n`00000000 4c 55 4b 53 ba be 00 01  61 65 73 00 00 00 00 00  |LUKS....aes.....|`\r\nAs this seems right, I doubt `IsLUKSVolume()` is causing the problems itself, I believe the filename being passed into it is wrong when using the EntireDisk-Option. It is constructed using `SDUDeviceNameForPartition()` found in `SDUGeneral.pas`. This in turn creates the filename string from `\"\\Device\\Harddisk%d\\Partition%d\"`. With EntireDisk enabled the PartitionId becomes 0 (see `GetSelectedDevice()` in `TfmeSelectPartition.pas`). So for my usb drive it would return something like `\"\\Device\\Harddisk3\\Partition0\"`, which I believe could be wrong, because indexing starts at 0, so `Partition0` would point to the first partition on the disk, which is impossible because there are no partitions at all. Could it be that when using EntireDisk it should be just `\"\\Device\\Harddisk3\"`? Note that's just a wild guess, I don't actually know anything about windows drive APIs."}}