User avatar
HawaiianPi
Posts: 5255
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:33 am

torak666 wrote:
Tue Oct 29, 2019 8:00 am
I changed the PARTUUID of the rootfs in /boot/cmdline.txt by the PARTUUID of my SSD external drive SDA1.
That's supposed to point to / (the rootfs partition), which is partition 2.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

LTolledo
Posts: 2825
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:48 am

is there any good compelling reason why @torak666 and @RossDv8 cant use the script to automate "usb boot" process provided by RonR?

anything I missed that makes the script "unsuitable"? :o

because I used it on my RPi4B-4G with Raspbian Buster Full Desktop, booting from microSD and having the rootfs on a SP 120GB M.2 SSD 2280 ( SP120GBSS3M55M28) encased in an Eluteng M.2 SSD case equipped with a JMicron chipset.

...or maybe it was too easy that it defeats the "DIY spirit" in some of us..... :mrgreen:
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

bjtheone
Posts: 463
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 11:34 am

The only comment I would make is that I prefer to understand what is going on "under the hood" rather than just running a canned script. This is in no way a put down of Ron's script. However, if you take the time to understand the boot process and how things are mounted it may make it simpler to troubleshoot other issues. Kind of the difference between given fish and learning how to fish. There are times when either one is the best option.

Of course you could look at the well written script, learn how it needs to be setup, and learn some things about bash scripting as well.

torak666
Posts: 57
Joined: Tue Feb 06, 2018 4:58 pm

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 5:29 pm

I follow the exact same process than this video https://www.youtube.com/watch?v=2rglzPdsvYg
and for him it seems that's work.
And yes i replace the label ROOTFS from the boot SD by the ROOTFS of the SSD and not the FATBOOT which stay on SD card.
So SD CARD Copier included in raspbian buster should be the problem.

I made the process 3 time in case of error failed i didn't see in the copy.
Mine version is raspbian buster is 2019-09-26-raspbian-buster-full for my RPi4B-4G.

torak666
Posts: 57
Joined: Tue Feb 06, 2018 4:58 pm

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 7:31 pm

i see on /etc/fstab the PARTUUID of the rootfs isn't the one of my SSD external drive SDA1.
I change it and reboot few times to see a display of 3 Raspberry on black screen with " _" blinding... i wait around 10 min and nothing else happened.
So i go reinstall raspbian with NOOBS on SSD maybe it will works fine

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 8:44 pm

hardwaremack-orginal wrote:
Mon Jul 01, 2019 6:02 pm
thanks HawaiianPi!!
i appreciate your response sir!

considering this is now a mainstream product. not some kickstarter....
The fact that i cannot boot from the new improved usb 3.0 port with my new 200 megs a second (read) samsung fit...Makes me consider this product defective, and want to return it.

I have the 1gig P4 version, it seems MS has the 2gig version, I might return this and get the 2gig anyways... the extra gig will make it more useful to me.

I'm not trying to offend anyone, just stating reality. booting and operating from a SD card is playing with fire.

Charles
Capture.PNG

That's almost crazy. (An observation about the situation - NOT an insult to the member). I held off setting up to run from my SSD for a while, simply because I was already using a fast Samsung EVO Plus 128GB SSD and was being too lazy to change two lines of text.
The difference in performance since I did it though, is considerable. No lagging or freezing when scrolling Chromium pages is one huge difference - but there are others.

Why not try the edits that were suggested in a previous reply, and use your USB C thingy. I seem to recall we did that before the Pi 3B+ had USB boot, and honestly, I don't think there was any great boot speed difference once the USB boot mode was added, (unless it showed in a benchmark).

In real life use I've almost forgotten the Pi is booting the microSD then hanging off to the SSD. It just 'happens' in a moment.
Remember, nobody is listening to you
until you fart ...

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 8:54 pm

torak666 wrote:
Tue Oct 29, 2019 5:29 pm
I follow the exact same process than this video https://www.youtube.com/watch?v=2rglzPdsvYg
and for him it seems that's work.
And yes i replace the label ROOTFS from the boot SD by the ROOTFS of the SSD and not the FATBOOT which stay on SD card.
So SD CARD Copier included in raspbian buster should be the problem.

I made the process 3 time in case of error failed i didn't see in the copy.
Mine version is raspbian buster is 2019-09-26-raspbian-buster-full for my RPi4B-4G.

I tried using a couple of methods that did not seem to work.
There is a very good step by step procedure on the forum, but I used this one. It has pictures showing where some of the things that need to be changed can be found, and is easier to follow than trying to pause a video.

https://www.element14.com/community/com ... n-the-pi-4

NOTE: I forgot to edit /etc/fstab on my SSD so that /boot on the microSD card is mounted. Several people on the forum pointed out good reasons why it MUST be done.
Remember, nobody is listening to you
until you fart ...

User avatar
Roken
Posts: 323
Joined: Sun Dec 31, 2017 4:35 pm
Location: UK

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 8:54 pm

I hadn't even thought about this, and I'm an old hand with Linux (I use it exclusively - Desktop machine is Arch), but I checked my Pi4 (the only one connected directly to an external HD and with /boot on the SD and / on the HD). fstab is setup with mounts for both /boot and /, both pointing to the sdcasrd. However, / is definitely on the HD.

Here's where it gets weird. If I comment out the / mount, I get a bunch of failures. If I allow it, /dev/sdX is mounted to /

Even weirder, my other PIs (all 3B or 3B+) which boot from directories on the HD (via NFS) I have to avoid mounting /

Something in Raspbian is not respecting /etc/fstab properly in all situations.

EDIT: For clarity, the Pi4 has a dedicated root partition on the HD, the others boot from directories on the other partition.

EDIT 2:

For added clarity:

/etc/fstab (I've truncated to just the relevant bits)

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=4105cda2-01  /boot           vfat    defaults          0       2
PARTUUID=4105cda2-02  /               ext4    defaults,noatime  0       1
mount:

Code: Select all

/dev/sda1 on / type ext4 (rw,noatime)
Nothing else from mount pointing to /

blkid

Code: Select all

/dev/sda1: UUID="6f6c04be-1884-43b5-accb-af00445de577" TYPE="ext4" PARTUUID="11e7c9af-01
On a different random Pi

/etc/fstab

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=501c6286-01  /boot           vfat    defaults          0       2
#PARTUUID=501c6286-02  /               ext4    defaults,noatime  0       1
You'll note that / is commented out.

mount:

Code: Select all

192.168.1.188:/mnt/NFS/pi3b on / type nfs (rw,relatime,vers=3,rsize=4096,wsize=4096,namlen=255,hard,nolock,proto=udp,timeo=11,retrans=3,sec=sys,mountaddr=192.168.1.188,mountvers=3,mountproto=udp,local_lock=all,addr=192.168.1.188)
So / there is clearly picked up from /boot/cmdline.txt

EDIT3: I'm not actually claiming a problem, since all my systems work just fine, but simply trying to aid troubleshooting here by identifying something that doesn't make a lot of sense to me.
Last edited by Roken on Tue Oct 29, 2019 9:11 pm, edited 1 time in total.
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:10 pm

is there any good compelling reason why @torak666 and @RossDv8 cant use the script to automate "usb boot" process provided by RonR?

anything I missed that makes the script "unsuitable"? :o
In the case of @RossDv8, He often doesn't read things properly and had not actually noticed that the script was available. When he did find it, when reading the description it seemed that the script waits at a point where you get to choose what you want to boot, SD or USB device. He prefers to skip a 'choice' and just boot straight in. microSD boot does that nicely.
Remember, nobody is listening to you
until you fart ...

User avatar
HawaiianPi
Posts: 5255
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:12 pm

LTolledo wrote:
Tue Oct 29, 2019 9:48 am
...or maybe it was too easy that it defeats the "DIY spirit" in some of us..... :mrgreen:
That's how it is for me. I like to figure stuff out for myself.

However, I'm also lazy, so those two things create a conflict when DIY takes too long. :? :lol:

In the case of the Pi4, I already knew how to do it, due to my earlier experience with Pi computers, so there wasn't much of a learning curve. Early models were "USB booted" with /boot on SD card (pure USB boot, and even bootcode.bin-only SD cards were relatively recent improvements).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:21 pm

torak666 wrote:
Tue Oct 29, 2019 5:29 pm
I follow the exact same process than this video https://www.youtube.com/watch?v=2rglzPdsvYg
and for him it seems that's work.

That YouTube video is incomplete. /etc/fstab on the USB device needs to be altered to mount the SD card's boot partition on /boot.
torak666 wrote:
Tue Oct 29, 2019 5:29 pm
And yes i replace the label ROOTFS from the boot SD by the ROOTFS of the SSD and not the FATBOOT which stay on SD card.
So SD CARD Copier included in raspbian buster should be the problem.

Partition labels do not need to be altered.
torak666 wrote:
Tue Oct 29, 2019 5:29 pm
I made the process 3 time in case of error failed i didn't see in the copy.
Mine version is raspbian buster is 2019-09-26-raspbian-buster-full for my RPi4B-4G.

I just installed 2019-09-26-raspbian-buster-full on an SD card and then manually copied it to a USB drive using SD Card Copier. I then manually modified cmdline.txt and fstab and was able to boot the USB drive.
torak666 wrote:
Tue Oct 29, 2019 7:31 pm
So i go reinstall raspbian with NOOBS on SSD maybe it will works fine

Save yourself a lot of additional grief and simply run usb-boot. It will do everything for you that needs to be done.

User avatar
HawaiianPi
Posts: 5255
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:24 pm

RossDv8 wrote:
Sat Oct 26, 2019 1:30 pm
The one thing I did differently from instructions was that I commented out the default /boot entry with a # and added the new one as a new line.
It is possible that cmndline.txt does not accept lines starting with a # as commented out.
As far as I know, that's not going to work. The cmdline.txt file must be one single line with a single space delimiting commands or parameters. I don't believe comments or anything else is allowed.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:29 pm

I deleted my reply in light of additional conflicting information :-)
Last edited by RossDv8 on Tue Oct 29, 2019 9:34 pm, edited 2 times in total.
Remember, nobody is listening to you
until you fart ...

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 9:31 pm

HawaiianPi wrote:
Tue Oct 29, 2019 9:24 pm
As far as I know, that's not going to work. The cmdline.txt file must be one single line with a single space delimiting commands or parameters. I don't believe comments or anything else is allowed.

There's no problem with multiple lines in cmdline.txt with all but one of them commented out (I've been doing this for years).

Multiple spaces are also not a problem.

Blank lines are not permitted.

User avatar
HawaiianPi
Posts: 5255
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 12:56 am

RonR wrote:
Tue Oct 29, 2019 9:31 pm
There's no problem with multiple lines in cmdline.txt with all but one of them commented out (I've been doing this for years).

Multiple spaces are also not a problem.
Interesting. I remember reading the restrictions I posted above when I was learning about the Pi (admittedly, quite some time ago), but I have not tried anything else in cmdline.txt, so I defer to you.


@RossDv8, torak666,
As far as using the SD Card Copier from desktop versions of Buster to make a boot USB drive, that works fine if you don't mess up file editing.

I just tried it again with the latest image to verify nothing has changed, and it worked as expected.
  • Wrote 2019-09-26-raspbian-buster.zip to a microSD card with Etcher.
  • Booted the card in my Pi 4B4 and completed the startup script (location, WiFi, updates) then rebooted.
  • Shutdown the Pi4, connected a 128GB SATA-III SSD with a USB 3.0 adapter cable and booted the system up again.
  • Used the SD Card Copier utility to copy the SD card (/dev/mmcblk0) to the USB SSD with New Partition UUIDs checked.
  • Edited root=PARTUUID=xxxxxxxx-02 in /boot/cmdline.txt to point to the 2nd partition of the USB SSD.
  • Rebooted the system and verified that the OS was running from the USB SSD.
    • You could opt to edit /etc/fstab to mount the 1st SD card partition as /boot before restarting, but I did not (I'll explain below).
Extra optional steps I normally do (and why):
When you write an image to an SD card and then copy it to a USB drive you essentially have two complete, bootable systems, which makes the /boot partition on the USB drive and the / (rootfs) partition on the SD card redundant (they are not used after setting up SD-USB boot). You should see the redundant partitions mounted on your desktop, which I find a bit annoying (and others might find confusing).

So what I do is either replace the SD card with another single partition FAT32 formatted micro SD card, or reformat the original card I used to a single FAT32 partition, and then copy the contents of the USB drive's /boot partition to the card (that's why I didn't edit fstab earlier).

Once that is done, double-check that cmdline.txt on the SD card points to / on the USB drive and edit /etc/fstab to mount the card as /boot (followed by a reboot).

In order to stop Raspbian from auto-mounting the USB drive's /boot partition and putting it on my desktop I mount it manually. Why don't I just delete it? Because once the USB boot enabled firmware is released we will need it, so I mount it somewhere Raspbian doesn't link to the desktop, but I can still access (/mnt/SSD/boot is what I personally use, you can use whatever you prefer). This will make it simple to convert to full cardless USB boot when the firmware allows it.

If this all sounds too complicated, you should just use RonR's script.

Code: Select all

~ $ cat /sys/firmware/devicetree/base/model;echo
Raspberry Pi 4 Model B Rev 1.1

~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       117G  3.0G  108G   3% /
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G  8.6M  1.9G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1       253M   52M  201M  21% /mnt/SSD/boot
/dev/mmcblk0p1   15G   60M   15G   1% /boot
tmpfs           391M     0  391M   0% /run/user/1000

~ $ cat /etc/fstab
proc                  /proc           proc    defaults          0       0
/dev/mmcblk0p1        /boot           vfat    defaults          0       2
PARTUUID=d02e03a6-01  /mnt/SSD/boot   vfat    defaults          0       2
PARTUUID=d02e03a6-02  /               ext4    defaults          0       1
#
# Edited for hybrid SD+USB boot
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

torak666
Posts: 57
Joined: Tue Feb 06, 2018 4:58 pm

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 5:36 pm

Just tell me what i did wrong on this?

Initial cmdline.txt

Code: Select all

console=tty1 root=PARTUUID=5e3da3da-02 rootfstype=ext4
5e3da3da-02 my SD CARD right?

modified for SSD:

Code: Select all

console=tty1 root=PARTUUID=9ec0e712-02 rootfstype=ext4
9ec0e712-02 my SSD partition ROOT is ok?

Then:
/etc/fstab the PARTUUID of the rootfs = 9ec0e712-02

Then reboot and os should be start right?

For me the Os is not starting, i have only display of the 3 Raspberries

Regards

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 5:49 pm

torak666 wrote:
Wed Oct 30, 2019 5:36 pm
Then reboot and os should be start right?

For me the Os is not starting, i have only display of the 3 Raspberries

What is on the SSD and how did you put it there?

dickon
Posts: 831
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 5:50 pm

If that's the entirety of your cmdline.txt, you should see a lot more than just three(!) raspberries. I'd expect four raspberries, and a few screenfuls of text showing the boot process.

ejolson
Posts: 4476
Joined: Tue Mar 18, 2014 11:47 am

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 5:50 pm

torak666 wrote:
Wed Oct 30, 2019 5:36 pm
For me the Os is not starting, i have only display of the 3 Raspberries
If only three processors are online, you may have hardware problems.

Could you please check whether three or four Raspberries are displaying?

torak666
Posts: 57
Joined: Tue Feb 06, 2018 4:58 pm

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 6:30 pm

hum sorry, since i have modified the file /etc/fstab the boot is not working i start in shell but i cannot modify the /etc/fstab file it is in read only, certainly forced read only because the pi boot with this file. I have no linux on my main computer to modify the file in SD card

i have to reinstall again raspbian buster i will make screenshoot. And my try to install raspbian buster with NOOBS on the SSD fails, the OS doesn't want starting.

dickon
Posts: 831
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 6:48 pm

You should be able to edit cmdline.txt in any random PC text editor, line endings notwithstanding. Add 'init=/bin/bash' to the end of it and boot, and you should end up at a root prompt. If you have 'quiet' in there anywhere, remove it. That should get you a lot of boot log output, which should help identify the problem.

'quiet' is another abomination that shouldn't be anywhere near working operating systems, if you ask me[0]. Fine for the likes of LibreELEC and OpenWRT, but for general use, it hasn't any business being on a commandline, as it hides far, far too much useful information without which debugging issues like this becomes impossible.


[0] You didn't. I appreciate that. Tough.

RonR
Posts: 849
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 7:06 pm

torak666 wrote:
Wed Oct 30, 2019 6:30 pm
i have to reinstall again raspbian buster i will make screenshoot.

After you get Raspbian running on an SD card, simply run usb-boot, selecting copy the SD card to the USB device. When you reboot, you will be up and running on the SSD. No manual configuration necessary.

torak666
Posts: 57
Joined: Tue Feb 06, 2018 4:58 pm

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 7:23 pm

Image
I have to copy PARTUUID = 4ea876e6-02 and replace in /etc/fstab and in cmdline.txt then reboot and that's all no?

The SSD content is copy of rasbian buster by software SD Card Copier, i said that few replies before page 15.

Ok finally it works fine with the script boot.
I see all PARTUUID are the same modification i done my self in fstab and cmdline.

The problem should be on SD CARD Copier or there is an other modification i had not done and the script do this.

I thinks i won't sleep less stupid tonight.

RossDv8
Posts: 244
Joined: Thu Jan 21, 2016 12:35 pm

Re: Raspberry Pi 4 usb boot?

Wed Oct 30, 2019 10:56 pm

It sounds like the updated usb-boot script would have saved me some editing.
And it should prevent the 'I edited stuff but it still won't boot' problems :D
Remember, nobody is listening to you
until you fart ...

LTolledo
Posts: 2825
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 4 usb boot?

Thu Oct 31, 2019 10:17 am

Hey!

Glad you two finally achieved your "interim goal" without further "pain" and "frustrations"... :D

our thanks to RonR for lovingly maintaining and updating the script....

....and of course ..... lets be a little more patient until the procedure for the "ultimate goal" is available....in due time..... ;)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “General discussion”