mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2021-11-10, 20:47   #1
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

1111010111102 Posts
Default 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 dd the image file to a partition 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

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

Last fiddled with by paulunderwood on 2021-11-10 at 21:16
paulunderwood is offline   Reply With Quote
Old 2021-11-10, 21:02   #2
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

234728 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
This is not urgent.
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.
chalsall is offline   Reply With Quote
Old 2021-11-10, 21:33   #3
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2×7×281 Posts
Default

Quote:
Originally Posted by chalsall View Post
Let's collaborate on this. Working together works better.
It sure does!

I now think I can skip flashing an SD card and use the (AMD/Intel) flashing computer to run grub-install 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?

Last fiddled with by paulunderwood on 2021-11-10 at 21:46
paulunderwood is offline   Reply With Quote
Old 2021-11-11, 06:36   #4
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

75368 Posts
Default

Another method is to install to an SD card and rsync its already formatted partitions to the USB partitions. Then make a few changes to /etc/fstab on the USB copy.. Run grub-install 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 rysnc'ing the OS from the SD card to the already formatted USB partition(s) and changing /etc/fstab on it appropriately, switch to SPI and boot via petitboot. Untested!

Last fiddled with by paulunderwood on 2021-11-11 at 06:47
paulunderwood is offline   Reply With Quote
Old 2021-11-11, 22:25   #5
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2·5,021 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Another method...
No time. But observing with interest.

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

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

Last fiddled with by chalsall on 2021-11-11 at 22:32
chalsall is offline   Reply With Quote
Old 2021-11-21, 14:46   #6
lalera
 
lalera's Avatar
 
Jul 2003

2×307 Posts
Default

hi,
you can try this
https://www.tomshardware.com/how-to/...berry-pi-4-usb
lalera is offline   Reply With Quote
Old 2021-11-21, 17:04   #7
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2×7×281 Posts
Default

Quote:
Originally Posted by lalera View Post
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.

Last fiddled with by paulunderwood on 2021-11-21 at 17:11
paulunderwood is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fun with partition function Batalov And now for something completely different 24 2018-02-27 17:03
Operating Systems BWetter246 Factoring 4 2012-05-13 23:38
Operating systems Xyzzy Forum Feedback 26 2012-02-29 18:37
Have a look at the partition numbers fivemack Factoring 57 2007-12-28 10:37
Not booting after unplugging graphics card patrik Hardware 3 2004-05-24 16:37

All times are UTC. The time now is 05:31.


Tue Nov 30 05:31:18 UTC 2021 up 130 days, 17 secs, 0 users, load averages: 0.72, 1.00, 1.22

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.