User avatar
procount
Posts: 2245
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Raspberry Pi 4 usb boot?

Tue Nov 12, 2019 10:07 am

jj_0 wrote:
Tue Nov 12, 2019 9:40 am
Yes, but at the moment Etcher is only installable on the Pi by getting the .deb package directly for @futurejones's github.
Sorry, but I don't see the relevance of that comment.
You don't install Etcher on a RPI in order to install NOOBS (or any other OS) on an SD card in order to boot your RPI for the first time!
You run it on your Windows PC, your Mac, or maybe even your Linux PC (although Linux officianados may just use dd or cp or pkzip)

If you are using Etcher on a RPi, you have already overcome the hurdle of getting your first OS onto an SD card and booting it.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

jj_0
Posts: 113
Joined: Wed Jul 11, 2012 7:07 am

Re: Raspberry Pi 4 usb boot?

Tue Nov 12, 2019 12:17 pm

procount wrote:
Tue Nov 12, 2019 10:07 am
jj_0 wrote:
Tue Nov 12, 2019 9:40 am
Yes, but at the moment Etcher is only installable on the Pi by getting the .deb package directly for @futurejones's github.
Sorry, but I don't see the relevance of that comment.
You don't install Etcher on a RPI in order to install NOOBS (or any other OS) on an SD card in order to boot your RPI for the first time!
You run it on your Windows PC, your Mac, or maybe even your Linux PC (although Linux officianados may just use dd or cp or pkzip)

If you are using Etcher on a RPi, you have already overcome the hurdle of getting your first OS onto an SD card and booting it.
You are right of course, I probably read too much into "now that Etcher is here"...

User avatar
ehem
Posts: 55
Joined: Mon Sep 09, 2019 1:17 am

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 1:05 am

procount wrote:
Tue Nov 12, 2019 8:49 am
I am not advocating adding exFAT as a boot option.
For the heck of it, I think the Raspberry PI should really support booting from UDF filesystems. UDF is an open standard unlike FAT. Every OS other than FreeBSD has support for reading and writing UDF, and UDF has a number of features FAT lacks (proper Unix filenames!).

HawaiianPi wrote:
Mon Jul 01, 2019 10:55 pm
I've been running a Minecraft SMP multiplayer server on a Pi 3B+ from a SanDisk Ultra Plus 64GB micro SD card since 2017, and it's still running fine. The server auto-saves the world every 3 minutes and I run weekly backups and monthly OS upgrades. Lots of writes and no trouble. I had a torrent server running for around a year from a micro SD card as well with no trouble (upgraded to SSD because I needed more room and SSD was cheaper).
My one concern about larger MicroSD cards is they tend to have very large erase sizes. I have a SanDisk Extreme 200GB (I must have gotten overstock since it wasn't that much) and the value for [/sys/block/mmcblk0/queue/] discard_granularity is 24MB. ext4's behavior of keeping files written at the same time together likely allows MicroSD cards to reduce the number of write and erase cycles. Yet that number is so large that I cannot help being concerned about write amplification causing major damage to the lifetime of such a card. For eMMC chips on phones the value is generally no more than 4096 (4KB).

As such I'm pondering changing my plan from using a large MicroSD card to using a USB3 connected SATA/M.2 SSD for main storage. My concern is strictly how long it will last. Anyone care to offer advice?

Sure, needing to use a MicroSD card for the initial boot stages is a downside. Yet I can readily live with that for now.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 5:34 am

Sure, needing to use a MicroSD card for the initial boot stages is a downside. Yet I can readily live with that for now.
Please don't take this as argumentative. It is just a question. What would be the downside of using a microSD card for the initial boot stages? Other than that with a purely SSD or eeprom > SSD boot, the microSD slot could possibly be used as removable storage.

Since setting up microSD boot > SSD operating, the Pi 4 is amazing. Once in a while I will etch something like Manjaro or some other OS to a microSD and just swap cards to have look at what I might like about other systems, but realistically, under normal circumstances (for me personally) I rarely think about the Pi 4 not booting from SSD except when I read a post about it.

That said, there must be a downside or two surely?
Remember, nobody is listening to you
until you fart ...

W. H. Heydt
Posts: 13290
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 6:30 am

RossDv8 wrote:
Sun Nov 24, 2019 5:34 am
That said, there must be a downside or two surely?
Or even just a preference to putting everything on one device and not having to concern oneself with where exactly the *correct* /boot partition is.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 6:39 am

RossDv8 wrote:
Sun Nov 24, 2019 5:34 am
What would be the downside of using a microSD card for the initial boot stages? Other than that with a purely SSD or eeprom > SSD boot, the microSD slot could possibly be used as removable storage.

IMO, using a microSD slot for removable storage is a horrible idea compared to using USB. An available microSD slot is likely to remain unused.
RossDv8 wrote:
Sun Nov 24, 2019 5:34 am
Once in a while I will etch something like Manjaro or some other OS to a microSD and just swap cards to have look at what I might like about other systems, but realistically, under normal circumstances (for me personally)

I almost never remove an SD card. I run multiple environments off of fast/inexpensive USB flash drives. Using only sdc-boot, I can quickly reboot to any of the multiple environments with a single command.

I seriously doubt the initial release of a USB boot capable eeprom will have the flexibility of what I've been using since the Raspberry Pi 1. If I'm wrong, all the better.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 6:48 am

W. H. Heydt wrote:
Sun Nov 24, 2019 6:30 am
RossDv8 wrote:
Sun Nov 24, 2019 5:34 am
That said, there must be a downside or two surely?
Or even just a preference to putting everything on one device and not having to concern oneself with where exactly the *correct* /boot partition is.

When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.

andrum99
Posts: 1264
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 10:45 am

RonR wrote:
Sun Nov 24, 2019 6:48 am
W. H. Heydt wrote:
Sun Nov 24, 2019 6:30 am
RossDv8 wrote:
Sun Nov 24, 2019 5:34 am
That said, there must be a downside or two surely?
Or even just a preference to putting everything on one device and not having to concern oneself with where exactly the *correct* /boot partition is.

When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.
The way I handled figuring out which is the correct boot partition is to just have a single boot partition on my system. The way I did this was to image both the SD card and a hard disk with the Buster image, then delete the root partition from the SD card, and the boot partition from the hard disk.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 7:11 pm

andrum99 wrote:
Sun Nov 24, 2019 10:45 am
RonR wrote:
Sun Nov 24, 2019 6:48 am
W. H. Heydt wrote:
Sun Nov 24, 2019 6:30 am

Or even just a preference to putting everything on one device and not having to concern oneself with where exactly the *correct* /boot partition is.

When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.
The way I handled figuring out which is the correct boot partition is to just have a single boot partition on my system. The way I did this was to image both the SD card and a hard disk with the Buster image, then delete the root partition from the SD card, and the boot partition from the hard disk.

There's *nothing* to figure out and you're making this way more complicated than it needs to be. When booting via an SD card, there's only *one* relevant boot partition - the one on the SD card. The boot partition on the hard disk is never mounted and never accessed, so it's totally irrelevant. Deleting the boot partition from the hard disk and the root partition from the SD card serves no purpose whatsoever but to create totally non-standard Raspbian devices.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 7:17 pm

RonR wrote:
Sun Nov 24, 2019 6:48 am
When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.
The one problem with that approach is that it isn't true in the multiboot environment. The /boot partition also has implications for /lib/modules/ (which will be hosted on your root filesystem, whereever that happens to be), because it contains the kernel.

This why network booting in the way I have described is the One True Way[0] to boot a Pi. Anything else is Wrong[0].


[0] It isn't, of course. At all. It's just a very, very reliable mechanism which solves a lot of problems, and is extremely flexible. I do recommend it -- or I wouldn't do it myself -- but it isn't ideal in all circumstances. Just most of them.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 7:32 pm

dickon wrote:
Sun Nov 24, 2019 7:17 pm
RonR wrote:
Sun Nov 24, 2019 6:48 am
When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.
The one problem with that approach is that it isn't true in the multiboot environment. The /boot partition also has implications for /lib/modules/ (which will be hosted on your root filesystem, whereever that happens to be), because it contains the kernel.

I tend to think in terms of using the one RPF supported OS - Raspbian, for which there's no problem with kernels/modules. I've never proposed trying to boot other OS's via an SD card. It will be interesting to see if the USB boot capable eeprom code supports multiboot environments when it arrives.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 7:43 pm

Unfortunately, you didn't limit your comment to that assertion, so I thought it worth clarifying.

andrum99
Posts: 1264
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 8:56 pm

RonR wrote:
Sun Nov 24, 2019 7:11 pm
andrum99 wrote:
Sun Nov 24, 2019 10:45 am
RonR wrote:
Sun Nov 24, 2019 6:48 am


When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.
The way I handled figuring out which is the correct boot partition is to just have a single boot partition on my system. The way I did this was to image both the SD card and a hard disk with the Buster image, then delete the root partition from the SD card, and the boot partition from the hard disk.

There's *nothing* to figure out and you're making this way more complicated than it needs to be. When booting via an SD card, there's only *one* relevant boot partition - the one on the SD card. The boot partition on the hard disk is never mounted and never accessed, so it's totally irrelevant. Deleting the boot partition from the hard disk and the root partition from the SD card serves no purpose whatsoever but to create totally non-standard Raspbian devices.
Root on hard disk is non-standard anyway on the Pi 4B (at the moment). This way I know for certain that the boot partition I'm looking at is the right one, because there only is one. I find it easier that way, and you're less likely to find your system won't boot because the wrong boot partition has been upgraded.

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

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 9:14 pm

andrum99 wrote:
Sun Nov 24, 2019 8:56 pm
RonR wrote:
Sun Nov 24, 2019 7:11 pm
andrum99 wrote:
Sun Nov 24, 2019 10:45 am

The way I handled figuring out which is the correct boot partition is to just have a single boot partition on my system. The way I did this was to image both the SD card and a hard disk with the Buster image, then delete the root partition from the SD card, and the boot partition from the hard disk.

There's *nothing* to figure out and you're making this way more complicated than it needs to be. When booting via an SD card, there's only *one* relevant boot partition - the one on the SD card. The boot partition on the hard disk is never mounted and never accessed, so it's totally irrelevant. Deleting the boot partition from the hard disk and the root partition from the SD card serves no purpose whatsoever but to create totally non-standard Raspbian devices.
Root on hard disk is non-standard anyway on the Pi 4B (at the moment). This way I know for certain that the boot partition I'm looking at is the right one, because there only is one. I find it easier that way, and you're less likely to find your system won't boot because the wrong boot partition has been upgraded.

How is the Root on the hard disk non-standard on the Pi 4B (at the moment)? It's 100% the same as it would be if you put it on an SD card unless you go to great lengths to make it non-standard.

You can't look at or upgrade the wrong boot partition because the 'wrong' boot partition isn't mounted and therefore isn't accessible. There's no reason the bring the 'wrong' boot partition into the picture.

W. H. Heydt
Posts: 13290
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 11:07 pm

RonR wrote:
Sun Nov 24, 2019 9:14 pm
You can't look at or upgrade the wrong boot partition because the 'wrong' boot partition isn't mounted and therefore isn't accessible. There's no reason the bring the 'wrong' boot partition into the picture.
I won't claim to speak for anyone else, but at present I want there to be a boot partition on the HDD/SSD so that *when* a Pi4B can be booted directly from said HDD/SSD, at most all I have to do is copy the *contents* of the SD card /boot to the HDD/SSD...a process that would require having both of them mounted.

User avatar
thagrol
Posts: 3523
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Raspberry Pi 4 usb boot?

Sun Nov 24, 2019 11:38 pm

RonR wrote:
Sun Nov 24, 2019 7:11 pm
andrum99 wrote:
Sun Nov 24, 2019 10:45 am
RonR wrote:
Sun Nov 24, 2019 6:48 am


When booting via an SD card, the *correct* /boot partition is always located on the SD card. There's nothing to concern oneself with.
The way I handled figuring out which is the correct boot partition is to just have a single boot partition on my system. The way I did this was to image both the SD card and a hard disk with the Buster image, then delete the root partition from the SD card, and the boot partition from the hard disk.

There's *nothing* to figure out and you're making this way more complicated than it needs to be. When booting via an SD card, there's only *one* relevant boot partition - the one on the SD card. The boot partition on the hard disk is never mounted and never accessed, so it's totally irrelevant. Deleting the boot partition from the hard disk and the root partition from the SD card serves no purpose whatsoever but to create totally non-standard Raspbian devices.
So what happens if the boot partition on the SD card and the HDD have the same PARTUUID? Which they will if they've both been created by writing the same OS image to them. As will the root partitions.

Which gets mounted? And is it going to be consistent across boots?
Arguing with strangers on the internet since 1993.

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

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 2:33 am

W. H. Heydt wrote:
Sun Nov 24, 2019 11:07 pm
RonR wrote:
Sun Nov 24, 2019 9:14 pm
You can't look at or upgrade the wrong boot partition because the 'wrong' boot partition isn't mounted and therefore isn't accessible. There's no reason the bring the 'wrong' boot partition into the picture.
I won't claim to speak for anyone else, but at present I want there to be a boot partition on the HDD/SSD so that *when* a Pi4B can be booted directly from said HDD/SSD, at most all I have to do is copy the *contents* of the SD card /boot to the HDD/SSD...a process that would require having both of them mounted.

One of many reasons that it makes no sense to be deleting partitions unnecessarily...but until then, there's no reason to have the boot partition of the HDD/SDD mounted.

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

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 2:47 am

thagrol wrote:
Sun Nov 24, 2019 11:38 pm
So what happens if the boot partition on the SD card and the HDD have the same PARTUUID? Which they will if they've both been created by writing the same OS image to them. As will the root partitions.

Which gets mounted? And is it going to be consistent across boots?

If the PTUUID/PARTUUID of a USB mass storage device is the same as the SD card, the SD card will boot instead of USB device (100% of the time). usb-boot detects this and gives you the opportunity to correct it. sdc-boot also detects this and warns you that the SD card is going to boot instead. They both also warn you of a duplicate PTUUID/PARTUUID condition on multiple USB devices (where the boot order will be inconsistent if not corrected). set-ptuuid can be used to set a device PTUUID/PARTUUID.

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

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 2:52 am

I tend to think in terms of using the one RPF supported OS - Raspbian, for which there's no problem with kernels/modules. I've never proposed trying to boot other OS's via an SD card
I like to have one SSD with all my data but switch between operating systems. I've been doing that for over 20 years and obviously that creates a few problems with Linux, because mixing desktop environments, while using different /root partitions sometimes creates minor havoc. For example one machine with separate XFCE, Kubuntu, LXDE and Gnome root partitions, all with their own programs, sharing a single /home, and often sharing the programs' config files there - all for different environments (and different update levels).

At the moment I'm running Raspbian with a lot of XFCE bits in it. Plus all my weird homebrew stuff.
I suspect though, that RonR's boot system might be able to let me start things the way GRUB does in my bigger machines.
I really must explore it more. But I have a couple of questions before I find time to dig into it.

Is it restricted to USB boot, or can it be used from microSD to boot to /root file systems on various USB devices which share /home stuff on SSD.
Or is that what NOOBS is for.
Or, would it be better used the way I use GRUB, targeting separate /root for each environment, while sharing a common /home
??
Remember, nobody is listening to you
until you fart ...

User avatar
ehem
Posts: 55
Joined: Mon Sep 09, 2019 1:17 am

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 3:15 am

RossDv8 wrote:
Sun Nov 24, 2019 5:34 am
Please don't take this as argumentative. It is just a question. What would be the downside of using a microSD card for the initial boot stages? Other than that with a purely SSD or eeprom > SSD boot, the microSD slot could possibly be used as removable storage.
Fewer bits of hardware to test if something fails. Fewer bits of hardware to keep track of. Fewer bits of hardware which must be purchased. If one has a dead Pi in hand being able to skip checking the MicroSD card could be a distinct reduction in time and therefore frustration. The latter is pretty minor, a nameless not too reliable 16GB MicroSD card can be had for $3 and it will likely serve; if it fails though the former reason become a rather larger issue.

...recalling the days of the 880KB floppy and now gigabytes of data can be handled for less.

W. H. Heydt wrote:
Sun Nov 24, 2019 11:07 pm
RonR wrote:
Sun Nov 24, 2019 9:14 pm
You can't look at or upgrade the wrong boot partition because the 'wrong' boot partition isn't mounted and therefore isn't accessible. There's no reason the bring the 'wrong' boot partition into the picture.
I won't claim to speak for anyone else, but at present I want there to be a boot partition on the HDD/SSD so that *when* a Pi4B can be booted directly from said HDD/SSD, at most all I have to do is copy the *contents* of the SD card /boot to the HDD/SSD...a process that would require having both of them mounted.
This is my thinking as well. I'm a bit unsure as to whether to maintain the boot area on the SSD and then copy everything over to the MicroSD card when changes are made, versus having the SSD boot area blank during the interim before USB booting comes for the RP4.

thagrol wrote:
Sun Nov 24, 2019 11:38 pm
So what happens if the boot partition on the SD card and the HDD have the same PARTUUID? Which they will if they've both been created by writing the same OS image to them. As will the root partitions.
I certainly hope you mean filesystem UUIDs. In order to have the same PARTUUIDs you would either have to copy a GPT or deliberately copy the UUID. The former is sort of sane to do, except I would then imagine you would do a major resizing at which point you really should generate a new UUID while you're at it. The latter is a rather Bad Idea.
thagrol wrote:
Sun Nov 24, 2019 11:38 pm
Which gets mounted? And is it going to be consistent across boots?
This is one of those cases where using the raw block device can be rather saner than using filesystem or GPT UUIDs. /dev/sda3 or /dev/mmcblk0p3 are very unambiguous. If they're kept identical then it actually doesn't matter, otherwise you've got a rather interesting situation.

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

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 4:46 am

ehem wrote:
Mon Nov 25, 2019 3:15 am
I'm a bit unsure as to whether to maintain the boot area on the SSD and then copy everything over to the MicroSD card when changes are made, versus having the SSD boot area blank during the interim before USB booting comes for the RP4.

It doesn't make sense to try and remember to copy the SSD boot partition to the SD card *every* time it's possible a change may have occurred to something in /boot. Doing *one* copy from the SD card to the SSD when there's new eeprom code available that no longer requires the SD card is perfectly reasonable.
ehem wrote:
Mon Nov 25, 2019 3:15 am
I certainly hope you mean filesystem UUIDs. In order to have the same PARTUUIDs you would either have to copy a GPT or deliberately copy the UUID. The former is sort of sane to do, except I would then imagine you would do a major resizing at which point you really should generate a new UUID while you're at it. The latter is a rather Bad Idea.

Raspbian does not use a GPT. Raspbian uses an MBR, which contains the PTUUID. PARTUUID's are the PTUUID plus the partition number (12345678-01, 12345678-02, etc.). As of Buster, all devices (SD cards and USB devices) created end up having the same PTUUID/PARTUUID/UUID that is present in the downloaded Raspbian image file. Resizing (using raspi-config) actually preserves the PTUUID/PARTUUID/UUID. Obviously this can be very problematic. set-ptuuid can be used to correct any conflicts that arise.
ehem wrote:
Mon Nov 25, 2019 3:15 am
This is one of those cases where using the raw block device can be rather saner than using filesystem or GPT UUIDs. /dev/sda3 or /dev/mmcblk0p3 are very unambiguous.

/dev/mmcblk0p3 is certainly unambiguous since there is only one /dev/mmcblk0 device, but /dev/sda3 can't be counted on to be consistent across reboots. Inserting and removing USB devices will change the assignment order as well as varying times that devices take to come ready. Consequently, referencing by PARTUUID (or UUID) is required for consistency across reboots.

User avatar
ehem
Posts: 55
Joined: Mon Sep 09, 2019 1:17 am

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 5:32 am

RonR wrote:
Mon Nov 25, 2019 4:46 am
ehem wrote:
Mon Nov 25, 2019 3:15 am
I certainly hope you mean filesystem UUIDs. In order to have the same PARTUUIDs you would either have to copy a GPT or deliberately copy the UUID. The former is sort of sane to do, except I would then imagine you would do a major resizing at which point you really should generate a new UUID while you're at it. The latter is a rather Bad Idea.

Raspbian does not use a GPT. Raspbian uses an MBR, which contains the PTUUID. PARTUUID's are the PTUUID plus the partition number (12345678-01, 12345678-02, etc.). As of Buster, all devices (SD cards and USB devices) created end up having the same PTUUID/PARTUUID/UUID that is present in the downloaded Raspbian image file. Resizing (using raspi-config) actually preserves the PTUUID/PARTUUID/UUID. Obviously this can be very problematic. set-ptuuid can be used to correct any conflicts that arise.
Oh gawd, folks have been arriving at the same names for different things. :x I was thinking of what GRUB and the Linux kernel command-line think of PARTUUID, which `blkid -p` reports as PART_ENTRY_UUID.

OTOH what you're reporting, Raspbian Buster using the same PTUUID everywhere is very broken. Images should ship with that zero'd out and then use /dev/random some time well after booting to set the value uniquely. There is still the issue that doing exact copies of media will preserve UUIDs, but Raspbian at least shipped with it unset that would be a distinct improvement.

RonR wrote:
Mon Nov 25, 2019 4:46 am
ehem wrote:
Mon Nov 25, 2019 3:15 am
This is one of those cases where using the raw block device can be rather saner than using filesystem or GPT UUIDs. /dev/sda3 or /dev/mmcblk0p3 are very unambiguous.

/dev/mmcblk0p3 is certainly unambiguous since there is only one /dev/mmcblk0 device, but /dev/sda3 can't be counted on to be consistent across reboots. Inserting and removing USB devices will change the assignment order as well as varying times that devices take to come ready. Consequently, referencing by PARTUUID (or UUID) is required for consistency across reboots.
Yes, /dev/sda cannot absolutely be guaranteed to be consistent, but I've generally had good luck. In the case of the Raspberry PI bootloader, in order to be consistent it would need to wait a few seconds before checking USB devices to ensure they come up in a consistent order.

User avatar
thagrol
Posts: 3523
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 9:19 am

ehem wrote:
Mon Nov 25, 2019 3:15 am
thagrol wrote:
Sun Nov 24, 2019 11:38 pm
So what happens if the boot partition on the SD card and the HDD have the same PARTUUID? Which they will if they've both been created by writing the same OS image to them. As will the root partitions.
I certainly hope you mean filesystem UUIDs. In order to have the same PARTUUIDs you would either have to copy a GPT or deliberately copy the UUID. The former is sort of sane to do, except I would then imagine you would do a major resizing at which point you really should generate a new UUID while you're at it. The latter is a rather Bad Idea.
Nope. I mean the partition UUID/PARTUUID. Copying the partition table is exactly what happens when the .img is created, and again when it is written to SD/SSD/HDD.

You thought etcher/dd/win32imager did more than write the raw data to the storage device? That the partition table isn't in the .img?

As RonR pointed out, the SD card will always boot first (possible not if you've been playing around with the more esoteric parts of the otp config bits) but which of the two partitions with the same ID will the kernel mount?

IIRC, fstab and cmdline.txt were changed to use PARTUUID rather than device node shortly after the 3B launched. The intent was to make it easier for inexperienced users to boot from USB. Just write the image rather than write the image then edit cmdline.txt and fstab.

Not an ideal approach but not really that much of a problem in the wild until the launch of the 4B without USB support in the boot loader.
Arguing with strangers on the internet since 1993.

User avatar
thagrol
Posts: 3523
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 9:22 am

RonR wrote:
Mon Nov 25, 2019 4:46 am
As of Buster, all devices (SD cards and USB devices) created end up having the same PTUUID/PARTUUID/UUID that is present in the downloaded Raspbian image file.
It's been going on longer than that. Since shortly after the 3B launched.

Edit: Or rather it's always been that way since raspbian has been distributed by .img file. It's mostly been a noticable issue since the 4B launch.
Arguing with strangers on the internet since 1993.

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

Re: Raspberry Pi 4 usb boot?

Mon Nov 25, 2019 9:33 am

thagrol wrote:
Mon Nov 25, 2019 9:22 am
RonR wrote:
Mon Nov 25, 2019 4:46 am
As of Buster, all devices (SD cards and USB devices) created end up having the same PTUUID/PARTUUID/UUID that is present in the downloaded Raspbian image file.
It's been going on longer than that. Since shortly after the 3B launched.

Edit: Or rather it's always been that way since raspbian has been distributed by .img file. It's mostly been a noticable issue since the 4B launch.

Prior to Buster, the act of auto-expanding on the first boot was what changed the PTUUID. Starting with Buster, this no longer occurs. I confirmed this prior to reporting the problem to the engineers who acknowledged the change in Buster.

Return to “General discussion”