Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:05 pm

RossDv8 wrote:
Sat Oct 26, 2019 12:37 pm
So why should fstab be changed to show a reference to /boot on the microSD, rather than the default of /boot on the SSD?
Obvious why. Because if the real boot partition is not mounted under /boot, the boot files, firmware, EEPROM and the kernel will never be upgraded.
Last edited by Kendek on Sat Oct 26, 2019 1:14 pm, edited 1 time in total.

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

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:08 pm

RossDv8 wrote:
Sat Oct 26, 2019 12:37 pm
Don't move /boot to the SSD until it's being used to boot the system. While it's booting from the (small) SDCard you need to have that partition mounted at /boot or it WILL break when the raspberrypi-kernel and raspberrypi-bootloader packages get an update.
Question to DougieLawson or perhaps jamesh

I'm curious. When the SSD is imaged, fstab points to /boot and /root as BOTH being on the SSD.
I read the post that said to edit fstab, as well as your reply above, to mean that fstab should be changed as I showed in my post.
But when I had changed it, reboot no longer worked.
What actually happened: the reboot command didn't actually reboot the machine, or that the machine wouldn't boot after you'd made the change? I assume the former, in that 'reboot' itself is failing.
So why should fstab be changed to show a reference to /boot on the microSD, rather than the default of /boot on the SSD?
From wat I could make out, leaving fstab showiing /boot on the SSD when the initial boot is done from the microSD can screw up kernel upgrades, firmware etc.
That is correct.
But if it 'should' be changed - why does that change kill reboot?
My guess is that something is going wrong with the unmounting procedure in the shutdown sequence somewhere. There's likely an error message being printed somewhere -- check the logs, or watch it from the console rather than X -- but you may not be seeing it.

I'd also remove the 'noatime' clause. atimes are useful, and the removal of them when on a proper SSD is unnecessary.

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

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:30 pm

Thanks dickon. I
checked and double checked each step as I did it, and I've just finished reading every post I can to check again. The SD card is relatively new, everything was working fine until I modified fstab, and as I saved the steps for future reference, the uuids shown in my post are all as they should be.

But as soon as fstab was changed and I tried to reboot - well, that was the last successful reboot. Until I changed fstab it all worked perfectly - except as you and others write, kernel and firmware stuff will not update if I leave it as default.

I am about to edit fstab again to point /boot to the microSD card again. And while I am at it I'll remove noatime.

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.

Back to the drawing board...
Remember, nobody is listening to you
until you fart ...

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

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:33 pm

Ah. No, I don't believe cmdline.txt should be anything other than the actual line you want as the kernel commandline (as seen (amended by the bootloader) in /proc).

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

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:35 pm

Oh, if you make the change and it doesn't reboot cleanly, reboot it anyway, and try and reboot it from there. It will probably work. I expect the issue is something like the reboot scripts being unable to umount your SD card's /boot from /boot as it isn't mounted there. A second boot will have the SD's /boot mounted as /boot, and thus a reboot will be able to umount it and it all should work.

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:55 pm

The kernel7l.img (or kernel8.img) in /boot has to match the stuff in /lib/modules/4.19.xx-v7l+ or /lib/modules/4.19.xx.v8+ if you get those things out of step your Raspberry won't boot (or if is does boot lots of things will be crippled).

Until your SSD is the boot and rootfs device you must ensure /boot in /etc/fstab points to the partition on your SDCard.

With this output from a blkid command

Code: Select all

/dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="CD28-6C97" TYPE="vfat" PARTUUID="1ed7e7e8-01"
/dev/mmcblk0p2: UUID="f6a555de-3a70-4f54-aa59-a39a6b8426bb" TYPE="ext2" PARTUUID="1ed7e7e8-02"
/dev/sda1: LABEL="oldroot" UUID="037616fd-28fe-4652-8248-2042ea30b929" TYPE="ext4" PARTUUID="225f1efd-01"
/dev/sda2: LABEL="newroot" UUID="f6a555de-3a70-4f54-aa59-a39a6b8426bb" TYPE="ext2" PARTUUID="225f1efd-02"
/dev/mmcblk0: PTUUID="1ed7e7e8" PTTYPE="dos"
Like this:
/boot/cmdline.txt

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=225f1efd-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
/etc/fstab

Code: Select all

PARTUUID=1ed7e7e8-01 /boot vfat defaults 0 2
PARTUUID=225f1efd-02 / ext4 defaults,noatime 0 1
Last edited by DougieLawson on Sat Oct 26, 2019 1:59 pm, edited 1 time in total.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 1:57 pm

Thanks dickon. I had been trying reboot from the command line and also from the GUI. Neither would work. So after making sure I had the fstab edited to point /boot to the microSD, I tried an old trick I used to use on big computers before I retired. I started unplugging stuff.

Specifically, I shutdown, unplugged the SSD and tried booting. I got 4 strawberries and no sign of anything further. So that was expected behaviour because it should have been looking for a non existent SSD.

Then I powered off and replaced the microSD with a bootable Buster with the works. It booted fine.
Next I swapped the microSD card for the small one I use to boot the Pi to the SSD and checked again. 4 Raspberries and black.
Powered off, plugged in the SSD and tried again. Booted.

Tried a command line reboot and it worked. I forgot to try a GUI reboot because I mostly use command line, but at the moment I'm relatively happy again - although I cannot find any logical reason reboot failed. Redoing the fstab I copied exactly what I had previously and pasted it.

I can't blame the Pi, and I'dstill love to work out just what the problem was. Anyway, thanks to the people who weighed in and advised me where to look. I have the SSD running again and the difference over even a really good microSD is amazing.
Remember, nobody is listening to you
until you fart ...

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

Re: Raspberry Pi 4 usb boot?

Sat Oct 26, 2019 2:03 pm

My /boot/cmdline.txt is identical on the microSD and the SSD.
Is that a problem? Or can it create issues. I don;t know how it happened, but they both have the correct partition info to boot to the SSD. Probably the result of someone with brain injuries editing stuff :-)

In the meantime, I think I found the cause of the reboot problem. My SSD is usually plugged into a non-powered USB 3 hub because I was running on a large microSD card and just accessing the SSD as storage.

Initially I left the SSD plugged into the hub. Earlier today I had a problem running a 3TB USB drive and the SSD in the hub at the same time, so I pulled the hub, plugged the SSD into the port the hub had been in hoping it would still think it was SDA (it did). It was some time after this that I discovered I should have edited fstab, and when I tried to reboot, well, that's a few posts before this one.

About 10 minutes ago the system stopped rebooting again. So I tried replacing the hub and plugging the SSD back into it. Several reboots later and so far so good. I'll edit this tomorrow to advise whether is is continuing to play nice..
Remember, nobody is listening to you
until you fart ...

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

Re: Raspberry Pi 4 usb boot?

Sun Oct 27, 2019 12:00 am

Ok, the promised followup to the problem booting after setting up the SSD then editing fstab to point to /boot on the microSD card!

It is the following day, and the reboot problem is gone as long as I have the SSD plugged into the non-powered USB 3 hub.
However, if I take the USB 3 hub OUT of the USB port on the Pi and plug the SSD directly into it - I cannot reboot, either via command line or GUI.
I have tried this quite a number of times and the result is always the same.
But before modifying fstab, when /boot defaulted to the boot partition on the SSD, reboot was fine.
And if I return fstab to default and plug the SSD directly into the USB 3 port on the Pi - reboot is fine.
It is only when I have fstab edited so /boot points to /boot on the microSD that reboot fails.

Last night I tried another microSD card - with the same result (I am getting so tired of changing UUIDs) before going back to the one I had, so it is probably not a faulty card.

Anyway, for what it is worth, that;s my experience, just in case someone else experiences the same problem. It is NOT a fault with my Pi 4. I suspect that had I not had the SSD plugged into a USB 3 hub when I first set stuff up, 'maybe' I would not have the problem, but I cannot see logically how it would be different. SDA should be SDA after all, whether the drive is in the hub or directly into the port, once it is identified as such.

I apologise for the long posts, but as usual I try to give details of my stuff ups - not just a vague 'don't buy a Pi - they're rubbish'.
The Pi 4 running on the SSD is so much smoother and faster than it was running on the microSD card, that I'm kicking myself for procrastinating about setting it up :D
Remember, nobody is listening to you
until you fart ...

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

Re: Raspberry Pi 4 usb boot?

Tue Oct 29, 2019 8:00 am

Hi, i used on rapsbian buster included for the Pi4 the SD CARD software in accessorie menu, to copy boot to SSD.

I changed the PARTUUID of the rootfs in /boot/cmdline.txt by the PARTUUID of my SSD external drive SDA1.

After trying to reboot, i have this error.
Image

I don't understand what i forget to do. Or if it's my SSD drive which is not compatible for boot? i use a samsung SSD 860 evo plus 500Go wired on one USB3.0 input on the PI.
I will try tonight to check in /etc/fstab the PARTUUID is the one of the SSD.

Or i will try another solution reinstall raspbian buster from NOOBS directly on the SSD.

Thanks for any help
Regards

User avatar
HawaiianPi
Posts: 4880
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: 2158
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: 397
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: 8
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: 8
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: 243
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: 243
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: 309
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: 243
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: 4880
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: 643
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: 4880
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: 243
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: 643
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: 4880
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?

Return to “General discussion”