9

I know you can just copy and paste the NOOBS files and it works, but aside from that, in order to install other operating systems on a raspberry pi or some other similar device like odroid, etc, I'm instructed to use the "dd" terminal application which takes a very long time to do its job.

I assume this operation is more "involved" than just copying and pasting? Why can't I just copy and paste the image?

--could I just mount the linux image on my computer, then copy and paste its contents into the microsd rather than having to use the dd tool or some other "flash" application?

EDIT: I just found a great answer to this question here, but am thinking I should keep this question up on here because its such a classic noob question that deserves to be answered on this forum. If someone has more specifics to this answer that directly relates to the raspberry pi's boot process (and how does that NOOBS thing work??), please answer

1
  • Running NOOBS on a new SD Card takes more than 15 minutes to setup the partitions.
    – Milliways
    Jan 10, 2015 at 23:13

3 Answers 3

5

To fully answer this question requires all sorts of background information. I think I will start with a couple of things that I think you may have misunderstood.

The SD card (or a small USB stick) is called a "Flash" drive because that is the name of the "Flash" type memory it has in it. When you copy a file to an SD card, the circuits inside it move charges around the chip in a way that will persist when you unplug it. (Ordinary "Dynamic RAM" memory chips in a computer lose everything quickly as soon as the power goes off.) Flash memory is very slow to write to, and slow (but not as slow) to read from (compared to Dynamic RAM). Flash RAM also "wears out," so after thousands of read/write cycles parts of it quit working.

Fortunately for you, most of that is invisible in practice, so you can pretend an SD card or Flash USB stick is very similar to a tiny hard drive or floppy disk. But both are quite different from "burning" a CD or DVD.

SO try to forget about "flashing" the information to the SD card. What you are doing is not exactly comparable to "flashing" a computer motherboard or some other piece of electronics, because you don't have to go to special effort to change the data in the SD card's memory. Deep down on the chips it might be exactly similar, but the process you use write to an SD card or USB stick is quite different.

The Raspberry Pi has been designed to look on the SD card for a boot partition using a FAT filesystem. Depending upon how you are using the Pi, that might be the only partition on the SD card, but a sophisticated operating system such as Raspbian cannot possibly run on a FAT filesystem, so you need at least one additional partition (or a separate drive) that can handle linux files, such as ext4 format.

When you are running linux or Windows or a Mac and "copy" a file from one "mounted" filesystem to another, the operating system takes care of creating, deleting and pointing to the files as they are put on the hard drive, flash drive, or whatever. The files get stored inside each partition using the rules specific to the filesystem, whether it's FAT, ext4, Mac HFS+, or whatever.

When you start with an image file (often identified as .iso for linux or .dmg on a Mac), the file contains EVERYTHING, including all the pieces that identify the partitions and the chunks of data inside the partitions.

When you use the dd command in linux to copy a file, it takes the bits out of (or into) an .iso EXACTLY as they are stored on a disk or an SD card, completely ignoring the partitions, filesystems, files and directories that you and the operating system need to make sense of the data on it. It's a completely different kind of copy operation. If you just drag that .iso to your SD card, not only will you needlessly fill it, the Pi doesn't know how to look "inside" the .iso file to get what it needs.

A dd copy takes a long time because SD cards are slow and you are copying large chunks of data at a time. When everything is accounted for, however, it might be faster than copying the individual files.

And to answer the question, yes, you could mount the image and copy the files into the various partitions, but there will almost always be more than one partition and you will need to put the files in the right places. It's easiest in many cases to just use dd to copy from the image files to the SD card.

2

Your use of the term "flash" here is inappropriate if it is meant to refer to a contrast; although SD cards are flash memory based, copying to them is always the same on that level regardless of what tool you use, what kind of data it is, etc. Put another way, if you refer to copying data to an SD card as "flashing" it, then that applies equally well no matter what. If you want to call it "copying", same logic -- both the procedures you refer to involving copying data by "flashing" flash memory. That is the nature of SD cards; using cut n' paste vs. dd does not change the physical characteristics of the hardware. But all this is tangential to your primary question.

The way the NOOBS install works is you format the card, creating a vfat partition into which you can then copy regular files from the zip.

The way the image based installs work is you low level copy a block by block version of several partitions directly to the card. This is why you do not need to format it first; that image contains the formatted partitions, the first of which (the boot partition) serves exactly the same purpose (and contains some of the same files, such as the critical bootloader code) as the partition you created for NOOBS.

If you download and install the "lite" version of NOOBS, it's only 20 MB -- but then you must download a full blown OS afterward as part of the install process. If you download the "full" version, it's 700+ MB and it will take much longer to copy to the card.

If you download a stand-alone raspbian image, it is a ~2.0 GB image, and will take correspondingly longer to copy to the card. In addition, dd is a manual, low level, file system independent tool. There are several consequences to this:

  • It does not make any guesses or assumptions about how to do things optimally. For example, supposedly using a 4 MB blocksize (bs=4M) will make a big difference with regard to speed on SD cards, but that is not the default and dd will not try to figure that out. Cut and paste via a higher level tool likely will, partially based on information it gets by examining the filesystem you already created by formatting the card. However, dd can do things those tools generally can't (such as write raw blocks to a device, which is why it is necessary with the images).

  • The OS may make the operation of higher tools appear more streamlined via caching, which it can do with mounted filesystems. This is why you sometimes have to wait a while if you make a big copy and then go to unmount a stick; the copy was not actually complete, and the OS won't release it until actually done (this is also why you should always wait until the OS says it is okay). dd to a device does not involve any caching of this sort. It is really done when it is done.

1

As probably already know from other replies, the format that an SD card for a RPI should be set to FAT32, or else it will not work. The downside of the FAT32 format is that it has a copy limit of 4GB, which greatly limits your possibilities of what OS you will be able to easily install to the SD card. However, there is a way to "bypass" this limit, and it is by using a program such as 7zip to compress the .img file to something under 4GB, and then extracting it at the root of the SD card.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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