Can't run from USB-disk in debian buster on Raspberry PI models 1B and 2B (SOLVED)

67 views
Skip to first unread message

Luc Heijst

unread,
Apr 4, 2020, 8:56:48 AM4/4/20
to weewx-user
I used to change the root=PARTUUID= setting in cmdline.txt of the (micro) sd-card of RPI 1B and 2B models to the PARTUUID of the USB-disk.
Then the RPI will run with root on the SDA parttion.

When raspbian buster (or the latest version of stretch) is written with balenaEtcher, both sd-card and usb-disk get the same PARTUUID. See below.

blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4BBD-D3E7" TYPE="vfat" PARTUUID="738a4d67-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="45e99191-771b-4e12-a526-0779148892cb" TYPE="ext4" PARTUUID="738a4d67-02"
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4BBD-D3E7" TYPE="vfat" PARTUUID="738a4d67-01"
/dev/sda2: LABEL="rootfs" UUID="45e99191-771b-4e12-a526-0779148892cb" TYPE="ext4" PARTUUID="738a4d67-02"
/dev/mmcblk0: PTUUID="738a4d67" PTTYPE="dos"

With the set-ptuuid script downloaded from:https://www.raspberrypi.org/forums/viewtopic.php?t=253562 we can change the PARTUUID of the USB-disk (or the sd-card).
The script also changes the PARTUUID settings in cmdline.txt and other files.

Example
=====
Boot from the sd-card with the usb-disk connected

Now change the PTUUID of the USB-disk
./set-ptuuid /dev/sda random
Set PTUUID on /dev/sda to e4f3c2c9 (y/n)?
PTUUID on /dev/sda is set to e4f3c2c9

blkid
/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4BBD-D3E7" TYPE="vfat" PARTUUID="738a4d67-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="45e99191-771b-4e12-a526-0779148892cb" TYPE="ext4" PARTUUID="738a4d67-02"
/dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4BBD-D3E7" TYPE="vfat" PARTUUID="e4f3c2c9-01"
/dev/sda2: LABEL="rootfs" UUID="45e99191-771b-4e12-a526-0779148892cb" TYPE="ext4" PARTUUID="e4f3c2c9-02"
/dev/mmcblk0: PTUUID="738a4d67" PTTYPE="dos"

cat cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=e4f3c2c9-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh

Now reboot the RPI with the sd-card and USB-disk still connected
The RPI will now have it's root set to /dev/sda2

cat /etcfstab
proc            /proc           proc    defaults          0       0
PARTUUID=e4f3c2c9-01  /boot           vfat    defaults          0       2
PARTUUID=e4f3c2c9-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
=====

Luc

Luc Heijst

unread,
May 31, 2020, 4:47:51 PM5/31/20
to weewx-user
The boot process from a USB-stick as described above is simplified.

Follow these steps:
1. Format a SD-card with fat32.
2. Write file bootcode.bin to the SD-card.
3. Write with program balenaEther the zip file of Raspbian Buster (aka Raspberry Pi OS (32-bit)) to the USB-stick.
4. To enable ssh, write an empty file with name 'ssh' to the root of the USB-stick.
5. Put both SD-card and USB-stick in the Raspberry PI 2 B (or PI B) slots.
Power up the RPi 2B

Done!

vince

unread,
May 31, 2020, 6:27:44 PM5/31/20
to weewx-user
On Sunday, May 31, 2020 at 1:47:51 PM UTC-7, Luc Heijst wrote:
The boot process from a USB-stick as described above is simplified.



I might add - add a correct wpa_supplicant.conf file as well, if you want to bring up wifi at first boot without needing a keyboard and monitor to configure things.

Luc Heijst

unread,
May 31, 2020, 6:44:09 PM5/31/20
to weewx-user
Another approach for setting up the wifi is connect the RPi (the first time) with an ethernet cable to the network, 
Remote log in with a putty session and configure wifi with raspi-config.
I also configure a static ip-address for the network module(s) in my router.
BTW the models 1B and 2B don’t have on board wifi.

vince

unread,
May 31, 2020, 8:48:42 PM5/31/20
to weewx-user
On Sunday, May 31, 2020 at 3:44:09 PM UTC-7, Luc Heijst wrote:
Another approach for setting up the wifi is connect the RPi (the first time) with an ethernet cable to the network, 
Remote log in with a putty session and configure wifi with raspi-config.
I also configure a static ip-address for the network module(s) in my router.
BTW the models 1B and 2B don’t have on board wifi.


Of course.   I reserve addresses for my pi so they always come up with a predictable address (once defined once per system), so I can ssh in without needing to wire them to the network.  I use the old usb wifi dongles in my model-B. 
Reply all
Reply to author
Forward
0 new messages