Raspberry Pi For Dummies. McManus Sean

Чтение книги онлайн.

Читать онлайн книгу Raspberry Pi For Dummies - McManus Sean страница 8

Raspberry Pi For Dummies - McManus Sean

Скачать книгу

2-2.

       FIGURE 2-2: SD Card Formatter, used to format the SD or MicroSD card, on a Mac.

      Make sure the Select Card drop-down menu shows the SD or MicroSD card you want to use. This is the drive that will be wiped, so check this as often as you need to for you to be certain. If the right card isn’t shown, use the drop-down menu to choose the right one.

      Next, click the Overwrite Format option to select it. Click the Format button, and SD Card Formatter starts to format the card. Note that there is no need to enter anything into the Volume Label box. That will be completed automatically.

      This is a great time to have a cup of tea, because the card takes about half an hour to format. You can still use your Mac while the process is running, although it might take a bit longer to format if you do. When the formatter is finished, you see the icon of the SD or MicroSD card on the desktop. Note that if the SD card has been formatted before or comes preformatted, clicking the Quick Format option will save you some time.

       Using Linux

      We’re using Ubuntu, the most popular desktop distribution, so you might see some variations if you prefer a different distribution. These steps should give you the guidance you need in any case.

      warning Because this process involves completely erasing a disk (the SD card), make sure you have a recent backup of your computer before you proceed, just in case you accidentally wipe the wrong disk.

      Follow these steps:

      1. You use a utility called GParted to set up the SD card on Ubuntu. If you don't already have it installed, start by installing it from the terminal. Enter the following commands:

      sudo apt-get update

      sudo apt-get install gparted

      You can open a terminal window by using Dash Home in Ubuntu, the applications menu in your distribution, or a keyboard shortcut (Ctrl+Alt+T in Ubuntu).

      2. You use a utility called GParted to set up the SD card on Ubuntu. It needs to be run with root permissions, so start it by issuing a command from the terminal. Enter the following:

      sudo gparted

Figure 2-3 shows GParted running on the desktop.

      3. Click in the top right to choose the correct disk, the SD card.

      Take particular care here. You can cause serious damage to your hard drive if you choose the wrong disk. We know this is our SD card because it’s showing a capacity of 7.4GB and our hard drive has a capacity of 500GB.

      4. The main window shows the partitions on the card. You want to delete them, so click them in turn and then click the Delete icon on the toolbar.

      The Delete icon looks like a No Entry sign, or the international No symbol. This won’t take effect yet: You queue up the actions you want to carry out and then trigger them all when you’ve finished. (If you can’t set a partition to delete because it has a Key icon beside it, right-click the partition and choose Unmount from the menu that appears.)

      5. Click the unallocated partition and click the Add Partition button (the one on the toolbar that has a picture of a blank page with a plus sign on it).

      The pop-up window, which you can see in the foreground in Figure 2-3, appears.

      6. Click the menu to change the file system to fat32, and then click the Add button.

      Again, this doesn’t take effect yet.

      7. Click the tick (or check mark) button on the toolbar to carry out the actions you’ve queued up – removing the existing partitions and adding a single new FAT32 partition.

       FIGURE 2-3: GParted, running on the Ubuntu desktop.

Copying NOOBS to the SD or MicroSD card

      You should now have a formatted SD or MicroSD card and the .zip file for NOOBS that you downloaded from the Raspberry Pi website. To install NOOBS on the SD or MicroSD card, you simply copy the files inside the .zip file to the card.

      On a Windows PC, double-click the NOOBS .zip file to open it, select all the files in it, and then copy them to the formatted SD card. You can do this by using Ctrl+A to select the files and Ctrl+C to copy them, navigating to the SD card, and then using Ctrl+V to paste them.

      On a Mac, double-click the NOOBS .zip file and you will see a folder containing all the files you need. From the Edit menu, choose Select All and drag all the files onto the SD Card icon on the desktop. It takes about 15 minutes to copy everything across. When it’s finished, eject the SD card by dragging it into the trash can, which has now transformed into an Eject icon.

      On Linux, you can use the desktop environment (where available) to copy the NOOBS files to the SD card. In Ubuntu, you can simply go to the NOOBS .zip file, double-click it to open it, select all the files in it, and drag them to the SD card to copy them across.

      Alternatively, you can follow these steps to unzip and copy the files using the Linux command line:

      1. Remove and reinsert the card so that it mounts automatically.

      2. Open a terminal window.

      You can do this by using Dash Home in Ubuntu, the applications menu in your distribution, or a keyboard shortcut (Ctrl+Alt+T in Ubuntu).

      3. Enter sudo fdisk – l, where the last character is the letter l.

This gives you a list of available disks, as shown in Figure 2-4.

      4. Study this list to find the SD or MicroSD card.

      In Figure 2-4, the screen lists two disks, with the information about each one starting with the word Disk. The file size is usually a good indicator of which is the SD card. The first one (Disk /dev/sda) is 500.1GB, which is a hard drive. The second one (Disk /dev/sdd) is just 7948MB. That’s roughly 8GB, so that’s the SD card. Note the card’s partition name, which in this case is sdd1.

      5. Find out where the card is mounted.

      Use the mount command and search for the directory where the card has been mounted in the file system. In this case, the card’s partition name is sdd1, so enter the following:

      mount | grep – i sdd1

      Figure 2-4 shows the output from this, which tells you where the card is mounted. In this case, it’s mounted on /media/65E8-9564.

      6.

Скачать книгу