Pi 4 USB boot works with stick, doesn't work with drive

Well now I'm really stumped.

I'm trying to get my Pi 4 to boot from a (fairly small, 500Gb) hard disk. I've tried creating the image various ways (dd on Linux, rpi-imager, etc.) and nothing worked.

So I tried creating an image on a USB stick (an 8Gb Kingston one) and that works perfectly OK.

I've compared the contents of the USB stick and the USB drive and they look identical, they both mount without problems on the Pi when it's running from its SD card.

When I try and boot from the USB disk I get the error code for "Kernel image not found".

The only thing I can think may be happening is that the eeprom boot code isn't as 'clever' as the normal disk mounting code in the OS and, thus, for some reason can't mount and read from the USB disk but can mount and read the USB stick.

However I'm a bit stuck now, I don't really want to go and buy another USB disk and find that doesn't work either.

Reply to
Chris Green
Loading thread data ...

How is the 500GB drive partitioned? And what format are its partitions? You need a small boot partition in FAT32 format and the rest can be an EXT4.

You should then be able to rsync /boot from a working SD card to the boot partition and copy the rest of the card to the much larger ext4 partition using rsync etc.

Reply to
The Natural Philosopher

It was created directly by copying the Pi distribution image to it, that creates it as above. I tried with dd directly and using rpi-imager, they both produced the same as far as I can see.

If I could get a brand new built by the default "how to make a Pi" process to work first then I might try the above to get 'my' files on it but at the moment I can't even get a pristine new Raspberry Pi image to boot.

Reply to
Chris Green

I'm rather ignorant of Linux OS config. Why would you want to move the boot off SD. Move your apps off the SD, sure, it is quite nice to have a separation between apps and OS. Apps often do a lot of disk IO.

I've always assumed the OS itself doesn't do a bunch of writing to the SD card. No swapping, maybe a few logfiles. (note to self) I should check.

The apps themselves can be in docker containers and hence the OS needs very little config, The SD can easily be swapped in case of disaster. You can script up provisioning if you are really keen, or just have a git repo, with all the key files.

Reply to
Pancho

How's that going to help? /boot is on the USB disk.

This is replacing the SD card *completely* with a USB stick/disk.

Reply to
Chris Green

Yes, I could just boot off the SD /boot partition and then have everything on the spinning disk but that's a much messier (and actually more difficult to configure) way than just 'boot off the USB'.

If the boot off the USB worked (well, it does from the stick) then it's just a matter of removing the SD card and putting a USB drive with the system image on it into the Pi and it "just works". Which it does with a USB stick, but not with a drive.

Reply to
Chris Green

not even on an SD card?

Reply to
The Natural Philosopher

Just as a matter of interest have you tried it with an SSD drive?

Reply to
Folderol

Mechanical disks "wake up" much slower than solid state devices. If you haven't tried it yet, put an empty file named timeout in the DOS paritions. Not sure it'll help, but it's a cheap experiment.

Good luck,

bob prohaska

Reply to
bob prohaska

That *may* be the issue, at least I suspect it may be some sort of power issue. The trouble is that the 500Gb USB drive has a funny 'micro USB 3.1' connector and the only cable I have goes straight to a USB-A connector so I can't supply power externally very easily.

Connecting through a USB hub makes it work but that's only USB 2.

Strangely, having found that via the hub works I tried the drive in one of the Pi's USB 2 connectors and *that worked* too!

I have a possible 320Gb candidate drive and an external USB-3 box with separate power. I'll be trying that tomorrow.

Reply to
Chris Green

No, because I don't have a spare one.

If (as seems likely) it is a power problem then it's likely an SSD will fix the problem.

Reply to
Chris Green

Did you update /etc/fstab and whatever disk configuration bits are in /boot? The Raspberry Pi's SD card slot is /dev/mmcblk0, but a hard drive connected over USB will be /dev/sda. Without the appropriate updates, the kernel won't find the root filesystem and will hang.

Reply to
scott

On Wed, 15 Dec 2021 19:07:08 +0000, Chris Green snipped-for-privacy@isbd.net declaimed the following:

USB-3 hubs are available... The trick is to find one that doesn't revert all ports to the slowest device connected.

Reply to
Dennis Lee Bieber

But it all adds to the cost, I'm trying to do this 'on the cheap' (not that I'm really that skint but I just don't like spending money unnecessarily).

In reality speed isn't a big issue so USB 2 is probably prefectly OK. It's sole function is being a NAS and the added USB boot drive isn't the backup drive so its speed is probably unimportant.

Reply to
Chris Green

This is *booting* from the USB instead of from the SD, the installation process creates the appropriate /etc/fstab entries in the image (or at least configures the boot process so they are correct).

As noted elsewhere I have now successfully booted from the USB drive (connected to a USB 2 connector instead of USB 3) with no SD card in the Pi 4. This is simply a standard Pi image written to the USB drive in the same way as one write an image to an SD card. No other configuration is required.

Reply to
Chris Green

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.