#] #] ********************* #] "$d_SysMaint"'RaspberryPi/boot from USB memory stick.txt' # www.BillHowell.ca 11Jul2019 initial # view in text editor, using constant-width font (eg courier), tabWidth = 3 #48************************************************48 #24************************24 # Table of Contents, generate with : # $ grep "^#]" "$d_SysMaint"'RaspberryPi/boot from USB memory stick.txt' | sed "s/^#\]/ /" # #24************************24 # Setup, ToDos, #08********08 #] ??Jan2024 #08********08 #] ??Jan2024 #08********08 #] ??Jan2024 #08********08 #] ??Jan2024 #08********08 #] ??Jan2024 #08********08 #] ??Jan2024 ************** #] 11Jul2019 https://www.stewright.me/2018/03/boost-raspberry-pi-performance-installing-raspbian-usb-flash-drive-windows/ Boost Raspberry Pi performance by installing Raspbian on a USB Flash drive from Windows by Ste · 17th March 2018 By default, Raspbian runs from a MicroSD card on your Raspberry Pi. Micro SD card performance in terms of speed and reliability tends to be considerably less than with USB Flash storage. This tutorial will guide you through the process of installing Raspbian on a USB Flash drive from Microsoft Windows. Once you’re done, your Raspberry Pi’s performance will increase considerably. Running Linux or MacOS? I’ve previously written tutorials on how to achieve this from MacOS or Linux. Follow the tutorial here. Let’s get started – what you need You will need the following to get started: A Raspberry Pi 2, 3 or 3 A USB Flash drive with at least 4GB capacity (I recommend Corsair Voyager or Sandisk Cruzer with 8GB+) A 4GB Micro SD card (Yep, I’m afraid you will still need one of these to begin with) A PC running Windows 7, 8 or 10 Step 1 – Download Raspbian and Etcher To begin, we will need to download Raspbian OS. There’s two different flavours; Raspbian Lite – purely command line (for servers and running services) and Raspbian Desktop, which has a full desktop enviroment. Choose the one which best suits your needs. >> Done - see below Step 2 – Install Raspbian to the MicroSD card Note: If you’re using a Raspberry Pi 3+, you don’t need to do step 2. Jump straight to step 3. Unfortunately, we still need a MicroSD card. We will do the first boot off the MicroSD card, and then configure the Raspberry Pi to boot from the USB Flash Drive.This is because the hardware does not support USB booting, so the SD card will eventually tell the Raspberry Pi to continue to boot from the USB Flash drive. >> Done - see below Step 3 – Install Raspbian to the USB Flash Drive The process is exactly the same as step 2, but this time we choose the USB flash drive as our destination. Choose the Raspbian zip as the source, the USB Flash as the destination and click ‘Flash’. If you’re using a Raspberry Pi 3 Model B+, you can skip step 4. >> Done - see below Step 4 – Prepare the Raspberry Pi for boot from USB If you’re using a Raspberry Pi 3 Model B+, you can skip straight to step 5. Remove the MicroSD card from your computer and insert it into your Raspberry Pi and start it up. Once you’ve booted, you will want to launch Terminal (if you opted for the desktop version of Raspbian). >> doesn't work!! Next, type the following command: sudo nano /boot/config.txt Add this line to the bottom of the file: program_usb_boot_mode=1 Press keys CTRL + X to exit nano, saving when prompted. Now, you’re ready to boot from the USB. +-----+\ https://www.raspberrypi.org/downloads/raspbian/ Raspbian Buster with desktop and recommended software Image with desktop and recommended software based on Debian Buster Version: June 2019 Release date: 2019-06-20 Kernel version: 4.19 Size: 1945 MB SHA-256: 7c0dec54e9ad694d6f306f495f793d1a5021020e7c46a6df02b6c84478473e17 I downloaded the zip to "/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip" +-----+ https://www.raspberrypi.org/documentation/installation/installing-images/linux.md Installing operating system images on Linux Discovering the SD card mountpoint and unmounting it Run lsblk to see which devices are currently connected to your machine. If your computer has a slot for SD cards, insert the card. If not, insert the card into an SD card reader, then connect the reader to your computer. Run lsblk again. The new device that has appeared is your SD card (you can also usually tell from the listed device size). The naming of the device will follow the format described in the next paragraph. >> sde -> sde1 The left column of the results from the lsblk command gives the device name of your SD card and the names of any paritions on it (usually only one, but there may be several if the card was previously used). It will be listed as something like /dev/mmcblk0 or /dev/sdX (with partition names /dev/mmcblk0p1 or /dev/sdX1 respectively), where X is a lower-case letter indicating the device (eg. /dev/sdb1). The right column shows where the partitions have been mounted (if they haven't been, it will be blank). If any partitions on the SD card have been mounted, unmount them all with umount, for example umount /dev/sdX1 (replace sdX1 with your SD card's device name, and change the number for any other partitions). >> unmounted Copying the image to the SD card In a terminal window, write the image to the card with the command below, making sure you replace the input file if= argument with the path to your .img file, and the /dev/sdX in the output file of= argument with the correct device name. This is very important, as you will lose all the data on the hard drive if you provide the wrong device name. Make sure the device name is the name of the whole SD card as described above, not just a partition. For example: sdd, not sdds1 or sddp1; mmcblk0, not mmcblk0p1. dd bs=4M if=2018-11-13-raspbian-stretch.img of=/dev/sdX conv=fsync +-----+ $ sudo dd bs=4M if="/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" of=/dev/sde conv=fsync 579+1 records in 579+1 records out 2429397543 bytes (2.4 GB, 2.3 GiB) copied, 177.573 s, 13.7 MB/s >> Then to zip download >> apparently ,didn't work the first time. Try again. $ sudo dd bs=4M if="/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" of=/dev/sde conv=fsync [sudo] password for bill: dd: failed to open '/dev/sde': Read-only file system >> Nuts! Try a different SD card... Lexar 32 Gb $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 232.9G 0 disk ├─sda1 8:1 0 117.2G 0 part / ├─sda2 8:2 0 39.1G 0 part └─sda3 8:3 0 76.7G 0 part sdb 8:16 0 2.7T 0 disk └─sdb1 8:17 0 2.7T 0 part /media/bill/HOWELL_BASE sdc 8:32 0 2.7T 0 disk └─sdc2 8:34 0 2.7T 0 part /media/bill/SWAPPER sdd 8:48 1 60.1G 0 disk └─sdd1 8:49 1 60.1G 0 part /media/bill/SAMSUNG_G4 sde 8:64 1 29.9G 0 disk └─sde1 8:65 1 29.9G 0 part /media/bill/9016-4EF8 sr0 11:0 1 1024M 0 rom ~ $ sudo dd bs=4M if="/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" of=/dev/sde conv=fsync 579+1 records in 579+1 records out 2429397543 bytes (2.4 GB, 2.3 GiB) copied, 203.437 s, 11.9 MB/s +-----+ Please note that block size set to 4M will work most of the time. If not, try 1M, although this will take considerably longer. Also note that if you are not logged in as root you will need to prefix this with sudo. Copying a zipped image to the SD card In Linux it is possible to combine the unzip and SD copying process into one command, which avoids any issues that might occur when the unzipped image is larger than 4GB. This can happen on certain filesystems that do not support files larger than 4GB (e.g. FAT), although it should be noted that most Linux installations do not use FAT and therefore do not have this limitation. The following command unzips the zip file (replace 2018-11-13-raspbian-stretch.zip with the appropriate zip filename), and pipes the output directly to the dd command. This in turn copies it to the SD card, as described in the previous section. unzip -p 2018-11-13-raspbian-stretch.zip | sudo dd of=/dev/sdX bs=4M conv=fsync >> $ unzip -p "/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" | sudo dd of=/dev/sde bs=4M conv=fsync >> with second (Lexar) SD card : $ unzip -p "/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" | sudo dd of=/dev/sde bs=4M conv=fsync 0+65207 records in 0+65207 records out 6434062336 bytes (6.4 GB, 6.0 GiB) copied, 546.644 s, 11.8 MB/s >> I safely removed the SD card, unplugged, then plugged back in. Error : "Unable to mount 268 MB Volume" - Error mounting /dev/de1 at /media/bill/9016-4EF8: Command-line 'mount -t "vfat" -o "uhelper=udisk2,nodev,nousid,uid-=1000,shortname-mixed,utf8=1,showexec,flush" ... >> I pulled it, then plugged into the RaspPi >> still no boot - isn't the SD supposed to be fat32 format? +-----+ https://www.raspberrypistarterkits.com/how-to/fix-raspberry-pi-not-booting-problem/ Why is your Raspberry Pi 3 Not Booting? There are some reasons due to any or some of which you may face this Raspberry Pi troubleshooting problem. Let’s have a look at the list: You have recently run an rpi-update You have overclocked Raspberry Pi 3 beyond limits There are some changes made in the configuration file, i.e., in config.txt If you deleted some important files recently A new device is just connected to the Pi setup If the SD card is corrupted There is a mistake in connecting the wires to the setup You forced shutdown of Raspberry Pi while some apps are still running or a command line interface is in between a process Any of the above reason alone or combining with other issues can cause the problem of Raspberry Pi not booting. If you are facing the same with your setup, then check the solution here to get rid of it. +-----+ >> For USB memory stick (bootable) : >> same command, as I removed the SD card and put in the USB, which is listed as sde $ sudo dd bs=4M if="/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" of=/dev/sde conv=fsync^C ~ $ unzip -p "/media/bill/SWAPPER/System_maintenance/RaspberryPi/Raspian 4.19 zip/2019-07-10-raspbian-buster-full.zip" | sudo dd of=/dev/sde bs=4M conv=fsync 0+65719 records in 0+65719 records out 6434062336 bytes (6.4 GB, 6.0 GiB) copied, 1305.86 s, 4.9 MB/s >> I only did this once. I could read the USB memory after. Checking the image copy progress By default, the dd command does not give any information about its progress, so it may appear to have frozen. It can take more than five minutes to finish writing to the card. If your card reader has an LED, it may blink during the write process. To see the progress of the copy operation, you can run the dd command with the status option. dd bs=4M if=2018-11-13-raspbian-stretch.img of=/dev/sdX status=progress conv=fsync If you are using an older version of dd, the status option may not be available. You may be able to use the dcfldd command instead, which will give a progress report showing how much has been written. Another method is to send a USR1 signal to dd, which will let it print status information. Find out the PID of dd by using pgrep -l dd or ps a | grep dd. Then use kill -USR1 PID to send the USR1 signal to dd. Optional: checking whether the image was correctly written to the SD card After dd has finished copying, you can check what has been written to the SD card by dd-ing from the card back to another image on your hard disk, truncating the new image to the same size as the original, and then running diff (or md5sum) on those two images. If the SD card is much larger than the image, you don't want to read back the whole SD card, since it will be mostly empty. So you need to check the number of blocks that were written to the card by the dd command. At the end of its run, dd will have displayed the number of blocks written as follow: xxx+0 records in yyy+0 records out yyyyyyyyyy bytes (yyy kB, yyy KiB) copied, 0.00144744 s, 283 MB/s We need the number xxx, which is the block count. We can ignore the yyy numbers. Copy the SD card content to an image on your hard drive using dd again: dd bs=4M if=/dev/sdX of=from-sd-card.img count=xxx if is the input file (i.e. the SD card device), of is the output file to which the SD card content is to be copied (called from-sd-card.img in this example), and xxx is the number of blocks written by the original dd operation. In case the SD card image is still larger than the original image, truncate the new image to the size of the original image using the following command (replace the input file reference argument with the original image name): truncate --reference 2018-11-13-raspbian-stretch.img from-sd-card.img Compare the two images: diff should report that the files are identical. diff -s from-sd-card.img 2018-11-13-raspbian-stretch.img Run sync. This will ensure that the write cache is flushed and that it is safe to unmount your SD card. Remove the SD card from the card reader. # enddoc