Page 1 of 1

Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Wed May 20, 2020 10:32 pm
by RonR
These instructions are intended to make migrating existing hybrid SD/USB booting to direct USB booting on a Raspberry Pi 4 as painless as possible.

[To migrate an SD card to direct USB booting on a Raspberry Pi 4, see: Running Raspbian from USB Devices : Made Easy]

Update your Raspberry Pi 4 bootloader using rpi-eeprom-update (Pi 4 Bootloader Configuration). Running rpi-eeprom-update should then display:

BOOTLOADER: up-to-date
CURRENT: Mon 15 Jun 13:36:19 UTC 2020 (1592228179)

Boot the USB device via the SD card and update your Raspberry Pi 4 firmware using rpi-update (Pi 4 Bootloader Configuration). Logging into an SSH session should then display:

Linux raspberrypi 5.4.47-v7l+ #1319 SMP Wed May 20 14:12:03 BST 2020 armv7l

Reboot.

Then use the attached scripts to migrate your existing hybrid boot SD/USB device to direct boot:

!!! BEFORE PROCEEDING, MAKE A BACKUP OF YOUR USB DEVICE !!!

Scripts must be made executable (chmod +x ...) and must be run as root user (use sudo if necessary).

If your USB device contains a BOOT partition

Boot the USB device via the SD card and run:

Code: Select all

sudo ./update-boot

Boot files on the USB device BOOT partition will be updated from the SD card. /boot/cmdline.txt and /etc/fstab on the USB device will be set for direct USB booting.

The USB device should now be capable of booting on your Raspberry Pi 4 with the SD card removed.

If your USB device lacks a BOOT partition

Many of the instruction guides for manually configuring a Raspberry Pi to boot a USB device via an SD card placed only the ROOT partition on the USB device. The lack of a BOOT partition and boot files precludes the USB device from being booted without an SD card. [This problem is not present if Running Raspbian from USB Devices : Made Easy was used.]

To correct this problem, a 256M BOOT partition will be created on the USB device and boot files from the SD card will be copied to it. /boot/cmdline.txt and /etc/fstab will be set for direct USB booting. The ROOT partition will become the second partition. Up to two additional partitions may be present following the ROOT partition and will not be altered. No free space is required.

Perform the following steps to add a BOOT partition and boot files to your USB device:

1. Shutdown and disconnect all USB devices except your boot USB device.

2. Boot the USB device via the SD card and run:

Code: Select all

sudo ./add-boot --prep

3. When add-boot completes, shutdown, boot an SD card (not the USB device), and run:

Code: Select all

sudo ./add-boot /dev/sda

Upon completion, your USB device should have a BOOT partition containing the boot files from the SD card you boot it with. /boot/cmdline.txt and /etc/fstab on the USB device will be set for direct USB booting.

The USB device should now be capable of booting on your Raspberry Pi 4 with the SD card removed.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Thu May 21, 2020 2:24 pm
by satadru
Please make the boot partition in your script greater than 256Mb.

gparted finds it impossible to resize fat32 partitions 256Mb and smaller.

This might be an issue for people moving forward...

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Thu May 21, 2020 4:36 pm
by RonR
satadru wrote:
Thu May 21, 2020 2:24 pm
Please make the boot partition in your script greater than 256Mb.

gparted finds it impossible to resize fat32 partitions 256Mb and smaller.

This might be an issue for people moving forward...

It's 256M because that's what it is in Raspbian images.

The BOOT partition can easily be expanded in the future should it become necessary (see expand-boot for one example).

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sat May 23, 2020 6:33 am
by Iprouteth0
Do we know if the start.elf has been updated yet also so that everything will work for full USB booting on the rpi4?

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sat May 23, 2020 12:33 pm
by dickon
We do. It's beta. For some reason it was announced in the 'General discussion' topic here: viewtopic.php?f=63&t=274595.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sat May 23, 2020 11:18 pm
by rasparbarian
This worked fine on the latest Raspbian, EXCEPT -- during the actual boot sector's migration, the device was marked as busy, hence none of the required firmware files were copied on to it. They are intact on the drive, but I've got no clue how to mount the filesystem over the cmdline.txt by hand ... I guess I have to go through the scripts and see what they actually do, and then mimick that action into the cmdline.txt ... [ at this point my post got edited for some reason ?? I was merely copypasting the contents of my cmdline.txt (one line) and the variants I had tried to use in pointing out the right drive, i.e. the UUID, PARTUUID, etc...]

I've got so far as to get it to load up and wait for the proper hard drive already! (Before that, I had to download the latest .elf files from https://github.com/raspberrypi/firmware ... aster/boot and replace them on the boot partition or I was stuck in the initial screen due to a mismatch of versions in the .elf files.)

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 1:51 am
by rasparbarian
I also noticed that if I manully copy the boot partition of the MicroSD card on to the SSD, I get an error during booting that my startxx.elf's are too old to be used, hence I had to go to Github and fetch the files one by one from there to get past that point to where I'm currently stuck in, which is a little bit confusing, since I just installed the rpi-update and the rpi-eeprom-update this very "last" night (Saturday-Sunday) and I thought my boot files were mirrored from the MicroSD card. Something is not adding up here. Everything works fine and without those errors from the MicroSD, though, but when it comes to duplicating all that stuff on to the SSD, it all breaks apart even though the boot process already starts off from the SSD. Perhaps I should screencap the list of events for this to make more sense.

Now, one option could be, that if I could only get a step-by-step explanation on what the script(s) actually do in terms of sources, copying new files and setting attributes in i.e. cmdline.txt and /etc/fstab , as judging from the error(s), the script might be a bit wonky considering the firmware/bootcode files it copies on to the SSD... (I'm about to look further into it.)

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 1:59 am
by RonR
rasparbarian wrote:
Sat May 23, 2020 11:18 pm
This worked fine on the latest Raspbian, EXCEPT -- during the actual boot sector's migration, the device was marked as busy, hence none of the required firmware files were copied on to it. They are intact on the drive, but I've got no clue how to mount the filesystem over the cmdline.txt by hand ... I guess I have to go through the scripts and see what they actually do, and then mimick that action into the cmdline.txt ...

Which script did you run (add-boot or update-boot)? Which device was busy (the SD card or the USB device)?

I don't understand "I've got no clue how to mount the filesystem over the cmdline.txt by hand".
rasparbarian wrote:
Sat May 23, 2020 11:18 pm
I've got so far as to get it to load up and wait for the proper hard drive already! (Before that, I had to download the latest .elf files from https://github.com/raspberrypi/firmware ... aster/boot and replace them on the boot partition or I was stuck in the initial screen due to a mismatch of versions in the .elf files.)

Why are you downloading .elf files from https://github.com? Simply running rpi-update updates everything for you.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:06 am
by RonR
rasparbarian wrote:
Sun May 24, 2020 1:51 am
Something is not adding up here. Everything works fine and without those errors from the MicroSD, though, but when it comes to duplicating all that stuff on to the SSD, it all breaks apart.

Were you already an SSD that was booting via an SD card? If so, you simply needed to follow the instructions in the first post.

If you are using just an SD card and you want to move it to an SSD, you should be using: Running Raspbian from USB Devices : Made Easy

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:14 am
by rasparbarian
RonR wrote:
Sun May 24, 2020 2:06 am
rasparbarian wrote:
Sun May 24, 2020 1:51 am
Something is not adding up here. Everything works fine and without those errors from the MicroSD, though, but when it comes to duplicating all that stuff on to the SSD, it all breaks apart.

Were you already an SSD that was booting via an SD card? If so, you simply needed to follow the instructions in the first post.

If you are using just an SD card and you want to move it to an SSD, you should be using: Running Raspbian from USB Devices : Made Easy
Nope, I had a SD+SSD jump boot setup and I thought the script was meant for that one. Since it's spitting out firmware fails during boot-up (-22 82 and -22 86) with just about every on-board unit, I'm beginning to think if there's some kind of driver/firmware mismatch that does get in between all of this.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:16 am
by rasparbarian
RonR wrote:
Sun May 24, 2020 1:59 am
Why are you downloading .elf files from https://github.com? Simply running rpi-update updates everything for you.
I tried that to no avail and hence manually downloaded the firmware files off of GitHub as a last ditch resort.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:24 am
by RonR
rasparbarian wrote:
Sun May 24, 2020 2:16 am
RonR wrote:
Sun May 24, 2020 1:59 am
Why are you downloading .elf files from https://github.com? Simply running rpi-update updates everything for you.
I tried that to no avail and hence manually downloaded the firmware files off of GitHub as a last ditch resort.

If rpi-update isn't working, you've got other issues and probably shouldn't be trying to use these scripts yet.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:27 am
by rasparbarian
Here's where it hangs as of now. The boot sequence already starts off from the SSD, and then hits a brick wall like that. Regardless of what I change as the variable/identifier for the SSD (/dev/sda, sda1, sda2, UUID, PARTUUID...)

Now, given the fact that it DOES load all the way to that point from the SSD (with no MicroSD card in the slot whatsoever), there's gotta be some kind of a mismatch that takes place and then makes the whole boot-up process go absolutely haywire and become stuck at that point.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:48 am
by RonR
rasparbarian wrote:
Sun May 24, 2020 2:27 am
Now, given the fact that it DOES load all the way to that point from the SSD (with no MicroSD card in the slot whatsoever), there's gotta be some kind of a mismatch that takes place and then makes the whole boot-up process go absolutely haywire and become stuck at that point.

rpi-update also installs matching /lib/modules:

Code: Select all

root@raspberrypi:~# ls -l /lib/modules
total 32
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42+
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42-v7+
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42-v7l+
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42-v8+

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 3:02 am
by rasparbarian
Just a small addition to my previous posts; if I copy the boot partition's contents altogether from the MicroSD card ( /dev/mmcblk0p1 ) onto the SSD's boot partition and they are as they should be, the attached image is what I get, and this can only be circumvented by overwriting the kernel/boot loader files on the SSD's boot partition with the latest file versions from GitHub, in order just to get to the previously mentioned point during the boot process... So, yep, there's definitely some kind of a firmware/driver/who-knows-what mismatch going on.

Now, since the boot process DOES work with the MicroSD card (finally something useful out of it -- a virtual parachute! :D ), I'm wondering if I should attempt to use i.e. rsync -rva to copy some of the key system files and directories from the MicroSD to the SSD -- just to see what the boot sequence would think of that.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 3:13 am
by rasparbarian
RonR wrote:
Sun May 24, 2020 2:48 am
rasparbarian wrote:
Sun May 24, 2020 2:27 am
Now, given the fact that it DOES load all the way to that point from the SSD (with no MicroSD card in the slot whatsoever), there's gotta be some kind of a mismatch that takes place and then makes the whole boot-up process go absolutely haywire and become stuck at that point.

rpi-update also installs matching /lib/modules:

Code: Select all

root@raspberrypi:~# ls -l /lib/modules
total 32
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42+
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42-v7+
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42-v7l+
drwxr-xr-x 3 root root 4096 May 20 20:29 5.4.42-v8+
Thanks for the tip, I tried to rsync the entire lib/ ... Just to end up at the very same spot (a.k.a. the "Waiting for root device..."), after I had once again copied the GitHub versions on top of the ones that were on the SSD's boot partition

I haven't tried out all the variations yet, but if you've got any tips on what exactly I should point the HDD towards, as in will " /dev/sda2 " be sufficient for testing purposes or do I need to give the cmdline.txt a UUID/PARTUUID? During the previous tryout, I did try all possible "root=" variations in the cmdline.txt. Go figure...

Thanks for the help so far! Cheers.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 3:17 am
by rasparbarian
rasparbarian wrote:
Sun May 24, 2020 2:27 am
Here's where it hangs as of now [ = the photo below is as far as I can get with the boot-up process ]. The boot sequence already starts off from the SSD, and then hits a brick wall like that. Regardless of what I change as the variable/identifier for the SSD (/dev/sda, sda1, sda2, UUID, PARTUUID...)

Now, given the fact that it DOES load all the way to that point from the SSD (with no MicroSD card in the slot whatsoever), there's gotta be some kind of a mismatch that takes place and then makes the whole boot-up process go absolutely haywire and become stuck at that point.
EDIT: That was meant to be an edit for the post above; but at least it's now clarified. This is as far as the SSD boot goes; download/file.php?id=37310 - The R/W access light in the MicroSD card slot is permanently lit up even though the SD slot is empty, there seems to be no read/write from or to the SSD.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 3:35 am
by RonR
rasparbarian wrote:
Sun May 24, 2020 3:02 am
if I copy the boot partition's contents altogether from the MicroSD card ( /dev/mmcblk0p1 ) onto the SSD's boot partition and they are as they should be, the attached image is what I get, and this can only be circumvented by overwriting the kernel/boot loader files on the SSD's boot partition with the latest file versions from GitHub, in order just to get to the previously mentioned point during the boot process... So, yep, there's definitely some kind of a firmware/driver/who-knows-what mismatch going on.

It appears the boot files on the SD card are NOT the updated ones (5.4.42), which accounts for the SSD boot failure when you put them on the SSD and you get the "start4x.elf is not compatible' message using the new bootloader. You do NOT need updated boot files on the SD card for the SD card to boot the SSD with the new bootloader (nor for the SD card to boot stand-alone with the new bootloader).

I think all your problems are likely due to not successfully using rpi-update. Assuming you have /dev/mmcblk0p1 mounted on /boot when running from the SSD (booted via the SD card), successfully running rpi-update would have upgraded the /lib/modules directory on the SSD and the /boot partition on the SD card.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 2:52 pm
by Iprouteth0
dickon wrote:
Sat May 23, 2020 12:33 pm
We do. It's beta. For some reason it was announced in the 'General discussion' topic here: viewtopic.php?f=63&t=274595.
Thanks!

Used your script initially to do my USB as root fs. Then used your migrate script for moving booting to the USB. I did get errors indicating ownership attributes could not be applied. Though admittedly, I neglected to power down, remove USB, and boot from SD only. I simply unmounted my sda1 partition. Everything was copied to my USB boot, but with owner and group of pi:pi. Was a bit worried but not terribly so as I'm experienced enough with Linux and usually use Gentoo. Starting over from scratch doesn't worry me.

So I halted the system, removed SD card, and booted up again. Worked fine and file ownership in the USB boot was root:root after rebooting. Just thought I'd mention as it was weird. Only used the usb-update and not add-boot since I used your earlier script for my USB rootfs.

I just used the script for copying the SD boot to the USB boot. Though I could've done it all myself, you had this nice script and I don't see the need to reinvent the wheel so to speak.

Anyway, nice work! No other trouble than those ownership errors, which was probably due to the way I did things, not following your instructions exactly. Still worked without a hitch.


:D

Worked great for me on first try. Using SanDisk ultra 32gb usb3.0 100MB speed.

Code: Select all

pi@raspberrypi:~ $ lsusb
Bus 002 Device 002: ID 0781:5581 SanDisk Corp. Ultra
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code: Select all

pi@raspberrypi:~ $ vcgencmd bootloader_version
May 15 2020 11:05:52
version 23a9f59b85f5a81bb2eec455e064ef9905216322 (release)
timestamp 1589537152

Code: Select all

pi@raspberrypi:~ $ vcgencmd bootloader_config
[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
ENABLE_SELF_UPDATE=1
DISABLE_HDMI=0
SD_BOOT_MAX_RETRIES=1
USB_MSD_BOOT_MAX_RETRIES=1
BOOT_ORDER=0xf41

Code: Select all

pi@raspberrypi:~ $ sudo rpi-eeprom-update
BCM2711 detected
BOOTLOADER: up-to-date
CURRENT: Fri 15 May 2020 10:05:52 AM UTC (1589537152)
 LATEST: Fri 15 May 2020 10:05:52 AM UTC (1589537152)
 FW DIR: /lib/firmware/raspberrypi/bootloader/beta
VL805: up-to-date
CURRENT: 000137ad
 LATEST: 000137ad

Code: Select all

pi@raspberrypi:~ $ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    1 28.7G  0 disk
├─sda1   8:1    1  256M  0 part /boot
└─sda2   8:2    1 28.4G  0 part /

Code: Select all

pi@raspberrypi:~ $ ls -l /boot
total 53876
-rwxr-xr-x 1 root root    25081 May 23 08:27 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root    25344 May 23 08:27 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root    24692 May 23 08:27 bcm2708-rpi-b-rev1.dtb
-rwxr-xr-x 1 root root    24862 May 23 08:27 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root    24786 May 23 08:27 bcm2708-rpi-zero.dtb
-rwxr-xr-x 1 root root    25522 May 23 08:27 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x 1 root root    26347 May 23 08:27 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root    26496 May 23 08:27 bcm2710-rpi-2-b.dtb
-rwxr-xr-x 1 root root    27537 May 23 08:27 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root    28156 May 23 08:27 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root    26351 May 23 08:27 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root    46420 May 23 08:27 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root root    52480 May 23 08:27 bootcode.bin
-rwxr-xr-x 1 root root      166 May 23 09:00 cmdline.txt
-rwxr-xr-x 1 root root     1806 May 23 09:00 config.txt
-rwxr-xr-x 1 root root    18693 Jun 24  2019 COPYING.linux
-rwxr-xr-x 1 root root     3146 May 23 08:27 fixup4cd.dat
-rwxr-xr-x 1 root root     5405 May 23 08:27 fixup4.dat
-rwxr-xr-x 1 root root     8419 May 23 08:27 fixup4db.dat
-rwxr-xr-x 1 root root     8417 May 23 08:27 fixup4x.dat
-rwxr-xr-x 1 root root     3146 May 23 08:27 fixup_cd.dat
-rwxr-xr-x 1 root root     7274 May 23 08:27 fixup.dat
-rwxr-xr-x 1 root root    10265 May 23 08:27 fixup_db.dat
-rwxr-xr-x 1 root root    10265 May 23 08:27 fixup_x.dat
-rwxr-xr-x 1 root root      145 Feb 13 10:31 issue.txt
-rwxr-xr-x 1 root root  5586440 May 23 08:27 kernel7.img
-rwxr-xr-x 1 root root  5984432 May 23 08:27 kernel7l.img
-rwxr-xr-x 1 root root 15481344 May 23 08:27 kernel8.img
-rwxr-xr-x 1 root root  5233808 May 23 08:27 kernel.img
-rwxr-xr-x 1 root root     1594 Jan 17 04:01 LICENCE.broadcom
drwxr-xr-x 2 root root    20480 May 23 08:27 overlays
-rwxr-xr-x 1 root root   816124 May 23 08:27 start4cd.elf
-rwxr-xr-x 1 root root  3774436 May 23 08:27 start4db.elf
-rwxr-xr-x 1 root root  2272832 May 23 08:27 start4.elf
-rwxr-xr-x 1 root root  3031492 May 23 08:27 start4x.elf
-rwxr-xr-x 1 root root   816124 May 23 08:27 start_cd.elf
-rwxr-xr-x 1 root root  4846244 May 23 08:27 start_db.elf
-rwxr-xr-x 1 root root  2996928 May 23 08:27 start.elf
-rwxr-xr-x 1 root root  3755044 May 23 08:27 start_x.elf
pi@raspberrypi:~ $

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 9:21 pm
by rasparbarian
RonR wrote:
Sun May 24, 2020 3:35 am
It appears the boot files on the SD card are NOT the updated ones (5.4.42), which accounts for the SSD boot failure when you put them on the SSD and you get the "start4x.elf is not compatible' message using the new bootloader. You do NOT need updated boot files on the SD card for the SD card to boot the SSD with the new bootloader (nor for the SD card to boot stand-alone with the new bootloader).

I think all your problems are likely due to not successfully using rpi-update. Assuming you have /dev/mmcblk0p1 mounted on /boot when running from the SSD (booted via the SD card), successfully running rpi-update would have upgraded the /lib/modules directory on the SSD and the /boot partition on the SD card.
... The error messages appeared when only the SSD was plugged in to a USB port. There was absolutely no MicroSD card (or anything else, for that matter) plugged in any of the RPI4B's slots, whether the internal reader or a USB port. The microSD card wasn't even inside the RPi4Bi in any of the case examples of a failed boot sequence that I posted.

However, yes, I do think there's just some overlooked mismatch, the boot process seems a bit confusing especially in a hassle like this, if someone could point out what do I need to have inside the boot partition of the SSD for it to actually work, and do I still need to have something special on the ext4fs ( = main partition) side of the drive? After all, the boot sequence off of the SSD does start initially, and I can see it from the adapter's lights, but then it begins to fail as seen in the photo I took and ends up waiting for the system partition to be mounted. ("Waiting for root device ..." as seen here: download/file.php?id=37310 . In other words, the boot process starts up from the SSD but ends up to that point after a bunch of errors occur.)

To clarify;

1. The boot process as well as the Raspbian OS works fine when using the MicroSD card ONLY with the latest firmware and the latest kernel, etc., etc. ( I did, however, try to make sure that this was the case when I was still using the SD+SSD combination.)

2. All of the apt repositories, other packages, rpi-update, rpi-eeprom update are the latest possible versions on the MicroSD card only.

3. However, an SSD-only boot-up hangs the system at the point where it is waiting for the device. Like I said, the boot partition got made without any problems on to the SSD by the install script, however the install script DID give me a "device is busy" error somewhere nearing the end, which I suspect to have hindered the copying of some of the needed files.

4. Would be great to know if I need to do anything else otherwise than to edit " /boot/cmdline.txt " and " /etc/fstab " and make them point to correct & corresponding partitions and so forth.

I think the next step is to just try to " rsync " & overwrite all of the key system directories from the MicroSD to the SSD and making sure the boot order is correct, as in the correct PARTUUID's are pointed at in " /boot/cmdline.txt " and in " /etc/fstab ", since booting from ONLY a MicroSD card now works fine and says there's absolutely no packages, rpi-updates or rpi-eeprom-updates that are out of date. Kernel info etc says the same - it's all the latest there is.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 9:45 pm
by RonR
Iprouteth0 wrote:
Sun May 24, 2020 2:52 pm
Used your script initially to do my USB as root fs. Then used your migrate script for moving booting to the USB. I did get errors indicating ownership attributes could not be applied. Though admittedly, I neglected to power down, remove USB, and boot from SD only. I simply unmounted my sda1 partition. Everything was copied to my USB boot, but with owner and group of pi:pi.
I'm confused. If you used my script (usb-boot) to create your hybrid SD/USB booting system, you should have simply run update-boot, pulled out the SD card, and been done.

add-boot is on'y intended for hybrid SD/USB booting systems that were improperly built without a BOOT partition on the USB device.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Sun May 24, 2020 9:57 pm
by RonR
@rasparbarian,

I don't believe I can offer more help for your situation as I don't believe your issues are related to the scripts posted in this topic.

You need to restore your backups and figure out why you can't get your system updated properly using rpi-update. I would suggest starting a new topic to request help with that issue.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Tue May 26, 2020 11:53 am
by Roken
I figured this out myself, but in addition to the steps you have shown (I had to create the /boot partition on the HD), I had to run sudo sfdisk -r /dev/sda to ensure that the device and PARTUUID represented the first partition.

Without this, the boot failed. After doing it, the boot succeeds.

Re: Migrating Hybrid SD/USB Booting to Direct USB Booting on the Raspberry Pi 4 : Made Easy

Posted: Tue May 26, 2020 5:33 pm
by RonR
Roken wrote:
Tue May 26, 2020 11:53 am
I figured this out myself, but in addition to the steps you have shown (I had to create the /boot partition on the HD), I had to run sudo sfdisk -r /dev/sda to ensure that the device and PARTUUID represented the first partition.

Without this, the boot failed. After doing it, the boot succeeds.

It's already in add-boot (-r and --reorder are the same option):

Code: Select all

sfdisk "${USB_DEST}" --reorder > /dev/null