yiays
Posts: 1
Joined: Sun Jul 14, 2019 10:58 am

Tell Raspbian to use SD Card for /boot and USB for /

Sun Jul 14, 2019 11:05 am

I'm on an original Raspberry Pi 1b, and I've used the old hack of configuring config.txt to use a usbstick for rootdir. I wasn't able to get this working with the device UUID for some reason, so I'm referring to it the less ideal way (/dev/sda), but that's besides the point.
Whenever the system makes changes to /boot, it's affecting the partition on the USB stick, which is ignored when actually booting. If I could fix this, this system would be just about perfect.
So, how can I delete the boot partition from the USB stick and tell linux to refer to /boot on the SD card as soon as possible and have it work?

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Tell Raspbian to use SD Card for /boot and USB for /

Sun Jul 14, 2019 5:26 pm

Welcome to the forum,

Basically you need to change fstab (and optionally the SD card) as follows:

a) Use blkid to identify the SD boot partition UUID (/dev/mmcblk0p1 in my case)
b) Use sudo nano /etc/fstab and change the /boot line to have this UUID rather than the HDD UUID
c) Use sudo fdisk to delete the Linux partition off the SD card (I used sudo disk /dev/mmcblk0 and pd2dw) - THIS IS OPTIONAL
d) Reboot
e) apt update and upgrade
f) Configure Pi as required

Have a look at https://www.raspberrypi.org/forums/view ... 1&t=244965 for a walk through.
Need Pi spray - these things are breeding in my house...

User avatar
HawaiianPi
Posts: 4590
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Tell Raspbian to use SD Card for /boot and USB for /

Sun Jul 14, 2019 6:09 pm

Andyroo wrote:
Sun Jul 14, 2019 5:26 pm
Basically you need to change fstab (and optionally the SD card) as follows:

a) Use blkid to identify the SD boot partition UUID (/dev/mmcblk0p1 in my case)
You don't really need the UUID of the SD card. There is only one SD card slot, so it will always be /dev/mmcblk0p1 and it's fine to mount that as /boot (I've heard there is a way to add a 2nd SD on GPIO, and if you've done that, then sure, use the UUID, but most have probably not done that)
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
HawaiianPi
Posts: 4590
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Tell Raspbian to use SD Card for /boot and USB for /

Sun Jul 14, 2019 11:46 pm

Actually, with the older models you don't even need /boot on the card any longer. Just write a Raspbian image to your USB drive and copy the bootcode.bin file from the USB "boot" partition to a FAT32 SD card. Plug the bootcode.bin-only SD card and Raspbian imaged USB drive into the system and it should boot from USB.

Got caught up in the USB boot drama with the new Pi4 and forgot about that for a moment. The Pi4 doesn't use bootcode.bin, so you do need /boot on SD until the firmware gets updated. All the older models need with recent versions of Raspbian is bootcode.bin on SD.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Tell Raspbian to use SD Card for /boot and USB for /

Sun Jul 14, 2019 11:59 pm

I thought about putting only the bin file on the SD but then decided against it as if any updates come out you would have to manually copy the file over to the SD card as it’s not mounted anywhere.

At least with all the /boot together on the card and mounted under /, any update will handle ALL the files in one go
Need Pi spray - these things are breeding in my house...

User avatar
HawaiianPi
Posts: 4590
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Tell Raspbian to use SD Card for /boot and USB for /

Mon Jul 15, 2019 12:33 am

Eh, maybe. Still seems like a simpler solution (automatic resizing works with bootcode.bin SD, but not with /boot on SD). Wouldn't be too hard to use a script or rsync to update bootcode.bin on the card when the OS does a shutdown or reboot.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Andyroo
Posts: 4465
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Tell Raspbian to use SD Card for /boot and USB for /

Mon Jul 15, 2019 12:43 am

I assume by that then there are no locks on the file to stop an update and the card is mounted (or would you still need to do that in fstab?)

Being paranoid, I would tie it in to the shutdown somehow so it’s ready at next boot :D

It does not save me a great deal of work as I still have to use Etcher to name the card ‘boot’ as the Mac names it ‘BOOT’ and I could not get the 3B+ to boot Buster from it even with the full contents copied over...
Need Pi spray - these things are breeding in my house...

User avatar
HawaiianPi
Posts: 4590
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Tell Raspbian to use SD Card for /boot and USB for /

Mon Jul 15, 2019 12:59 am

Andyroo wrote:
Mon Jul 15, 2019 12:43 am
... as I still have to use Etcher to name the card ‘boot’ as the Mac names it ‘BOOT’ and I could not get the 3B+ to boot Buster from it even with the full contents copied over...
Yea, I saw you post that before, and I'm not really sure what's going on with your setup, but the card does not need to be named "boot" to work. Something else is causing your trouble, that using Etcher is coincidentally fixing. It's definitely not the card name.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
thagrol
Posts: 1832
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Tell Raspbian to use SD Card for /boot and USB for /

Mon Jul 15, 2019 12:24 pm

HawaiianPi wrote:
Sun Jul 14, 2019 11:46 pm
Actually, with the older models you don't even need /boot on the card any longer. Just write a Raspbian image to your USB drive and copy the bootcode.bin file from the USB "boot" partition to a FAT32 SD card. Plug the bootcode.bin-only SD card and Raspbian imaged USB drive into the system and it should boot from USB.
An aside: the bootcode.bin method works for network booting older Pi too.
This space unintentionally left blank.

User avatar
thagrol
Posts: 1832
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Tell Raspbian to use SD Card for /boot and USB for /

Mon Jul 15, 2019 12:27 pm

Andyroo wrote:
Sun Jul 14, 2019 11:59 pm
I thought about putting only the bin file on the SD but then decided against it as if any updates come out you would have to manually copy the file over to the SD card as it’s not mounted anywhere.
Going on a limb here: but why bother updating bootcode.bin?

It's an early stage boot loader and won't be running by the time the OS is. Plus I'd expect any changes made to it to be for new models and, as with all updates, rick breaking the old ones.
This space unintentionally left blank.

Return to “Troubleshooting”