• How to boot from SD but run from USB?

    From Chris Green@cl@isbd.net to comp.sys.raspberry-pi on Thu Jan 23 22:12:39 2025
    From Newsgroup: comp.sys.raspberry-pi

    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?
    --
    Chris Green
    ·
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From yeti@yeti@tilde.institute to comp.sys.raspberry-pi on Thu Jan 23 23:49:37 2025
    From Newsgroup: comp.sys.raspberry-pi

    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 do not bite, I just want to play.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris Green@cl@isbd.net to comp.sys.raspberry-pi on Thu Jan 23 23:32:50 2025
    From Newsgroup: comp.sys.raspberry-pi

    yeti <yeti@tilde.institute> wrote:
    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 know it had to be pretty simple! :-) I have some other old Pi
    systems lying around here so I can try it on them. The Pi that I
    actually want to do this on is in France and I won't be there for a
    couple of weeks.

    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.
    --
    Chris Green
    ·
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From nospam.Dennis.Slagers@nospam.Dennis.Slagers@f2060.n280.z2.fidonet.org (Dennis Slagers) to Chris Green on Fri Jan 24 06:42:26 2025
    From Newsgroup: comp.sys.raspberry-pi


    Hello Chris!

    23 Jan 25 22:12, you wrote to all:

    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


    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?


    Dennis


    ... The network runs on duct tape and dreams.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Theo@theom+news@chiark.greenend.org.uk to comp.sys.raspberry-pi on Fri Jan 24 09:10:19 2025
    From Newsgroup: comp.sys.raspberry-pi

    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.

    Theo
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Fri Jan 24 09:22:13 2025
    From Newsgroup: comp.sys.raspberry-pi

    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 key thing is root=PARTUUID=

    Now if the SD card does not have such a partition, the boot loader will
    look to see if e.g. a USB drive has, and use that instead.

    Now on whatever partition it uses as the first stage root, it will have /etc/fstab
    e.g.

    proc /proc proc defaults 0 0 PARTUUID=778a9e44-01 /boot/firmware vfat defaults 0 2 PARTUUID=778a9e44-02 / ext4 defaults,noatime 0 1

    And at this point the booting system may, if you want, mount an entirely different root filesystem and carry on.

    So if you edit the /etc/fstab on the SD card, and change the PARTUUID to
    a different drive, it will mount that instead. And never touch the SD
    card afterwards.

    The easy way to do that is to boot the thing as normal, edit the fstab
    file to match the ID of the USB device and reboot, making sure that
    yiou have copied everything on te root partition of the SD card to the USB.

    But frankly its almost always easier to install everything on the USB
    drive and remove the SDcard altogether.
    --
    There is something fascinating about science. One gets such wholesale
    returns of conjecture out of such a trifling investment of fact.

    Mark Twain

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Theo@theom+news@chiark.greenend.org.uk to comp.sys.raspberry-pi on Fri Jan 24 09:37:54 2025
    From Newsgroup: comp.sys.raspberry-pi

    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.

    Theo
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Fri Jan 24 11:44:19 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 24/01/2025 09:37, Theo wrote:
    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.

    Oh yes, you are right there. 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.

    It is however needlessly messy which is why I went all USB/SSD and
    ditched the SDcard.



    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.

    Yes. Exactly.
    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.


    Ultimately, that is IMHO the better approach. As long as the Pi can
    recognise and boot from USB, leave the SD card out altogether.,

    IIRC the most successful approach was in the end, for me, to simply
    install raspios on the USB drive and forget the SD card altogether.

    Later Pis are perfectly happy to try the SD card like an old PC trying a floppy drive, to boot, but on failure simply look at the USB drives.

    And the fact that the boot process uses PARTUUID rather then physical
    devices means its agnostic between SDCARD and USBdrive.

    The only change I made somewhere was to stop the Pi endlessly trying to
    access the SDcard that was no longer there.

    in /boot/firmware/config.txt

    #since we are booting from SSD
    # disable constant SD scan
    # We wouldn't be here on an SD card boot

    dtparam=sd_poll_once

    I really do advise people not to try and split between SDcard and USB.
    Just install the OS on the USB to start with.

    It works with later pis automatically
    --
    "Anyone who believes that the laws of physics are mere social
    conventions is invited to try transgressing those conventions from the
    windows of my apartment. (I live on the twenty-first floor.) "

    Alan Sokal

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris Green@cl@isbd.net to comp.sys.raspberry-pi on Fri Jan 24 12:52:51 2025
    From Newsgroup: comp.sys.raspberry-pi

    Theo <theom+news@chiark.greenend.org.uk> wrote:
    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.

    Yes, agreed. I suppose you could use inotify but I've never really
    got on very well with that.
    --
    Chris Green
    ·
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris Green@cl@isbd.net to comp.sys.raspberry-pi on Fri Jan 24 12:55:09 2025
    From Newsgroup: comp.sys.raspberry-pi

    The Natural Philosopher <tnp@invalid.invalid> wrote:

    But frankly its almost always easier to install everything on the USB
    drive and remove the SDcard altogether.

    As I understand it that's not possible with Pi before Pi 2 version 1.2
    or something like that. Basically Pi 3 and onwards can simply boot
    from USB, earlier ones can't.
    --
    Chris Green
    ·
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Fri Jan 24 13:16:36 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 24/01/2025 12:55, Chris Green wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:

    But frankly its almost always easier to install everything on the USB
    drive and remove the SDcard altogether.

    As I understand it that's not possible with Pi before Pi 2 version 1.2
    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
    --
    “Progress is precisely that which rules and regulations did not foresee,”

    – Ludwig von Mises

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris Green@cl@isbd.net to comp.sys.raspberry-pi on Fri Jan 24 13:43:07 2025
    From Newsgroup: comp.sys.raspberry-pi

    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 24/01/2025 12:55, Chris Green wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:

    But frankly its almost always easier to install everything on the USB
    drive and remove the SDcard altogether.

    As I understand it that's not possible with Pi before Pi 2 version 1.2
    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

    Yes, but my original question was (intended anyway) about booting an
    early Pi such that it actually runs from USB after booting from the SD
    card so that SD card wear isn't an issue.
    --
    Chris Green
    ·
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Fri Jan 24 14:11:11 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 24/01/2025 13:43, Chris Green wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    On 24/01/2025 12:55, Chris Green wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:

    But frankly its almost always easier to install everything on the USB
    drive and remove the SDcard altogether.

    As I understand it that's not possible with Pi before Pi 2 version 1.2
    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

    Yes, but my original question was (intended anyway) about booting an
    early Pi such that it actually runs from USB after booting from the SD
    card so that SD card wear isn't an issue.

    Well I think that has been covered adequately as well.

    Hack the boot partition on the SD card to tell it to use the USB for
    booting and hack the fstab entry to tell it to remount the USB as root
    after booting. Or a combination thereof

    The SD card VFAT partition will remain mounted on /boot/firmware and so
    can be upgraded automagically

    If it has bootcode.bin it should look at the USB to boot from.

    Which works with middle aged pis.

    Late models I believe don't need bootcode.bin. Very early models cant
    boot USB.
    There you have no option but to boot onto the SDcard and edit the
    SDCARD /etc/fstab to remount the USB drive as root.
    --
    Climate Change: Socialism wearing a lab coat.

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From druck@news@druck.org.uk to comp.sys.raspberry-pi on Fri Jan 24 21:38:10 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 23/01/2025 17:42, Dennis Slagers wrote:
    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..

    This is completely inappropriate for a Raspberry Pi, which does not boot
    like a PC using grub.

    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

    More bad advice.

    See later in this thread for the actual answer.

    ---druck
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From nospam.Dennis.Slagers@nospam.Dennis.Slagers@f2060.n280.z2.fidonet.org (Dennis Slagers) to druck on Sat Jan 25 09:55:26 2025
    From Newsgroup: comp.sys.raspberry-pi


    Hello druck!

    24 Jan 25 21:38, you wrote to me:

    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.

    oeps.. my bad ..

    So the maybe is: do not try this ..

    Thanks for correcting me.

    Dennis


    ... Error 500: It's your problem now.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Mon Jan 27 14:04:07 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 24/01/2025 20:55, Dennis Slagers wrote:
    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.

    LOL. Yup Arm/broadcomm based Pis 'do it their way'

    It goes back to the chips inception as a set top box embedded processpor
    --
    "When a true genius appears in the world, you may know him by this sign,
    that the dunces are all in confederacy against him."

    Jonathan Swift.

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.sys.raspberry-pi on Tue Jan 28 02:04:47 2025
    From Newsgroup: comp.sys.raspberry-pi

    On Fri, 24 Jan 2025 13:16:36 +0000, The Natural Philosopher wrote:

    I have a Pi 4B and its supremely ecstatic booting from USB.

    Not to mention, USB sticks seem to be a lot more reliable than SD cards.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.sys.raspberry-pi on Tue Jan 28 02:09:02 2025
    From Newsgroup: comp.sys.raspberry-pi

    On Fri, 24 Jan 2025 11:44:19 +0000, The Natural Philosopher wrote:

    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.

    That doesn’t sound right to me. /etc/fstab is interpreted by a userland process (/sbin/init). That only starts running after the kernel has been booted. So mounting the boot partition at this point will make no
    difference to your running kernel. (Presumably /boot/firmware might
    contain firmware relevant to connected hardware and its drivers, but
    that’s a separate issue.)

    (Not a Raspberry Pi user, but this should be basic Linux stuff common to
    all architectures.)
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.sys.raspberry-pi on Tue Jan 28 02:13:44 2025
    From Newsgroup: comp.sys.raspberry-pi

    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?

    I wrote my own Python wrapper <https://gitlab.com/ldo/inotipy> and
    have used that in one nontrivial example so far <https://bitbucket.org/ldo17/serve_passwd/>, which I deployed at a
    customer’s installation.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.sys.raspberry-pi on Tue Jan 28 02:20:09 2025
    From Newsgroup: comp.sys.raspberry-pi

    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.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Chris Green@cl@isbd.net to comp.sys.raspberry-pi on Tue Jan 28 08:47:33 2025
    From Newsgroup: comp.sys.raspberry-pi

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    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?

    Yes, it's in package inotify-tools and provides CLI commands like
    inotifywait and inotifywatch.
    --
    Chris Green
    ·
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Theo@theom+news@chiark.greenend.org.uk to comp.sys.raspberry-pi on Tue Jan 28 10:36:08 2025
    From Newsgroup: comp.sys.raspberry-pi

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    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.

    UEFI isn't x86 specific - Arm uses it as well.

    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.

    Yes, although to note that there are typically several stages of booting.
    The UEFI / u-boot / etc is often the second or third stage of booting. They come after things like the ROM first-stage bootloader then the second stage bootloader loadered from flash, or similar. Sometimes boot is handled by a
    CPU that isn't the main one, such as a 'management' CPU or in the Pi
    1/2/3's case the GPU.

    In the classic Pi 1, the process is:
    1st stage: ROM bootloader (enough to read SD card)
    2nd stage: bootcode.bin on SD card (firmware for GPU)
    3rd stage: start.elf on SD card (firmware for GPU)
    4th stage: Linux kernel from SD card (for CPU)

    In Pi 3 and later the ROM bootloader also knows enough to read USB sticks as well as SD cards. The early stage(s) also move to EEPROM on Pi 4 to make
    them easier to update.

    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.

    It's possible to run another bootloader like u-boot or UEFI as your fourth stage, ie:

    1st stage: ROM bootloader (GPU)
    2nd stage: bootcode.bin on SD card (GPU)
    3rd stage: start.elf on SD card (GPU)
    4th stage: UEFI / u-boot on SD card (CPU)
    5th stage: Linux kernel (CPU)

    This is useful if you need more flexible booting than the regular boot
    process provides - eg you want to fetch the kernel from an NFS share, which
    is something not supported in the standard Pi firmware.

    If the board vendor puts the firmware for stages 1-4 into EEPROM/flash, the board now supports UEFI but the boot process didn't change, it just hid the first four stages from you.

    Theo
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From nospam.Dave.Vandermeer@nospam.Dave.Vandermeer@f275.n229.z1.fidonet.org (Dave Vandermeer) to Dennis Slagers on Wed Feb 26 17:45:00 2025
    From Newsgroup: comp.sys.raspberry-pi

    This is completely inappropriate for a Raspberry Pi, which does not

    ot
    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) ..

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From nospam.Dennis.Slagers@nospam.Dennis.Slagers@f2060.n280.z2.fidonet.org (Dennis Slagers) to Dave Vandermeer on Fri Feb 28 14:35:12 2025
    From Newsgroup: comp.sys.raspberry-pi

    * Replying to a msg in PERSONAL.MAIL (PERSONAL.MAIL)


    Hello Dave!

    26 Feb 25 17:45, you wrote to me:

    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 ;)


    Dennis


    ... Works fine on my machine.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From yeti@yeti@tilde.institute to comp.sys.raspberry-pi on Sun Mar 2 02:16:51 2025
    From Newsgroup: comp.sys.raspberry-pi

    nospam.Dave.Vandermeer@f275.n229.z1.fidonet.org (Dave Vandermeer) wrote:

    Actually I did read somewhere that it is possible.

    Actually I'm somewhere using this with.
    --
    I do not bite, I just want to play.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Sun Mar 2 09:54:28 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 28/02/2025 01:35, Dennis Slagers wrote:
    * 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 ;)


    My CH controller never reboots either.
    And only writes to its SD card when the configuration changes.

    It comes up perfectly after a power cut...

    I am not even interested in keeping it up to date. It does 1 job
    supremely well as it is


    Dennis


    ... Works fine on my machine.
    --
    Renewable energy: Expensive solutions that don't work to a problem that doesn't exist instituted by self legalising protection rackets that
    don't protect, masquerading as public servants who don't serve the public.


    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Tue Mar 4 14:13:49 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 26/02/2025 04:45, Dave Vandermeer wrote:
    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) ..

    I ended up inadvertently doing this when my Pi wouldn't boot from SSD.
    It works, but it's awfully messy.

    The SSD had a perfectly fine root partition, but the vfat one was borked somehow.
    Cant remember how I deborked it, but it runs fine now...
    --
    "When a true genius appears in the world, you may know him by this sign,
    that the dunces are all in confederacy against him."

    Jonathan Swift.

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From druck@news@druck.org.uk to comp.sys.raspberry-pi on Tue Mar 4 21:14:29 2025
    From Newsgroup: comp.sys.raspberry-pi

    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
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Adrian Caspersz@email@here.invalid to comp.sys.raspberry-pi on Tue Mar 4 23:49:46 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 28/02/2025 01:35, Dennis Slagers wrote:

    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 ;)

    With my first Pi (3b), I was paranoid about wearing out the MicroSD card.

    I created an NFS share on a NAS server, and mapped most of the Pi's /var partition out to it via fstab. I did other weird stuff moving other
    writeable partitions over to the NAS, thus I had a pretty busy network.

    Worked well for years, however when I desired to update the OS, decided
    life was too short to go though all that again, and instead focused on
    an improved backup ritual for the card.
    --
    Adrian C
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From The Natural Philosopher@tnp@invalid.invalid to comp.sys.raspberry-pi on Wed Mar 5 01:22:30 2025
    From Newsgroup: comp.sys.raspberry-pi

    On 04/03/2025 21:14, druck wrote:
    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.

    I am not so sure about that
    At some stage during boot, fstab is used to (re) mount all partitions

    I *think* that what happened in my case was that the root system was on
    SSD., but the linux image itself was from the SD card



    ---druck
    --
    In theory, there is no difference between theory and practice.
    In practice, there is.
    -- Yogi Berra

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From Lawrence D'Oliveiro@ldo@nz.invalid to comp.sys.raspberry-pi on Tue Mar 11 03:42:33 2025
    From Newsgroup: comp.sys.raspberry-pi

    On Wed, 26 Feb 2025 17:45:00 +1300, 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.

    The root volume (mounted on “/”) is the one volume that cannot be mounted/dismounted directly in the normal way on a Linux system.
    Instead, the kernel offers a special system call, pivot_root(2) <https://manpages.debian.org/pivot_root(2)>, for handling setup of the
    root volume.

    At boot time, the initial root volume is the contents of the initrd
    (“initial RAM disk”) image loaded by the bootloader along with the
    kernel. This contains, among other things, some minimal startup script
    that interprets the “root=” option that was passed to the kernel as
    its command line from the bootloader. At the end of initrd processing,
    it finds this volume, mounts it on a temporary directory somewhere,
    and uses pivot_root to swap that with the initrd root. The initrd
    filesystem (which is not root any more) is now mounted on that
    temporary directory and can be dismounted from it in the normal way,
    and all further processing can continue with the new root filesystem
    as “/”.

    In a sense, the entry in /etc/fstab for the filesystem to mount on “/”
    is redundant in that it can never be used: accessing it means being
    able to open /etc/fstab in the first place, and you can only do that
    if the proper “/” is already mounted.
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From nospam.Grant.Weasner@nospam.Grant.Weasner@f1.n770.z4.fidonet.org (Grant Weasner) to Dave Vandermeer on Tue Mar 11 17:17:31 2025
    From Newsgroup: comp.sys.raspberry-pi

    Re: How to boot from SD but run from US
    By: Dave Vandermeer to Dennis Slagers on Wed Feb 26 2025 17:45:00

    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) ..

    if you need to and want to know how to setup a raspi to run off a usb drive, while only booting to sd card, let me know. I can respond with instructions. I have ran my raspi using usb drive since raspi b+.

    newer raspi devices are easier to setup that way, specifically if you have a newer raspi. the imager that is with the rasp os has an option for what drive to write a new image to.

    I've taken my existing os on sd card, put in the usb drive I want to run off of
    and wrote out everything to the usb drive, modified the boot config files and /etc/fstab, reboot to run off usb drive.

    raspi b can be run this way pretty nice.
    --- Synchronet 3.20c-Linux NewsLink 1.2