Is it simply a matter of leaving /boot on the SD card and changing /
to being a USB drive or does one need to edit something in /boot
somewhere?
Chris Green <cl@isbd.net> wrote:
Is it simply a matter of leaving /boot on the SD card and changing /
to being a USB drive or does one need to edit something in /boot
somewhere?
That would work, but I think there is an even simpler way:
Put only "bootcode.bin" on a FAT partition on the SD and a complete OS
image on the USB drive.
When you see "/boot/bootcode.bin" on your USB drive being updated,
update the other one too. A script for that should not need dark magic,
but it still is on my to do list.
I'm sure this is basically easy but I can't find a simple description
of how to do it. If you search for anything about 'boot' and 'USB'
you are immediately flooded with descriptions of how to boot from USB
and that's not what I want.
I have an ancient Pi B+ that does all I need where it is but I'd like
to be less reliant on the SD card. You can't (easily) boot such an
old Pi from USB and I don't really need to, I just want to make it so
that once booted all activity is on a USB drive.
Is it simply a matter of leaving /boot on the SD card and changing /
to being a USB drive or does one need to edit something in /boot somewhere?
A script to update the bootcode.bin on the FAT drive should be pretty
simple, just put it in /etc/rc.local and it will be run every time you
boot. It won't matter running it if /boot/bootcode.bin hasn't been
updated, though I suppose you might complain that it's writing to the
SD card unnecessarily. OK, use rsync and the file will only be
written if it has changed.
Is it simply a matter of leaving /boot on the SD card and changing /
to being a USB drive or does one need to edit something in /boot
somewhere?
On 23/01/2025 22:12, Chris Green wrote:
Is it simply a matter of leaving /boot on the SD card and changing /
to being a USB drive or does one need to edit something in /boot
somewhere?
AFAICR what you do is simply edit a file and tell it that / is not where
it thinks it is
But it depends on exactly what you want to happen
The boot process is as follows (I think: Others will correct If I've got
it wrong)
The Pi firmware looks on the SD card for a Vfat partition, and in there
is a file called cmdline.txt
e.g.
console=serial0,115200 console=tty1 root=PARTUUID=778a9e44-02 rootfstype=ext4 fs
ck.repair=yes rootwait noswap=1
That file tells the boot loader wher the root directory is to be found
that it is to grab the kernel off
The Natural Philosopher <tnp@invalid.invalid> wrote:
On 23/01/2025 22:12, Chris Green wrote:
Is it simply a matter of leaving /boot on the SD card and changing /
to being a USB drive or does one need to edit something in /boot
somewhere?
AFAICR what you do is simply edit a file and tell it that / is not where
it thinks it is
But it depends on exactly what you want to happen
The boot process is as follows (I think: Others will correct If I've got
it wrong)
The Pi firmware looks on the SD card for a Vfat partition, and in there
is a file called cmdline.txt
e.g.
console=serial0,115200 console=tty1 root=PARTUUID=778a9e44-02
rootfstype=ext4 fs
ck.repair=yes rootwait noswap=1
That file tells the boot loader wher the root directory is to be found
that it is to grab the kernel off
Not quite. If you do it this way, the kernel comes from the SD card and the cmdline is the *kernel* command line, ie it tells that kernel where to find its root FS once it has started. That means you need to ensure that the kernel on the SD card remains updated, because any kernel on USB storage
will be ignored.
If you did that way, you could set it up with just a FAT /boot partition on the SD and then your ext4 rootfs on USB, and adjust the cmdline and /etc/fstab to match. That way any updates would deploy the SD card /boot.
However if you ever want to re-image your rootfs you have to remember that you also need to re-image your SD and set up this arrangement again. Otherwise you'd be booting old kernels from SD with your new USB rootfs.
By using bootcode.bin only on SD (something I've not tried), you can use standard OS images on your USB without any changes.
Or you could boot direct from USB on those Pis that support it with no SD.
Chris Green <cl@isbd.net> wrote:
A script to update the bootcode.bin on the FAT drive should be pretty simple, just put it in /etc/rc.local and it will be run every time you boot. It won't matter running it if /boot/bootcode.bin hasn't been updated, though I suppose you might complain that it's writing to the
SD card unnecessarily. OK, use rsync and the file will only be
written if it has changed.
I'd probably want to do that after any package updates, because there's a risk that the firmware files on the SD and USB become out of sync and that could cause a boot failure.
If you ran it on a cron job say once a day using rsync, it would reduce the chances of that happening. Or there may be a hook you can set to run it after apt upgrade.
But frankly its almost always easier to install everything on the USB
drive and remove the SDcard altogether.
The Natural Philosopher <tnp@invalid.invalid> wrote:
As I understand it that's not possible with Pi before Pi 2 version 1.2
But frankly its almost always easier to install everything on the USB
drive and remove the SDcard altogether.
or something like that. Basically Pi 3 and onwards can simply boot
from USB, earlier ones can't.
On 24/01/2025 12:55, Chris Green wrote:
The Natural Philosopher <tnp@invalid.invalid> wrote:
As I understand it that's not possible with Pi before Pi 2 version 1.2
But frankly its almost always easier to install everything on the USB
drive and remove the SDcard altogether.
or something like that. Basically Pi 3 and onwards can simply boot
from USB, earlier ones can't.
Yes, that is my understanding also. I think there was a time when you
had to boot from SD and run a comm,and to change a flag in the firmware
to allow USB only boot.
I have a Pi 4B and its supremely ecstatic booting from USB. And it's a totally simple setup
The Natural Philosopher <tnp@invalid.invalid> wrote:
On 24/01/2025 12:55, Chris Green wrote:Yes, but my original question was (intended anyway) about booting an
The Natural Philosopher <tnp@invalid.invalid> wrote:
As I understand it that's not possible with Pi before Pi 2 version 1.2
But frankly its almost always easier to install everything on the USB
drive and remove the SDcard altogether.
or something like that. Basically Pi 3 and onwards can simply boot
from USB, earlier ones can't.
Yes, that is my understanding also. I think there was a time when you
had to boot from SD and run a comm,and to change a flag in the firmware
to allow USB only boot.
I have a Pi 4B and its supremely ecstatic booting from USB. And it's a
totally simple setup
early Pi such that it actually runs from USB after booting from the SD
card so that SD card wear isn't an issue.
Maybe this is useful
https://aroundmyroom.com/2018/07/28/update-boot-from-usb-with-hp-microserver- gen8-and-openmediavault/
and gives you hints
I own some HP Gen8 Microservers where you cannot boot (depends on how you want
to use the HDD's) from the ODD port, but you can use it to have a disk connected to it for further use
So the trick is to boot from your SD and than tell Grub that it has to use that
device for the rest
so the USB disk (in my instance) was only getting start and than go further to
the SATA
But it should not matter if that is SD or USB whatever..
If you start chatgpt.com ..
and ask a question like
how to start from an SD card (initial boot) on a raspberry pi and than the rest
through grub starting to the USB ?
you get also an answer you might be able to use
On 23/01/2025 17:42, Dennis Slagers wrote:
This is completely inappropriate for a Raspberry Pi, which does not
boot like a PC using grub.
Hello druck!
24 Jan 25 21:38, you wrote to me:
dr> On 23/01/2025 17:42, Dennis Slagers wrote:
dr> This is completely inappropriate for a Raspberry Pi, which does not
dr> boot like a PC using grub.
oeps.. my bad ..
So the maybe is: do not try this ..
Thanks for correcting me.
I have a Pi 4B and its supremely ecstatic booting from USB.
If you only adjust that line, you will
still have the fstab on the USB drive mounting the SD boot partition in /boot/firmware. So the kernel will get updated OK automagically.
I suppose you could use inotify but I've never really got
on very well with that.
Yup Arm/broadcomm based Pis 'do it their way'
It goes back to the chips inception as a set top box embedded processpor
On Fri, 24 Jan 2025 12:52:51 +0000, Chris Green wrote:
I suppose you could use inotify but I've never really got
on very well with that.
Was there some standard command-line tool for that?
On Mon, 27 Jan 2025 14:04:07 +0000, The Natural Philosopher wrote:
Yup Arm/broadcomm based Pis 'do it their way'
It goes back to the chips inception as a set top box embedded processpor
Also remember that GRUB depends on BIOS or UEFI, and the former is x86- specific -- not sure about the latter.
Basically, every vendor’s ARM chipset came up with its own way of booting. In the absence of a BIOS-style interface for querying what hardware is available, the Linux kernel is built with a “device tree” structure that hard-codes this information for your specific chipset.
There is now an equivalent spec standardized for the ARM world (adaptation of UEFI??), but I understand this is only in use on servers with AArch64, and the Raspberry Pi predates it anyway.
This is completely inappropriate for a Raspberry Pi, which does not
boot like a PC using grub.
oeps.. my bad ..
So the maybe is: do not try this ..
Thanks for correcting me.
of the USB drive. (Theoretically, I haven't booted my Pi's in quite
some time.. rapidly losing interest in running a BBS) ..
Actually I did read somewhere that it is possible.
* Replying to a msg in PERSONAL.MAIL (PERSONAL.MAIL)
Hello Dave!
26 Feb 25 17:45, you wrote to me:
DV> of the USB drive. (Theoretically, I haven't booted my Pi's in quite
DV> some time.. rapidly losing interest in running a BBS) ..
I've 1 Pi running will never be rebooted unless there is a power outtage. That
device is getting through USB my weatherstation data which is than processed by
Weewx and has an FTP session to my website to show me the data ;)
Dennis
... Works fine on my machine.--
This is completely inappropriate for a Raspberry Pi, which does not
ot
> dr> boot like a PC using grub.
> oeps.. my bad ..
> So the maybe is: do not try this ..
> Thanks for correcting me.
Actually I did read somewhere that it is possible. Technically you only need to use the SD card to boot to init, so modify your /etc/fstab to change the location of your root partition to the device of the USB drive. (Theoretically, I haven't booted my Pi's in quite some time.. rapidly losing interest in running a BBS) ..
Actually I did read somewhere that it is possible. Technically you only need to use the SD card to boot to init, so modify your /etc/fstab to change the location of your root partition to the device of the USB drive. (Theoretically, I haven't booted my Pi's in quite some time.. rapidly losing interest in running a BBS) ..
I've 1 Pi running will never be rebooted unless there is a power outtage. That
device is getting through USB my weatherstation data which is than processed by
Weewx and has an FTP session to my website to show me the data ;)
On 26/02/2025 04:45, Dave Vandermeer wrote:
Actually I did read somewhere that it is possible. Technically you
only need
to use the SD card to boot to init, so modify your /etc/fstab to
change the
location of your root partition to the device of the USB drive.
(Theoretically, I haven't booted my Pi's in quite some time.. rapidly
losing
interest in running a BBS) ..
The root filing system is determined by what is in cmdline.txt of the
sdcard (or the FAT like filing system on the first device it finds).
What is in /etc/fstab wont change the root filing system in use.
---druck--
Actually I did read somewhere that it is possible. Technically you
only need to use the SD card to boot to init, so modify your
/etc/fstab to change the location of your root partition to the
device of the USB drive.
Actually I did read somewhere that it is possible. Technically you only need to use the SD card to boot to init, so modify your /etc/fstab to change the location of your root partition to the device of the USB drive. (Theoretically, I haven't booted my Pi's in quite some time.. rapidly losing interest in running a BBS) ..
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,015 |
Nodes: | 10 (0 / 10) |
Uptime: | 68:22:27 |
Calls: | 13,252 |
Files: | 186,574 |
D/L today: |
802 files (238M bytes) |
Messages: | 3,335,421 |