#!/bin/bash # FROM https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=106529 # RUN `bash migrate_noobs.sh` # ABOUT migrating NOOBs to Raspbian # you need prepare 2 SD cards, card A running NOOBs that you want to migrate, put this card in pi card slot # card B plug into card reader, insert this into pi usb port, all data in this card will be erased # and remove all other storage BOOT_PARTITION=`mount|grep ' /boot '|cut -d' ' -f 1` ROOT_PARTITION=`mount|grep ' / '|cut -d' ' -f 1` SDCARD=/dev/sda sudo umount "$SDCARD"1 "$SDCARD"2 || /bin/true sudo fdisk "$SDCARD" <