robhague
Posts: 12
Joined: Sun Sep 04, 2011 8:14 am
Contact: Website

Re: Downloadable SD Card Images

Thu Sep 15, 2011 7:59 pm

(Sorry if this has been answered before, but I couldn't find any existing topics that covered this.)

Are the Raspberry Pi SD card disk images available to download anywhere? I'm lucky enough to have an alpha board, and have been playing around with the boot-up sequence. In the course of this, I've already managed to render the SD card unbeatable once via a typo in /etc/inittab. That was easily fixed by mounting the file system on another Linux box, but I'd feel safer if I knew I could just reflash the SD card back to the standard image if I mess things up too much (the unusual boot sequence means that there's no firmware for me to brick, at least).

If there isn't anywhere already, could we set one up? At this stage, something like a shared DropBox folder would probably be sufficient, but in the long term it would seem like a good idea to have a website dedicated to providing downloads and torrent seeds for various bootable images for the device. I'd be happy to have a go at setting this up, assuming I wouldn't be stepping on any toes.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23688
Joined: Sat Jul 30, 2011 7:41 pm

Re: Downloadable SD Card Images

Thu Sep 15, 2011 8:14 pm

If you have a Linux box (although I think you are Apple?) you can simply dd the contents of the SD card to an image to make a backup. I think. Not sure of the syntax. Or mount each partition and copy them separately.

There's a Win32 app call w32DiskImager that can do the same thing. https://launchpad.net/win32-image-writer/+download
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

robhague
Posts: 12
Joined: Sun Sep 04, 2011 8:14 am
Contact: Website

Re: Downloadable SD Card Images

Thu Sep 15, 2011 8:36 pm

Fair point (I am on a Mac, but OS X has dd as well, and I have a Linux virtual machine to fall back on). It's not quite a pristine image any more, but it would allow me to get back to a known state.

Are there any plans for after the launch of the final boards?

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Downloadable SD Card Images

Thu Sep 15, 2011 8:53 pm

Hi Rob - Eben says he could set something up if it wasn't for the fact we're about to get on a plane! We'll try to get something set up for you next week.

(Rob, for those who haven't met him before, wrote the very excellent blog post about the project that I just linked to in the news section earlier in the evening. http://rob.rho.org.uk/2011/09/.....m_pie.html)
Director of Communications, Raspberry Pi

robhague
Posts: 12
Joined: Sun Sep 04, 2011 8:14 am
Contact: Website

Re: Downloadable SD Card Images

Fri Sep 16, 2011 7:39 am

(Checks date) Ah, yes - enjoy Maker Faire.

User avatar
Burngate
Posts: 6012
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 5:01 pm

Not sure if this is a good place for this question, though I've tried searching and not found anything relevant.
I picture, a few months from now, a village somewhere in the Masai Mara (or it could be an igloo on Novaya Zemlya) a young lad about 13.
He's got his RasPi (free to the village via the buy-one-give-one), he's got the SD card (also hopefully free via BOGO?) loaded with the OS etc., a keyboard and PSU (maybe in the pile of recycle trash shipped to his village from London), and he's been allowed to use the village TV. All well and good. It works.
Now a couple of days later, it's stopped working. He did somat silly, wiped the SD card! He's in trouble - including with the village elders who had let him play with it!
What does he do? He needs to reflash the card from scratch.
Ok, he's got everything he needs on a USB stick, he's got the RasPi, connected to keyboard and TV, and the now-blank SD card plugged in, but nothing happening.
To get the image off the USB stick onto the SD card, he needs all the USB and SD card drivers on the SD card, but they're on the USB stick not the SD card, so he can't use them.
He could go on-line using another computer, down-load it all on to the SD card using the other computer's SD card reader. But there isn't another computer in the village.
Maybe he could use another RasPi, assuming someone else in the village has one. But the other RasPi needs its card in the card slot to work, so he can't just swap it out to re-image his card - or can he?
I can see me in the same-ish position. If the image exists on a USB stick, can I boot off the USB stick, then transfer the image to the trashed SD card?
Or, I've bought two cards, I've trashed one, can I transfer the image off the good one to the trashed one using only the RasPi?

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 5:21 pm

The solution I envision is have a 2nd SD card, for only use during In Case of Crash!
Steps:
1) Boot from In Case Of SD card. With an OS that runs completely within the POP RAM space.
2a) Remove the In Case Of SD card, and plug in the BRICKed or new SD card.
2b) Plug in a USB Flash drive with extras to go on the reprogrammed SD card.
3) Command it to reFlash the inserted SD card.
( Maybe have a check to prevent reFlashing the In Case Of SD card.)
4) Tell the User to safely store away the In Case Of SD card.
5) Force a re-BOOT, using the fixed SD card images.

Back to Factory Fresh state.

That is what I envision for the sites I'll be supporting with my extra R-Pi software.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 5:38 pm

Bacan: yeah, I've thought that might be a nice feature. If you end up being the first to implement, do share your scripts and experience.

User avatar
Burngate
Posts: 6012
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 5:47 pm

Thanx both of you: job done.
I'm glad I'm not the only one thinking down this road!
So RasPi: £15.
SD card: £7.50.
In-case-of SD card: £7.50.
Total £30. BOGO total £60

User avatar
Jongoleur
Posts: 1179
Joined: Thu Aug 11, 2011 12:47 pm
Location: O'erlooking the sea, and all those effin windfarms...

Re: Downloadable SD Card Images

Thu Oct 20, 2011 6:21 pm

@Burngate:

The other route is to get one of those cheap little USB/Multicard adaptors and mount the SD card to be rescued on that, then things are all ticketyboo, even where dd is concerned...

(so the user will need a usb hub and an SD card adaptor as well as the "get out of jail" card" :-) )

Hmmmmmmmm...

As (like an Apple) the Raspberry Pi will have a limited number of configurations, it shouldn't be difficult to provide a list of incantations for every possible situation. A flowchart could be used to direct the errant user to the correct one!
I'm just a bouncer, splatterers do it with more force.....

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 6:43 pm

Worst come to worst; someone puts a SD card (hidden behind the postal sticker ;) ) in the mail to the owner of the messed up R-Pi.

Jongoleur: Yes, my above description is based upon the absolute minimum case of hardware. I've found it best to recover a system that way. You never know what that, "It will not hurt to leave that extra hardware plugged in!", is really doing to your efforts.

Your idea for a cheap little USB Combo adapter is a good solution for production Flashing of SD cards. God knows, I don't want to replace the on-board Flash holder/connector of a R-Pi. As I understand those connectors do have a limit to the number of insertions, 500 - 1000 maybe.

User avatar
Jongoleur
Posts: 1179
Joined: Thu Aug 11, 2011 12:47 pm
Location: O'erlooking the sea, and all those effin windfarms...

Re: Downloadable SD Card Images

Thu Oct 20, 2011 6:58 pm

What you do is post the new SD card in the guise of a charity mailing soliciting a donation (for Raspberry? *evil grin*)

No one is going to rifle through one of those!
I'm just a bouncer, splatterers do it with more force.....

robhague
Posts: 12
Joined: Sun Sep 04, 2011 8:14 am
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 7:11 pm

This takes me back to hours spent sitting in front of an Amiga, swapping disks back and forth whilst duplicating them. The big difference here is that the RAM on an Amiga (typically 512K-2MB) was a similar size to the capacity to the media (800K). The Raspberry Pi, on the other hand, has small RAM (128-256MB) compared to the media (potentially many GBs), meaning far more swapping if you use an SD card. A USB stick wouldn't have this problem, but costs more, and I don't know if the somewhat esoteric boot loader could necessarily boot from it.

An alternative that would cover accidental corruption or deletion (but not card failure) would be having a recovery partition as part of the standard card image. The boot loader could then boot to this at some signal (key held down?), and offer to overwrite the main partition with a fresh copy of the default configuration. Does anyone know enough about the GPU part of the boot loader to know if this is feasible?

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 7:15 pm

Quote from Bacan on October 20, 2011, 19:43
As I understand those connectors do have a limit to the number of insertions, 500 - 1000 maybe.

That sounds on the low side. Is that really all?

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 7:18 pm

Quote from robhague on October 20, 2011, 20:11
An alternative that would cover accidental corruption or deletion (but not card failure) would be having a recovery partition as part of the standard card image.

Or a snapshotting filesystem.

Thunder__X
Posts: 43
Joined: Tue Sep 20, 2011 2:17 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 7:19 pm

Quote from Burngate on October 20, 2011, 18:01
Not sure if this is a good place for this question, though I've tried searching and not found anything relevant.
I picture, a few months from now, a village somewhere in the Masai Mara (or it could be an igloo on Novaya Zemlya) a young lad about 13.
He's got his RasPi (free to the village via the buy-one-give-one), he's got the SD card (also hopefully free via BOGO?) loaded with the OS etc., a keyboard and PSU (maybe in the pile of recycle trash shipped to his village from London), and he's been allowed to use the village TV. All well and good. It works.
Now a couple of days later, it's stopped working. He did somat silly, wiped the SD card! He's in trouble - including with the village elders who had let him play with it!
What does he do? He needs to reflash the card from scratch.
Ok, he's got everything he needs on a USB stick, he's got the RasPi, connected to keyboard and TV, and the now-blank SD card plugged in, but nothing happening.
To get the image off the USB stick onto the SD card, he needs all the USB and SD card drivers on the SD card, but they're on the USB stick not the SD card, so he can't use them.
He could go on-line using another computer, down-load it all on to the SD card using the other computer's SD card reader. But there isn't another computer in the village.
Maybe he could use another RasPi, assuming someone else in the village has one. But the other RasPi needs its card in the card slot to work, so he can't just swap it out to re-image his card - or can he?
I can see me in the same-ish position. If the image exists on a USB stick, can I boot off the USB stick, then transfer the image to the trashed SD card?
Or, I've bought two cards, I've trashed one, can I transfer the image off the good one to the trashed one using only the RasPi?


Maybe a third party business,school,mission group (or even the raspberry pi team) could set up a system where kids can send in the sd cards that they've accidentally wiped, and have some sort of main computer that could fix it for them. I'm sure where ever this little device goes, there will be someone technically inclined to either be able to fix it for them or teach their parents, teachers, or guardians how to. It might just be wishful thinking on my part, but it sounds plausible.

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 8:08 pm

Quote from robhague on October 20, 2011, 20:11
... the somewhat esoteric boot loader could necessarily boot from it. ...


Elsewhere in the Forum you'll find notes that indicate that the GPU boot-loads the R-Pi directly from the first and second blocks on the SD card. That GPU micro-coded loader (a DMA state machine, maybe? ) would have to be recoded << I would not even think of asking Liz for that request! >> to Boot from something other than the SD card. The GPU expects to find at a fixed memory location, the SD card, that is directly wired to the SoC, that contains the GPU, ARM, and DSP. After those boot blocks are loaded, then control is passed to the ARM. It is the ARM that controls the USB buss and devices. Therefore, I don't think the R-Pi can boot from a USB Flash drive without working code on the SD card at the boot block locations.

The rest of the SD card space is available for more OS code, User programs and data. When the boot blocks get trashed, those other files may still be readable. Even if the Boot blocks can not be repaired, the other non-boot blocks should be recovered and preserved on say a USB Flash drive. Before a re-Flash attempt is performed on the problem SD card.

To me, it will be easier to load a self-contained recover OS, to just restore the Boot Blocks that have been trashed. Than try to have an OS run over the slow USB buss. Thank you, your comments have made me realize the recovery OS needs to transfer the non-Boot blocks out to a USB Flash drive as a backup or a Thank God, I got a copy of those files to use again.

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 8:34 pm

Quote from robhague on October 20, 2011, 20:11
An alternative that would cover accidental corruption or deletion (but not card failure) would be having a recovery partition as part of the standard card image. The boot loader could then boot to this at some signal (key held down?), and offer to overwrite the main partition with a fresh copy of the default configuration. Does anyone know enough about the GPU part of the boot loader to know if this is feasible?

The button your asking about is called the Power Switch.

The only time the Boot blocks and OS blocks, should be accessed are after a Cold Power-Up. Unless your writing your own replacement OS, or have an application randomly writing to SD card memory blocks, destroying stored files, the Boot and OS code should be safe.

However, please, let us not pull a Microsoft Recovery Big Brother Bloat solution of watching what your doing and make a copy behind your back.. Or if you do, give me a way to Kill It forever from my system! Just my Opinion.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23688
Joined: Sat Jul 30, 2011 7:41 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 9:54 pm

You certainly don't need to change the contents of the first partition, its just boot stuff. But you could do it my accident.

You could have a backup of the boot partition elsewhere on the card, but I cannot think of a way of recovering it if the main boot partition is trashed, as that contains the boot code for the GPU as well, and if that is knacked you ain't going anywhere. There is a very simple boot loader on the chip, that loads the more complicated one on to the GPU, but not sure if that can be changed. Might ask around.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Coburn
Posts: 78
Joined: Tue Sep 06, 2011 2:57 am
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 10:15 pm

What will the partition setup look like? Will we be able to say, load a kernel off SD and modify the kernel parameters to load the Linux root file system from USB? I read above the boot loader is very simple, but I was wondering if a config file is present allowing users to specify kernel parameters at boot.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 10:26 pm

jamesh, do you know if the files on the boot partition can be flagged read-only ?
I know the whole SD card can't be 'coz Linux needs to write stuff while booting. And we can't flag a whole partition read-only, but maybe we can have one extra small level of safety if the boot files are read only.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 10:29 pm

Eben says the files can, but who's going to respect it? You can flag something read-only, but it's impossible to guarantee anybody will actually pay attention to the flag.
Director of Communications, Raspberry Pi

kme
Posts: 448
Joined: Sun Sep 04, 2011 9:37 am

Re: Downloadable SD Card Images

Thu Oct 20, 2011 10:35 pm

I know the whole SD card can't be 'coz Linux needs to write stuff while booting.Ever heard of a Linux live CD? A CD isn't particular writable. And Linux doesn't want write the first thing to it's boot partition (unless your are upgrading the image of course). It do want to write log files, but that's not on the boot partition and can be done in RAM or rerouted to a syslog server. This is how thin clients work.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Downloadable SD Card Images

Thu Oct 20, 2011 10:58 pm

I had thought about putting a live CD on the SD card too, but then I thought about the fact that it stores a lot of stuff in RAM, with on 256 MB, do you really want to bog things down by losing a portion of it?
Dear forum: Play nice ;-)

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

Re: Downloadable SD Card Images

Thu Oct 20, 2011 10:59 pm

From: http://en.wikipedia.org/wiki/S.....re_Digital

go to above url for image of SD card.

<<<Quote from Wikipedia:>>>

Optional write-protect tab

When looking at the card from the top (see pictures) there is one required notch on the right side, the side with the diagonal cut-off corner.

On the left side there may be a write-protection notch. If this is present, the card cannot be written. If the notch is covered by a sliding write protection tab, or absent, then the card is writeable. Because the notch is detected only by the reader, the protection can be overridden if desired (and if supported by the reader). Not all devices support write protection, which is an optional feature of the SD standard.

Some SD cards have no write-protection notch,[13] and it is absent completely in the microSD and miniSD formats.
<<<Close Quote>>>

Something to check out when we get our R-Pi cards and blow $75 USD on different SD card brands and sizes in testing what works best.

I know one client that will want his stuff write protected.

Return to “General discussion”