User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4225
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 6:36 pm

I did this as a post on my blog but I was too slow turning on cloudflare (I keep it off normally as it mucks up my xmpp server) so the server crashed so i'll post a cut down version here in the forum.

There are a couple of gotchas when making a bootable sd card under windows that might catch the unaware out.

The first gotcha is that although your windows computer has a builtin sd card reader/writer it probably won't work for making bootable sd cards. Although the builtin reader/writer works fine with sd cards from your cellphone or camera it won't when trying to make a bootable sd card. I suspect it's something to do with a dumbed down controller chip in builtin readers that don't support writing to the lower areas "partition table", MBR... (yes i know sd cards don't really have such things but using the terminology maks it easy for people to understand what I mean). The 0 to XXXX part of the SD card. I know that the ricoh sd card reader/writer in HP laptops definitely have problems and other makes of builtin reader/writer and laptops do too although I can only state for a fact from personal experience that the ricoh/hp combo do.

So if you are going to be using windows to make a bootable sd card for your raspberry pi you should use a USB SD card reader/writer. I've not yet found one that doesn't work for making bootable sd cards.

The second gotcha is that sd cards are not like harddisks or other r/w media in that in normal use they can only flip a bit from 1 to 0 and not vice versa. deleting doesn't reset any 0 bits back to the initial state and doesn't allow you to reclaim the space. if you are going to use an sd card you have previously used then you will need to format the sd card before use. You shouldn't use the builtin windows formatter as although it will say it worked and has sort of worked it hasn't actually set all the bits back to their 1 state. To format an sd card under windows you should use a USB sd card reader/writer and the panasonic sd card formatter http://panasonic.jp/support/gl.....index.html

If you use the sd card formatter, something like Win32DiskImager and a USB sd card reader/writer then you should have no problems making your bootable raspberry pi sd card.

spurious
Posts: 343
Joined: Mon Nov 21, 2011 9:29 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 6:54 pm

Thanks.. the built in SD card reader thing would have stumped me for some time.

gruetzkopf
Posts: 10
Joined: Wed Jan 04, 2012 7:01 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 6:59 pm

I always found PCI<-> SDIO bridges (like the Ricoh sd readers are) most reliable.

You are also confusing SD and SmartMedia/XD cards. SD cards have a conreoller whick handles the flash paging all by itself. SM and XD cards are raw flash ics. With those you need to have the controller in your PC handle the flash paging. But you dont need to treat SD cards differently like you would a Hard drive or USB stick.

The Formatting thing is a urban legend, or a defective card reader!

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4225
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 7:22 pm

gruetzkopf said:


I always found PCI<-> SDIO bridges (like the Ricoh sd readers are) most reliable.

You are also confusing SD and SmartMedia/XD cards. SD cards have a conreoller whick handles the flash paging all by itself. SM and XD cards are raw flash ics. With those you need to have the controller in your PC handle the flash paging. But you dont need to treat SD cards differently like you would a Hard drive or USB stick.

The Formatting thing is a urban legend, or a defective card reader!


first of all thanks for the pm calling me a liar. I have replied to you about that.

yes things are better these days and some versions of SD card e.g. SDHC/SDXC.... might be different but please read up on NAND & NOR flash and how it works before saying I am wrong. I may well be incorrect with the current state of affairs with more modern SD types but for plain SD I am correct and also correct about at least ricoh readers on hp laptops

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4225
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 7:31 pm

I do have to make a tiny correction though as I am partially incorrect about erasing/formatting, but it doesn't change the practical part where i say use the "official" sd card formatter not windows one and to format before use if you have used the card for another device.

from various NAND/NOR docs replicated in wikipedia

Block erasure One limitation of flash memory is that although it can be read or programmed a byte or a word at a time in a random access fashion, it can only be erased a "block" at a time. This generally sets all bits in the block to 1. Starting with a freshly erased block, any location within that block can be programmed. However, once a bit has been set to 0, only by erasing the entire block can it be changed back to 1. In other words, flash memory (specifically NOR flash) offers random-access read and programming operations, but cannot offer arbitrary random-access rewrite or erase operations. A location can, however, be rewritten as long as the new value's 0 bits are a superset of the over-written value's. For example, a nibble value may be erased to 1111, then written as 1110. Successive writes to that nibble can change it to 1010, then 0010, and finally 0000. Essentially, erasure sets (all) bits, and programming can only clear bits. File systems designed for flash devices can make use of this capability to represent sector metadata.

gruetzkopf
Posts: 10
Joined: Wed Jan 04, 2012 7:01 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 7:57 pm

ukscone said:



from various NAND/NOR docs replicated in wikipedia


Block erasure One limitation of flash memory is that although it can be read or programmed a byte or a word at a time in a random access fashion, it can only be erased a "block" at a time. This generally sets all bits in the block to 1. Starting with a freshly erased block, any location within that block can be programmed. However, once a bit has been set to 0, only by erasing the entire block can it be changed back to 1. In other words, flash memory (specifically NOR flash) offers random-access read and programming operations, but cannot offer arbitrary random-access rewrite or erase operations. A location can, however, be rewritten as long as the new value's 0 bits are a superset of the over-written value's. For example, a nibble value may be erased to 1111, then written as 1110. Successive writes to that nibble can change it to 1010, then 0010, and finally 0000. Essentially, erasure sets (all) bits, and programming can only clear bits. File systems designed for flash devices can make use of this capability to represent sector metadata.



Thats entirely irrelevant. Even for plain SD card. The Controller in the card handles that by deleting the whole page to FF and rewritng it completly when data is modified.

User avatar
jojopi
Posts: 3272
Joined: Tue Oct 11, 2011 8:38 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 8:52 pm

ukscone said:

don't support writing to the lower areas "partition table", MBR
This may be configurable in the BIOS and called something like "Boot Sector Virus Protection".  It seems very unlikely to be a hardware deficiency.

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4225
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 9:07 pm

jojopi said:


ukscone said:


don't support writing to the lower areas "partition table", MBR


This may be configurable in the BIOS and called something like "Boot Sector Virus Protection".  It seems very unlikely to be a hardware deficiency.


at least in the crippled hp bios it's not. Several years ago I did actually sniff what was happening and commands that worked on the first few MB all failed with lots of command errors and write errors (on several different sd cards) I did the same on another system with a different make (i forget which) and same problem. used a usb reader/writer and all was fine.

[as i said i didn't actually mean MBR.... I was just using the terminology so that people not used to sd cards would understand]

a bit of googling will find you all sorts of problems with ricoh sd card readers especially on hp's under both linux and windows

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4225
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 9:17 pm

had a couple of pm's and a couple of emails saying I am a liar. i don't particularly appreciate that but oh well.

For all those saying I am wrong I am going from 5 years of empirical evidence of my eyes and while I can only categorically state MY laptop has problems i have seen others have problems too all of which were solved by using a USB sd card reader/writer and/or the panasonic sd card formatter. i'd prefer to spend upto $10 to save myself hours of heartache and troubleshooting but that's just me. YMMV with your computer and builtin sd card reader/writer but i'll stick with a proven method and know that any problems i encounter are not from a bad sd card write.

tango
Posts: 2
Joined: Sun Feb 26, 2012 9:27 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 9:34 pm

Maybe kinda offtopic... but... someone do knows something about doing it with a Mac?

User avatar
Tass
Posts: 535
Joined: Sat Jan 21, 2012 11:15 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 10:05 pm

OK - so putting any fueds to one side....

Does this mean the basic instructions for writing SD cards that have been bandied around these forums won't work?

Has anyone tried booting from their SD cards (I realise it won't boot into the OS, but should verify that the cards are bootable?

There's a DD tutorial that covers deleting the partitions using diskpart - with this get around the standard 'windows format' issue?

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4225
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 10:08 pm

Tass said:


OK - so putting any fueds to one side....

Does this mean the basic instructions for writing SD cards that have been bandied around these forums won't work?

Has anyone tried booting from their SD cards (I realise it won't boot into the OS, but should verify that the cards are bootable?

There's a DD tutorial that covers deleting the partitions using diskpart - with this get around the standard 'windows format' issue?


The instructions are generally correct in that it is the way it SHOULD work however if you have problems then the two things I posted are probably the reason why

jimnandrews
Posts: 6
Joined: Sun Feb 26, 2012 1:25 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 10:10 pm

Only that most people I know who own Macs would LOVE to "do it" with a Mac.  I'm sure the iVag is coming soon! *

* I am not troll-baiting, just trying to make lighthearted humor, is all.  Please don't start some weird flame war over this post!

spurious
Posts: 343
Joined: Mon Nov 21, 2011 9:29 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 10:13 pm

we really need a like button..  lol

User avatar
Tass
Posts: 535
Joined: Sat Jan 21, 2012 11:15 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 10:24 pm

spurious said:


we really need a like button..  lol



2nd that! (or can I like a like?)

User avatar
Tass
Posts: 535
Joined: Sat Jan 21, 2012 11:15 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Sun Feb 26, 2012 10:35 pm

ukscone said:

The instructions are generally correct in that it is the way it SHOULD work however if you have problems then the two things I posted are probably the reason why

OK, cool - thanks.  I've just rebooted my (HP) laptop, ensured my SD Card is configured to boot and it doesn't boot

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Mon Feb 27, 2012 9:22 am

tango.pi said:


Maybe kinda offtopic... but... someone do knows something about doing it with a Mac?



A little searching would have found

http://www.raspberrypi.org/for.....x-using-dd

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1665
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: Tips for preparing an sd card for the raspberry pi on windows

Mon Feb 27, 2012 10:39 am

Hi guys;

I've put a post on my blog about this if it is any help to anyone.

Thanks

Dave

User avatar
Tass
Posts: 535
Joined: Sat Jan 21, 2012 11:15 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Tue Feb 28, 2012 12:10 am

So I've been digging around a bit trying to figure out how I can get this SD card working without buying a new card reader.

I've downloaded the Fedora 16 live CD image (can't seem to find v14 as a live CD?), booted into it made the 1st 79MB FAT32 partition bootable.

Now when I try boot (on my x86 laptop), it doesn actually try to boot off the card, but the screen just goes black and doesn't recover.

I wouldn't expect the OS to boot at all because of the vastly different architecture, but I was expecting a little more than a blank screen - some sort of error?

Has anyone else managed to correctly create a working, bootable SD Card and if so, what does it do on an x86 machine?

plugwash
Forum Moderator
Forum Moderator
Posts: 3621
Joined: Wed Dec 28, 2011 11:45 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Tue Feb 28, 2012 7:48 am

An SD card for the PI WILL NOT even attempt to boot on a PC. As well as the architectural incompatibilities the boot methods are completely different.

haitek
Posts: 23
Joined: Wed Mar 14, 2012 7:16 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Wed Mar 14, 2012 9:48 am

hopefully, by the time my RPi arrives, there will be an easier way

to do this

wrhii
Posts: 66
Joined: Fri Nov 18, 2011 1:47 am

Re: Tips for preparing an sd card for the raspberry pi on windows

Wed Mar 14, 2012 8:34 pm

haitek said:


hopefully, by the time my RPi arrives, there will be an easier way

to do this


Well, if you use the Fedora image, you can always look at the original post (http://www.raspberrypi.org/archives/805) where they mention an installer.

Kernel
Posts: 395
Joined: Sat Mar 03, 2012 12:53 pm

Re: Tips for preparing an sd card for the raspberry pi on windows

Fri Mar 16, 2012 2:58 pm

rurwin said:


Kernel said:


What are forum users opinions on this?


I agree with it.

New Dell Latitude Laptop, Windows 7 32-bit.

Built-in SD Card Reader failed to write the image, £3.50 USB card reader succeeded in writing the image.

I have no idea why that should be, since I know nothing about how SD cards and their filesystems are implemented, but it is empirically true.


and how do you know it failed to write the image? where did it stop/give an error? what did you use - win32diskimager/fedora remix installer/something else?

I did this: http://www.raspberrypi.org/for.....-2/#p54657 and it seems to have written the image ok

does this mean it is ok or could it still be not bootable?

Return to “Other projects”