Boot Raspberry Pi 2 from USB Hard Disc

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Boot Raspberry Pi 2 from USB Hard Disc

Postby ngoonee » Wed Oct 24, 2018 9:53 pm

I've burnt through my 3rd SD card, and this is getting annoying (not to mention slightly costly). Obviously having a 24-hour running (actually running, not idle) pi is going to lead to that, so I'm looking at using a Pi off the Hard Disc.

I'm okay with having an SD card in there, as long as it's just /boot, and everything else under / is on the hard disc. Is this possible on the Pi 2 B+, or do I need the Pi 3 (where can don't even need the SD card and can just boot off a USB disc)?
ngoonee
 
Posts: 17
Joined: Wed Apr 20, 2016 8:26 pm

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby TheSaint » Thu Oct 25, 2018 5:45 am

Why you prefer a portable HD?
Wouldn't be better a SSD? They offer 3 years warranty, so there won't be a worry about damaged cells for that length of time ;)

To boot from a UMS, is just a matter how the u-boot is prepared for. Imaging it like a small kernel and you may download it and compile it with your preferences, once you'll go though the menu configuration. If you'll expect to compile it on a PC then you need a cross compiling set.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby ngoonee » Thu Nov 08, 2018 1:37 am

I'm not sure what needs to be done differently, what exactly needs recompiling?
ngoonee
 
Posts: 17
Joined: Wed Apr 20, 2016 8:26 pm

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby TheSaint » Thu Nov 08, 2018 12:30 pm

Well, you need to connect a USB-232 adapter to see what the machine is booting. Also a bit of knowledge about the u-boot commands may help you.
So from what the u-boot will show you may judge whether is able to find a plugged USB device. If it won't do it, you may stop the boot loader and try to issue some command in order to see if can find the UMS.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby ufo6000 » Thu Nov 08, 2018 4:16 pm

I think the pi2 image is without uboot ?

So if you stay with /boot on the sd card it's easy:

* connect the external hdd
* partition and format the hdd
* rsync the entire root from sd to hdd (also ok from within the running pi !)
* modify /boot/cmdline.txt --> root=/dev/sdxy
* maybe: modify /boot/cmdline.txt: add "rootwait rootdelay=55" for slow hdd
* modify /etc/fstab on the hdd, not the fstab on the sd card filesystem
* attach a monitor to see the new boot process
ufo6000
 
Posts: 117
Joined: Fri Jan 22, 2016 7:54 pm

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby ngoonee » Fri Nov 09, 2018 7:29 am

Thanks ufo6000, that seems really doable, and wouldn't require me to purchase the adapter (I'm going to order one anyway, sounds useful).
ngoonee
 
Posts: 17
Joined: Wed Apr 20, 2016 8:26 pm

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby TheSaint » Sat Nov 10, 2018 2:21 am

@ngoonee
I got my adapter here and is working as expected.
Some time the power light turns on if I plug the adapter while the SBC is off, but it's no harm.
Anyway, back to the discussion, I doubt that there's no u-boot. How would it boot ?
What is in the /boot, grub ?
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby ufo6000 » Sat Nov 10, 2018 8:48 am

I don't know how it is called,
the "old" way has a /boot/cmdline.txt (ArchLinuxARM-rpi-2-latest.tar.gz),
the u-boot one has a /boot/boot.txt (ArchLinuxARM-rpi-3-latest.tar.gz) to configure.

@ngoonee:
If you have u-boot, the task would be a little different of course, but still easy.
ufo6000
 
Posts: 117
Joined: Fri Jan 22, 2016 7:54 pm

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby TheSaint » Sat Nov 10, 2018 4:17 pm

That's explicitly the parameter that u-boot reads and pass over the kernel.
So it means you have u-boot on the first few Mbytes of the media. If you plan to use the USB HD, the it should contain a valid rootfs, but u-boot must be prepared to scan the USB port for plugged media.

If you can use the adapter, then you might stop the u-boot and try to issue the command. For better understanding you should issue help and printenv which will guide to find the way to command to scan the USB.
Anyway if you have difficulties about that, just post your result and we may give an advice.
TheSaint
 
Posts: 346
Joined: Mon Jul 23, 2018 7:57 am

Re: Boot Raspberry Pi 2 from USB Hard Disc

Postby ngoonee » Wed Nov 14, 2018 10:54 pm

So I ended up going with just changing cmdline.txt for the Pi2 image as ufo6000 suggested. It didn't seem to work, but that was because my Pi2 somehow doesn't work at all :evil:

I moved the same SD card over to my Pi3 and it worked, mount and df -h showed that I'm running off the ext4 root partion on the USB hard disc. Hopefully this prevents my sd cards burning out....

Now to figure out whether I can get the Pi2 to live again.... it can't even boot from the sd card anymore.
ngoonee
 
Posts: 17
Joined: Wed Apr 20, 2016 8:26 pm

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 7 guests