fbe
Posts: 329
Joined: Thu Aug 17, 2017 9:08 pm

Re: Booting from usb advice needed

Sun Feb 18, 2018 9:35 pm

There are other files in /boot that may be updated by package updates, raspi-config or other configuration tools. You want to boot from SD card and have the root filesystem on an USB device and I suppose you've got it working now with the usb-boot script. You should mount the boot partition of your SD card to /boot, because this is, where you are actually booting from if you leave the SD card in your Pi. Use the output of

Code: Select all

lsblk -o NAME,PARTUUID,FSTYPE,SIZE
to identify the PARTUUID and modify /etc/fstab.

And be aware that the SD card and the USB drive are "married" now.

asandford
Posts: 1999
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Booting from usb advice needed

Sun Feb 18, 2018 10:34 pm

Haemogoblin wrote:
Sun Feb 18, 2018 9:16 pm
Does a kernal update happen during a sudo apt-get upgrade? or only through a raspi-update?
apt is the recommended way to get stable updates for the OS, kernel and bootloader files. raspi-update will get you the latest kernel, bootloader and RPF produced OS files but it might break things.

The OS and kernel are on / and the bootloader files are on /boot. There is a possibility that the /boot files might not get updated if the device that the Pi is booted from isn't the one that is mounted during update (moreso on net boot).

User avatar
rpdom
Posts: 12755
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Booting from usb advice needed

Sun Feb 18, 2018 10:43 pm

Haemogoblin wrote:
Sun Feb 18, 2018 9:16 pm
Does a kernal update happen during a sudo apt-get upgrade? or only through a raspi-update?
Both. But you should use apt-get upgrade unless specifically told to use rpi-update.

User avatar
PeterO
Posts: 4237
Joined: Sun Jul 22, 2012 4:14 pm

Re: Booting from usb advice needed

Sun Feb 18, 2018 11:41 pm

asandford wrote:
Sun Feb 18, 2018 10:34 pm
Haemogoblin wrote:
Sun Feb 18, 2018 9:16 pm
Does a kernal update happen during a sudo apt-get upgrade? or only through a raspi-update?
apt is the recommended way to get stable updates for the OS, kernel and bootloader files. raspi-update will get you the latest kernel, bootloader and RPF produced OS files but it might break things.

The OS and kernel are on / and the bootloader files are on /boot. There is a possibility that the /boot files might not get updated if the device that the Pi is booted from isn't the one that is mounted during update (moreso on net boot).
I would point out where that is wrong, but I'm not welcome here anymore !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

RonR
Posts: 273
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting from usb advice needed

Mon Feb 19, 2018 12:36 am

Just tested...

Starting with a fresh copy of 2017-11-29-raspbian-stretch-lite.img on an SD card (no USB devices involved), running:

Code: Select all

apt-get -y update
apt-get -y upgrade
apt-get -y dist-upgrade
does NOT update any /boot files NOR update any /lib/modules files or the kernel (it remains at 4.9.59)..

At this time, only rpi-update updates the firmware, /boot files, /lib/modules files and the kernel (to 4.14.18).

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

Re: Booting from usb advice needed

Mon Feb 19, 2018 12:14 pm

fbe wrote:
Sun Feb 18, 2018 8:06 pm
I wonder if a system with your configuration will survive a kernel update without manually synchronizing the boot partition on the SD card.
If both / and /boot are mounted to the USB device then kernel+firmware updates will also be applied to the USB device and not the SD card. There are two fixes for that (assuming no pure USB boot). One is to keep /boot on the SD card and only haved / on the USB boot device, the other is to only have bootcode.bin on the SD card.
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?

fbe
Posts: 329
Joined: Thu Aug 17, 2017 9:08 pm

Re: Booting from usb advice needed

Mon Feb 19, 2018 8:44 pm

HawaiianPi wrote:
Mon Feb 19, 2018 12:14 pm
the other is to only have bootcode.bin on the SD card.
I always wanted to try this method to boot but never did it before. So I:
  • Wrote the recent Raspbian image (2017-11-29) to an USB stick
  • Repartitioned a SD card (to prevent conflicting PARTUUID from a previous installed Raspbian), created a FAT32 filesystem
  • Moved the bootcode.bin from the first partition of the USB stick to the SD card
  • Plugged the SD card and the USB stick into my RPi 3B powered it on and...
it worked. Even the root partition on the USB stick was resized correctly. I could have copied the bootcode.bin instead of moving it, but i wanted to be sure, that the bootcode.bin on the SD card is used for booting.
This configuration doesn't suit if you want to boot your Pi later with more than one USB drive connected. So I
  • Moved all remaining files (except for System Volume Information, created by my Windows PC) from the first partition of the USB stick to the SD card
  • Modified /etc/fstab to mount the first (and only) partition on the SD card to /boot
  • Rebooted
... success. Having the whole boot partition on the SD card will ensure that updated bootcode.bin will be written to the right place too.

Finally, if i wanted to continue working with this setup i would remove the first partition on the USB stick or give it a fixed mountpoint in /etc/fstab to prevent automatic mount on login to the desktop.

RonR
Posts: 273
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Booting from usb advice needed

Mon Feb 19, 2018 11:56 pm

fbe wrote:
Sun Feb 18, 2018 8:06 pm
I wonder if a system with your configuration will survive a kernel update without manually synchronizing the boot partition on the SD card.
I changed usb-boot such that it now mounts the BOOT partition of the SD card (/dev/mmcblk0p1) on /boot instead of the BOOT partition of the USB device (/dev/sdX1).

Anyone who used the original version of usb-boot may find it beneficial to modify the /boot line of the /etc/fstab file on the USB device to the following:

Code: Select all

/dev/mmcblk0p1        /boot           vfat    defaults          0       2

asandford
Posts: 1999
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Booting from usb advice needed

Tue Feb 20, 2018 12:39 am

PeterO wrote:
Sun Feb 18, 2018 11:41 pm
asandford wrote:
Sun Feb 18, 2018 10:34 pm
Haemogoblin wrote:
Sun Feb 18, 2018 9:16 pm
Does a kernal update happen during a sudo apt-get upgrade? or only through a raspi-update?
apt is the recommended way to get stable updates for the OS, kernel and bootloader files. raspi-update will get you the latest kernel, bootloader and RPF produced OS files but it might break things.

The OS and kernel are on / and the bootloader files are on /boot. There is a possibility that the /boot files might not get updated if the device that the Pi is booted from isn't the one that is mounted during update (moreso on net boot).
I would point out where that is wrong, but I'm not welcome here anymore !
PeterO
Feel free to point out where you think I'm wrong, but my iscsi boot device says I'm correct.

As the bootserver isn't powered on when the iscsi booted device update, there is no way that the bootserver can be updated (the fact that it's mounted r/o is moot).

I welcome your comments as long as you can back the up.

fbe
Posts: 329
Joined: Thu Aug 17, 2017 9:08 pm

Re: Booting from usb advice needed

Tue Feb 20, 2018 11:17 am

asandford wrote:
Tue Feb 20, 2018 12:39 am
PeterO wrote:
Sun Feb 18, 2018 11:41 pm
asandford wrote:
Sun Feb 18, 2018 10:34 pm

apt is the recommended way to get stable updates for the OS, kernel and bootloader files. raspi-update will get you the latest kernel, bootloader and RPF produced OS files but it might break things.

The OS and kernel are on / and the bootloader files are on /boot. There is a possibility that the /boot files might not get updated if the device that the Pi is booted from isn't the one that is mounted during update (moreso on net boot).
I would point out where that is wrong, but I'm not welcome here anymore !
PeterO
Feel free to point out where you think I'm wrong, but my iscsi boot device says I'm correct.

As the bootserver isn't powered on when the iscsi booted device update, there is no way that the bootserver can be updated (the fact that it's mounted r/o is moot).

I welcome your comments as long as you can back the up.
The kernel modules are on / but I would bet the kernel is on /boot. But pointing that out would not change the recommendation, which partition should be mounted to /boot.

Return to “Advanced users”

Who is online

Users browsing this forum: bekiaris and 12 guests