satimis
Posts: 45
Joined: Thu Aug 31, 2017 3:16 pm

About booting USB mass storage

Tue Sep 12, 2017 1:52 pm

Hi all,

I'm prepared to test booting on USB mass storage. My concept is on powering up Raspberry Pi it would boot directly the USB mass storage similar to Live CD without the assistance of the microSD card.

However in going through following document:

How to boot from a USB Mass Storage Device on a Raspberry Pi 3
https://www.raspberrypi.org/documentati ... des/msd.md

It still needs the file /boot/config.txt on microSD card working as bios to start booting.

If I'm wrong please advise me.

Thanks

Regards
satimis

User avatar
Jednorozec
Posts: 809
Joined: Sun Nov 24, 2013 2:17 pm
Location: Deposit, NY

Re: About booting USB mass storage

Tue Sep 12, 2017 2:11 pm

You only need the SD card to set the USB boot mode after which you no longer need it.
The most important leg of a three legged stool is the one that's missing.
It's called thinking. Why don't you try it sometime?

satimis
Posts: 45
Joined: Thu Aug 31, 2017 3:16 pm

Re: About booting USB mass storage

Tue Sep 12, 2017 2:35 pm

Jednorozec wrote:
Tue Sep 12, 2017 2:11 pm
You only need the SD card to set the USB boot mode after which you no longer need it.
Hi,

On next boot do I still need the microSD card? Can I remove it?

Thanks

satimis

DirkS
Posts: 9838
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: About booting USB mass storage

Tue Sep 12, 2017 4:34 pm

satimis wrote:
Tue Sep 12, 2017 2:35 pm
Jednorozec wrote:
Tue Sep 12, 2017 2:11 pm
You only need the SD card to set the USB boot mode after which you no longer need it.
Hi,

On next boot do I still need the microSD card? Can I remove it?

Thanks

satimis
You're actually quoting the answer to your question.
It's actually 'worse': if you don't remove the SD card the Pi will boot from that; not from the USB device.

hommar
Posts: 170
Joined: Sat Mar 25, 2017 1:55 pm
Location: Russia, Yekaterinburg

Re: About booting USB mass storage

Tue Sep 12, 2017 7:52 pm

satimis wrote:
Tue Sep 12, 2017 1:52 pm
It still needs the file /boot/config.txt on microSD card working as bios to start booting.

If I'm wrong please advise me.
SD need for first boot only
This boot need for turn on "USB boot"
satimis wrote:
Tue Sep 12, 2017 1:52 pm
I'm prepared to test booting on USB mass storage. My concept is on powering up Raspberry Pi it would boot directly the USB mass storage similar to Live CD without the assistance of the microSD card.
Yesterday, I make USB recovery (as Live-CD on PC)
I use my old 16gb USB mass storage
1) I make "boot" partition 12Gb, because this partition I can use on Windows
2) I copy original last Raspbery Lite root to second partition (full image is 14Gb)
3) I uninstall default swap - dphys-swapfile
4) I make several optimizations (zswap + tmpfs for tmp-folder, logs and caches)
5) I change local for Russia users ;) (wifi-country too), but keyboard change to EN, it's better for recovery tools... (keyboard "GB" is not good idea)
6) I make wpa_supplicant.conf for easy edit
You can test it

PS For example, now I can backup SD to first partition, and read this on Windows systems

satimis
Posts: 45
Joined: Thu Aug 31, 2017 3:16 pm

Re: About booting USB mass storage

Wed Sep 13, 2017 9:28 am

DirkS wrote:
Tue Sep 12, 2017 4:34 pm
- snip -
You're actually quoting the answer to your question.
It's actually 'worse': if you don't remove the SD card the Pi will boot from that; not from the USB device.
Your advice noted.

Where the edited /boot/config.txt is saved? On the USB device?

Thanks

Regards
satimis

satimis
Posts: 45
Joined: Thu Aug 31, 2017 3:16 pm

Re: About booting USB mass storage

Wed Sep 13, 2017 9:38 am

hommar wrote:
Tue Sep 12, 2017 7:52 pm
- snip -
Yesterday, I make USB recovery (as Live-CD on PC)
I use my old 16gb USB mass storage
1) I make "boot" partition 12Gb, because this partition I can use on Windows
2) I copy original last Raspbery Lite root to second partition (full image is 14Gb)
3) I uninstall default swap - dphys-swapfile
4) I make several optimizations (zswap + tmpfs for tmp-folder, logs and caches)
5) I change local for Russia users ;) (wifi-country too), but keyboard change to EN, it's better for recovery tools... (keyboard "GB" is not good idea)
6) I make wpa_supplicant.conf for easy edit
You can test it

PS For example, now I can backup SD to first partition, and read this on Windows systems
Your advice noted and thanks.

Re: "3) I uninstall default swap - dphys-swapfile"
Where this file resides? On the microSD card or the mass SD storage?

Re: "4) I make several optimizations (zswap + tmpfs for tmp-folder, logs and caches)" and "6) I make wpa_supplicant.conf for easy edit"
Where are those files located.

The link is in Russian. Sorry I can't read it>

Thanks

Regards
satimis

hommar
Posts: 170
Joined: Sat Mar 25, 2017 1:55 pm
Location: Russia, Yekaterinburg

Re: About booting USB mass storage

Wed Sep 13, 2017 10:18 am

satimis wrote:
Wed Sep 13, 2017 9:38 am
Re: "3) I uninstall default swap - dphys-swapfile"
Where this file resides? On the microSD card or the mass SD storage?

Code: Select all

apt-get purge dphys-swapfile
or

Code: Select all

sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
satimis wrote:
Wed Sep 13, 2017 9:38 am
Re: "4) I make several optimizations (zswap + tmpfs for tmp-folder, logs and caches)"
you can read this
(I think you can understand it, because codes is in English. PS _AI_ is me)
But zram I run in /etc/rc.local now, because it easy
satimis wrote:
Wed Sep 13, 2017 9:38 am
and "6) I make wpa_supplicant.conf for easy edit"
Where are those files located.
/etc/wpa_supplicant/wpa_supplicant.conf
satimis wrote:
Wed Sep 13, 2017 9:38 am
The link is in Russian. Sorry I can't read it>
right top is buttons [Move on your yandex disk][Download] (left button is yellow, but you need right)
First run you can change local to English - run command raspi-config.

PS I install mc, disable bluetooth on /boot/config.txt and change time zone to Yelaterinburg ;) You can change last on raspi-config too.

Regards, Anatoly

i486
Posts: 172
Joined: Sun Aug 28, 2016 3:41 pm
Location: BG

Re: About booting USB mass storage

Wed Sep 13, 2017 12:13 pm

Jednorozec wrote:
Tue Sep 12, 2017 2:11 pm
You only need the SD card to set the USB boot mode after which you no longer need it.
Where is remembered the new boot mode? RPi does not have battery RAM or system flash (AFAIK).

User avatar
rpdom
Posts: 14420
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: About booting USB mass storage

Wed Sep 13, 2017 12:17 pm

i486 wrote:
Wed Sep 13, 2017 12:13 pm
Where is remembered the new boot mode? RPi does not have battery RAM or system flash (AFAIK).
There are a set of One Time Programmable bits in the Pi. They contain things like the serial number, model number and a few settings. One of those bits are where the boot option is stored. Being OTP it can be turned on, but never turned off again.

i486
Posts: 172
Joined: Sun Aug 28, 2016 3:41 pm
Location: BG

Re: About booting USB mass storage

Wed Sep 13, 2017 12:40 pm

This means that serial number can be changed (setting other bits)?

asavah
Posts: 349
Joined: Thu Aug 14, 2014 12:49 am

Re: About booting USB mass storage

Wed Sep 13, 2017 2:09 pm

i486 wrote:
Wed Sep 13, 2017 12:40 pm
This means that serial number can be changed (setting other bits)?
No.
It's OTP - One Time Programmable, once programmed those bits can't be changed and serial, model and some other bits were already burned at factory.

User avatar
RaTTuS
Posts: 10318
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: About booting USB mass storage

Wed Sep 13, 2017 2:19 pm

i486 wrote:
Wed Sep 13, 2017 12:40 pm
This means that serial number can be changed (setting other bits)?
no
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
rpdom
Posts: 14420
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: About booting USB mass storage

Wed Sep 13, 2017 2:49 pm

In theory any bit that isn't set can be set, but they can't be written from Linux, it would have to be done by the boot code which is not ARM code and is closed source.

One example was when some Pis were sent out without the model number set (all zeroes) and there was a "secret" command to put in config.txt that could be used to set it to the correct value.

The USB boot flag is one of the few that are user settable.

Return to “General discussion”