Last active
April 7, 2020 08:21
-
-
Save ww898/ad3c3e705945c77ce053ff6abeb94ac1 to your computer and use it in GitHub Desktop.
Switch booting from SD card to USB drive on Raspberry Pi 4 under ubuntu 18.04.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -exuo pipefail | |
# Connect USB drive with clean copy of Ubuntu 18.04 image only before run this script!!! | |
sudo sfdisk --list /dev/mmcblk0 | |
sudo sfdisk --list /dev/sda | |
read -p "Press [Enter] key to start modifying partition table..." | |
sudo sfdisk --delete /dev/mmcblk0 2 >/dev/null 2>&1 | |
sudo sfdisk --delete /dev/sda 1 >/dev/null 2>&1 | |
sudo sfdisk --list /dev/mmcblk0 | |
sudo sfdisk --list /dev/sda | |
read -p "Press [Enter] key to reboot..." | |
sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment