What is the benefit of pendrive booting

Boot the Raspberry Pi from the USB drive

In the long run, some applications on the Raspberry Pi lead to the SD card being damaged. The reason is that the flash memory it contains cannot withstand many write cycles. This is also clear because an SD card is actually made for digital cameras and only a few photos and films are stored there. In such an application, an SD card lasts forever.
Such a memory card is not suitable as memory for an operating system. In such cases it makes sense to move the contents of the SD card to a USB hard drive or USB stick and boot the Raspberry Pi from there.
Another advantage is that the speed is significantly better compared to conventional SD cards.

It is important that the USB port on the Raspberry Pi only supplies 600 mA at the time of start. All connected USB devices must therefore no longer draw power together when they are switched on and later during operation. USB sticks and SSDs usually get by with less. Not so with hard drives. Here you should check the power consumption beforehand.

The following steps are to be carried out:

1. Activate Raspberry Pi for booting from a USB drive.
2. Move (copy) the contents of the SD card to a USB drive.
3. Start up Raspberry Pi with USB drive.

Enable Raspberry Pi to boot from a USB drive

The Raspberry Pi in question must be booted once with Raspbian from an SD card. The USB boot mode is activated with a parameter in the configuration file “/boot/config.txt”.

echo program_usb_boot_mode = 1 | sudo tee -a /boot/config.txt

It is now important to restart the Raspberry Pi once so that it takes over this setting.

sudo reboot

Then you check whether the parameter has been set correctly.

vcgencmd otp_dump | grep 17:

The output should be “17: 3020000a”. Then you can shut down the Raspberry Pi and remove the SD card.

Prepare the USB drive

Usually you have an established system on an SD card. The content has to be saved in an image file and then written to the USB drive.

Put Raspberry Pi into operation with USB drive

It is important that the SD card has been removed. This is because it has priority during the boot process. A USB drive will only boot if there is no SD card inserted.
The USB drive with the image described is plugged into a free USB port and the Raspberry Pi is put into operation. It should then boot from the USB drive. If the drive has an activity LED, it should blink after a few seconds. That's a good sign.

Troubleshooting

If the Raspberry Pi does not seem to be operating, you should at least operate it on a monitor to check the boot process.

Problems should only arise if the connected USB devices draw too much current when switched on or the drive controller takes too long to start up. There is a solution for both.

additions

Other related topics:

Experience electronics with the Raspberry Pi

All-in-one electronics starter kit for every Raspberry Pi

With breakout board, ribbon cable, breadboard and many electronic components. The whole package is rounded off with an English-language tutorial with programming examples in C, Python and Java for download.

I want that!