mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Linux (https://www.mersenneforum.org/forumdisplay.php?f=39)
-   -   Booting Pi operating system from a USB HDD partition (https://www.mersenneforum.org/showthread.php?t=27312)

paulunderwood 2021-11-10 20:47

Booting Pi operating system from a USB HDD partition
 
This is not urgent. To put the OS onto a Pi is usually done by flashing an SD card and popping it into the Pi. I can [C]dd[/C] the image file to a [U]partition[/U] of my USB HDD -- the same would apply to an SSD -- but how do I install the bootloader onto the HDD (or SSD)? I can do it with grub install from the Pi OS when it is running, but first I need to boot it :ermm:

I guess one way would be to boot an SD card with Pi OS on it and then run [c]grub-install[/c] with the HDD-boot sector as the target and for the kernel and ramfs on the partition specified. :smile:

chalsall 2021-11-10 21:02

[QUOTE=paulunderwood;592872]This is not urgent.[/QUOTE]

Thanks for this Paul.

I've had similar thoughts in my head on this subject domain. Ever since Mike brought forward that there's a new "Image" for Pi's already deployed (and those we will soon have in our hands)...

Let's collaborate on this. Working together works better.

Seriously. :tu: :chalsall:

paulunderwood 2021-11-10 21:33

[QUOTE=chalsall;592873]
Let's collaborate on this. Working together works better.
[/QUOTE]

It sure does!

I now think I can skip flashing an SD card and use the (AMD/Intel) flashing computer to run [C]grub-install[/C] with the USB HDD boot sector as a target and specify that the partition has vmlinuz and initramfs. But what happened to the boot sector of the image? Is that put onto the beginning of the partition?

paulunderwood 2021-11-11 06:36

Another method is to install to an SD card and [C]rsync[/C] its already formatted partitions to the USB partitions. Then make a few changes to [C]/etc/fstab[/C] on the USB copy.. Run [C]grub-install[/C] on a file which has been appropriately modified. Untested!

But I can use USB3 on my Odroid N2 -- my Pi 3B+ has only USB2. The N2 has a physical switch that boots petitboot on the SPI flash memory. So after [C]rysnc[/C]'ing the OS from the SD card to the already formatted USB partition(s) and changing [C]/etc/fstab[/C] on it appropriately, switch to SPI and boot via petitboot. Untested!

chalsall 2021-11-11 22:25

[QUOTE=paulunderwood;592911]Another method...[/QUOTE]

No time. But observing with interest.

Have "kit" to play with. But time is a limited resource... :smile:

Edit: Actually... To share... I've been doing a *lot* of rsync'ing recently.

Edit.PS: DD is also something to make friends with.

Edit.PPS: ddrescue as well. When your clients don't follow your backup instructions, and the "kit" is not cooperating...

lalera 2021-11-21 14:46

hi,
you can try this
[url]https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb[/url]

paulunderwood 2021-11-21 17:04

[QUOTE=lalera;593554]hi,
you can try this
[url]https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb[/url][/QUOTE]

That's a nice graphical way of doing it, but I am unsure that before copying the OS you can select /dev/sdaX. I don't want the other partitions to be destroyed. It seems to be, after a firmware update on Pi 4 or Pi 400, put GRUB onto the USB HDD/SDD and copy the files for the rest across. I notice the linked article does not say anything about Pi 3B+ -- I'll be using an Odroid N2 anyway.


All times are UTC. The time now is 04:22.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.