{"id":100,"date":"2012-05-27T10:49:20","date_gmt":"2012-05-27T09:49:20","guid":{"rendered":"https:\/\/oddsnsods.net\/blog\/?p=100"},"modified":"2012-05-27T10:49:20","modified_gmt":"2012-05-27T09:49:20","slug":"problem-using-win32diskimager-to-write-to-sd-card-error-5-lock-problem","status":"publish","type":"post","link":"https:\/\/oddsnsods.net\/blog\/?p=100","title":{"rendered":"Problem using Win32DiskImager to write to SD Card  &#8211; Error 5, Lock problem"},"content":{"rendered":"<p>Same day that my Pi arrived, I tried to write the Debian squeeze image to an 8GB Sandisk Micro SD. Actually I tried it with a 2GB unbranded and found the same problem.<\/p>\n<p>The problem was that when clicking the &#8216;Write&#8217; button in Win32DiskImager, it would say it could not lock the disk, the disk being the SD Card. Nothing I knew of\u00a0 had accessed the card since I had inserted it into the reader.<\/p>\n<p>Looking around I saw a comment that said delete all partitions on the card. The only partition of course was a FAT32 one which was standard for this kind of disk. I used windows 7 diskpart as follows to delete the partition:<\/p>\n<ul>\n<li>Open a command prompt.<\/li>\n<li>Type &#8216;diskpart&#8217; and the &#8216;Diskpart&gt;&#8217; prompt will be displayed.<\/li>\n<li>Against the Diskpart&gt; prompt, type &#8216;list disk&#8217;.<\/li>\n<li>A list of disks will appear, for example:DISKPART&gt; list disk\n<p>Disk ###\u00a0 Status\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0\u00a0\u00a0\u00a0 Free\u00a0\u00a0\u00a0\u00a0 Dyn\u00a0 Gpt<br \/>\n&#8212;&#8212;&#8211;\u00a0 &#8212;&#8212;&#8212;&#8212;-\u00a0 &#8212;&#8212;-\u00a0 &#8212;&#8212;-\u00a0 &#8212;\u00a0 &#8212;<br \/>\nDisk 0\u00a0\u00a0\u00a0 Online\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 465 GB\u00a0\u00a0\u00a0\u00a0\u00a0 0 B<br \/>\nDisk 1\u00a0\u00a0\u00a0 Online\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7580 MB\u00a0 5723 MB<\/p>\n<p>DISKPART&gt;<\/li>\n<li>Here you can see that my SD card is Disk\u00a0 1 just by inspecting the sizes.<\/li>\n<li>With diskpart, before you can work on a disk or a partition, you must set the focus. So to select Disk 1 in my example, type &#8216;select disk 1&#8217;.<\/li>\n<li>Next check the partitions on the disk you have selected by entering &#8216;list partition&#8217;.<\/li>\n<li>In my example there was just the one FAT 32 partition called &#8216;partition 1&#8217;.<\/li>\n<li>Before deleting, you need to set the focus to the partition, so in my example I entered &#8216;select partition 1&#8217;.<\/li>\n<li>To delete the partition, enter &#8216;delete partition&#8217;.<\/li>\n<li>In my case, it still would not let me do this, saying the disk was locked. So we can use the &#8216;override&#8217; parameter with delete by entering:<\/li>\n<li>delete partition override<\/li>\n<\/ul>\n<p>We now have an SD card with no partiton defined! The next step was to exit diskpart by entering &#8216;exit&#8217; and then try writing the disk image again.<\/p>\n<p>Success!<\/p>\n<p>I hope this helps someone else, please leave a comment! Someone has to be my first non-family-member commenter!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Same day that my Pi arrived, I tried to write the Debian squeeze image to an 8GB Sandisk Micro SD. Actually I tried it with a 2GB unbranded and found the same problem. The problem was that when clicking the &#8216;Write&#8217; button in Win32DiskImager, it would say it could not lock the disk, the disk&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,3],"tags":[],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi","category-tech-talk"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":1,"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/101"}],"wp:attachment":[{"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oddsnsods.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}