Re: How to boot from SD but run from USB?

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: How to boot from SD but run from USB?
De : theom+news (at) *nospam* chiark.greenend.org.uk (Theo)
Groupes : comp.sys.raspberry-pi
Date : 24. Jan 2025, 10:37:54
Autres entêtes
Organisation : University of Cambridge, England
Message-ID : <QCn*CFn5z@news.chiark.greenend.org.uk>
References : 1 2
User-Agent : tin/1.8.3-20070201 ("Scotasay") (UNIX) (Linux/5.10.0-28-amd64 (x86_64))
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

Date Sujet#  Auteur
23 Jan 25 * How to boot from SD but run from USB?36Chris Green
24 Jan 25 +* Re: How to boot from SD but run from USB?6yeti
24 Jan 25 i`* Re: How to boot from SD but run from USB?5Chris Green
24 Jan 25 i `* Re: How to boot from SD but run from USB?4Theo
24 Jan 25 i  `* Re: How to boot from SD but run from USB?3Chris Green
28 Jan 25 i   `* Re: How to boot from SD but run from USB?2Lawrence D'Oliveiro
28 Jan 25 i    `- Re: How to boot from SD but run from USB?1Chris Green
23 Jan 25 +* How to boot from SD but run from USB?19Dennis Slagers
24 Jan 25 i`* Re: How to boot from SD but run from USB?18druck
24 Jan 25 i +* How to boot from SD but run from USB?7Dennis Slagers
26 Feb 25 i i`* How to boot from SD but run from US6Dave Vandermeer
28 Feb 25 i i +* How to boot from SD but run from US2Dennis Slagers
2 Mar 25 i i i`- Re: How to boot from SD but run from US1The Natural Philosopher
2 Mar 25 i i +- Re: How to boot from SD but run from US1yeti
11 Mar 25 i i +- Re: How to boot from SD but run from US1Lawrence D'Oliveiro
11 Mar 25 i i `- How to boot from SD but run from US1Grant Weasner
24 Jan 25 i `* How to boot from SD but run from USB?10Dennis Slagers
27 Jan 25 i  +* Re: How to boot from SD but run from USB?3The Natural Philosopher
28 Jan 25 i  i`* Re: How to boot from SD but run from USB?2Lawrence D'Oliveiro
28 Jan 25 i  i `- Re: How to boot from SD but run from USB?1Theo
26 Feb 25 i  `* How to boot from SD but run from US6Dave Vandermeer
28 Feb 25 i   +* How to boot from SD but run from US2Dennis Slagers
5 Mar 25 i   i`- Re: How to boot from SD but run from US1Adrian Caspersz
4 Mar 25 i   +- Re: How to boot from SD but run from US1The Natural Philosopher
4 Mar 25 i   `* Re: How to boot from SD but run from US2druck
5 Mar 25 i    `- Re: How to boot from SD but run from US1The Natural Philosopher
24 Jan 25 +* Re: How to boot from SD but run from USB?9The Natural Philosopher
24 Jan 25 i+* Re: How to boot from SD but run from USB?3Theo
24 Jan 25 ii`* Re: How to boot from SD but run from USB?2The Natural Philosopher
28 Jan 25 ii `- Re: How to boot from SD but run from USB?1Lawrence D'Oliveiro
24 Jan 25 i`* Re: How to boot from SD but run from USB?5Chris Green
24 Jan 25 i `* Re: How to boot from SD but run from USB?4The Natural Philosopher
24 Jan 25 i  +* Re: How to boot from SD but run from USB?2Chris Green
24 Jan 25 i  i`- Re: How to boot from SD but run from USB?1The Natural Philosopher
28 Jan 25 i  `- Re: How to boot from SD but run from USB?1Lawrence D'Oliveiro
23 Jan 25 `- How to boot from SD but run from USB?1Dennis Slagers

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal