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

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 9:10 pm

Brad Q wrote:
Sun Aug 18, 2019 9:03 pm
As predicted:

"/dev/mmcblk0p1 /boot "

So all I need to do is edit the fstab from 1 to 6?

Yes. Then reboot and make sure you're seeing a normal /boot:

Code: Select all

pi@raspberrypi:~ $ sudo ls -l /boot
total 39510
-rwxr-xr-x 1 root root   23946 Jul  8 08:02 bcm2708-rpi-b.dtb
-rwxr-xr-x 1 root root   24205 Jul  8 08:02 bcm2708-rpi-b-plus.dtb
-rwxr-xr-x 1 root root   23723 Jul  8 08:02 bcm2708-rpi-cm.dtb
-rwxr-xr-x 1 root root   23671 Jul  8 08:02 bcm2708-rpi-zero.dtb
-rwxr-xr-x 1 root root   24407 Jul  8 08:02 bcm2708-rpi-zero-w.dtb
-rwxr-xr-x 1 root root   25293 Jul  8 08:02 bcm2709-rpi-2-b.dtb
-rwxr-xr-x 1 root root   26463 Jul  8 08:02 bcm2710-rpi-3-b.dtb
-rwxr-xr-x 1 root root   27082 Jul  8 08:02 bcm2710-rpi-3-b-plus.dtb
-rwxr-xr-x 1 root root   25261 Jul  8 08:02 bcm2710-rpi-cm3.dtb
-rwxr-xr-x 1 root root   40284 Jul  8 08:02 bcm2711-rpi-4-b.dtb
-rwxr-xr-x 1 root root   52296 Jun 24 10:21 bootcode.bin
-rwxr-xr-x 1 root root     375 Aug 18 13:08 cmdline.txt
-rwxr-xr-x 1 root root    1733 Aug 17 23:22 config.txt
-rwxr-xr-x 1 root root   18693 Jun 24 10:21 COPYING.linux
-rwxr-xr-x 1 root root    3030 Jul  9 09:07 fixup4cd.dat
-rwxr-xr-x 1 root root    6068 Jul  9 09:07 fixup4.dat
-rwxr-xr-x 1 root root    9146 Jul  9 09:07 fixup4db.dat
-rwxr-xr-x 1 root root    9148 Jul  9 09:07 fixup4x.dat
-rwxr-xr-x 1 root root    2649 Jul  8 08:02 fixup_cd.dat
-rwxr-xr-x 1 root root    6724 Jul  8 08:02 fixup.dat
-rwxr-xr-x 1 root root    9802 Jul  9 09:07 fixup_db.dat
-rwxr-xr-x 1 root root    9798 Jul  9 09:07 fixup_x.dat
-rwxr-xr-x 1 root root     145 Jul  9 19:41 issue.txt
-rwxr-xr-x 1 root root 5299792 Jul  8 08:02 kernel7.img
-rwxr-xr-x 1 root root 5600464 Jul  8 08:02 kernel7l.img
-rwxr-xr-x 1 root root 5017104 Jul  8 08:02 kernel.img
-rwxr-xr-x 1 root root    1494 Jun 24 10:21 LICENCE.broadcom
drwxr-xr-x 2 root root   14848 Jul  9 19:07 overlays
-rwxr-xr-x 1 root root  762880 Jul  9 09:07 start4cd.elf
-rwxr-xr-x 1 root root 4716552 Jul  9 09:07 start4db.elf
-rwxr-xr-x 1 root root 2759172 Jul  9 09:07 start4.elf
-rwxr-xr-x 1 root root 3672712 Jul  9 09:07 start4x.elf
-rwxr-xr-x 1 root root  685412 Jul  9 09:07 start_cd.elf
-rwxr-xr-x 1 root root 4854088 Jul  9 09:07 start_db.elf
-rwxr-xr-x 1 root root 2878052 Jul  9 09:07 start.elf
-rwxr-xr-x 1 root root 3791560 Jul  9 09:07 start_x.elf
pi@raspberrypi:~ $

Brad Q
Posts: 26
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 9:48 pm

"fred@raspberrypi:~ $ cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
PARTUUID=9a9f084e-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that"

The ls -l seems (cursory look) to match to yours as well.

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

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 9:57 pm

Brad Q wrote:
Sun Aug 18, 2019 9:48 pm
The ls -l seems (cursory look) to match to yours as well.

Great!

Any chance you'd be willing to test another version of usb-boot? I've made a couple minor changes that I think will make it NOOBS compatible (such that it sets cmdline.txt and fstab correctly).

Brad Q
Posts: 26
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 10:07 pm

Sure. I suspect that the Pi4 is going to open up a new avalanche of users. People looking for a cheap general desktop that uses very little power (vs 240w standard desktop)and very little space. If the 64bit version of Raspbian really winds up adding an additional 10% performance, so much the better. The Pi4 is almost there. Once the usb boot, pxe boot, and video codec issues get worked out, it will be an excellent choice for 75%(?) of the non-gaming computer users. In my case I keep a PC running 24/7. So I going from a xeon E3-1225v3 to the Pi4. Now I will still fire up the xeon when I need the horse power but it does not need to be idling all the time. I am coming up on two weeks without needing to boot the xeon.

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

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 10:29 pm

Brad Q wrote:
Sun Aug 18, 2019 10:07 pm
Sure.

Thanks Brad.

Please put your SD card's /boot/cmdline.txt back to:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

and comment out the one pointing to a USB drive (no blank lines allowed in cmdline.txt). Then reboot before running the new test version so you're on the SD card.

Hopefully the attached test version will be happy and change everything it should running on NOOBS.

Brad Q
Posts: 26
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 10:53 pm

Before running this do I need to re-edit the fstab (6 back to 1?

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

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 10:57 pm

Brad Q wrote:
Sun Aug 18, 2019 10:53 pm
Before running this do I need to re-edit the fstab (6 back to 1?
You're going to be copying to a fresh (or over the old) USB drive, correct? If so, everything on the USB drive gets overwritten.

Brad Q
Posts: 26
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 11:09 pm

"fred@raspberrypi:~/Holding $ sudo ./usb-boot-test-2

SD card must remain in place to boot the USB device"

Immediately after selecting sda and hitting enter, it dies. I think it is looking for 1 but 6 is still there.

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

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 11:15 pm

Brad Q wrote:
Sun Aug 18, 2019 11:09 pm
"fred@raspberrypi:~/Holding $ sudo ./usb-boot-test-2

SD card must remain in place to boot the USB device"

Immediately after selecting sda and hitting enter, it dies. I think it is looking for 1 but 6 is still there.
"SD card must remain in place to boot the USB device" is the last thing it says before the script exits. I'm confused where you're selecting sda after that.

Let me do some more testing here. I've never used NOOBS -- maybe I need to bring one up.

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

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 11:16 pm

Brad Q wrote:
Sun Aug 18, 2019 11:09 pm
"fred@raspberrypi:~/Holding $ sudo ./usb-boot-test-2

SD card must remain in place to boot the USB device"

Immediately after selecting sda and hitting enter, it dies. I think it is looking for 1 but 6 is still there.
"SD card must remain in place to boot the USB device" is the last thing it says before the script exits. I'm confused where you're selecting sda after that.

Let me do some more testing here. I've never used NOOBS -- maybe I need to bring one up.

Brad Q
Posts: 26
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian on USB Devices : Made Easy

Sun Aug 18, 2019 11:18 pm

Tried changing the fstab back and got the same result. This was while you posting.

" cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
PARTUUID=9a9f084e-02 / ext4 defaults,noatime 0 1"

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

Re: Running Raspbian on USB Devices : Made Easy

Tue Aug 20, 2019 3:24 am

usb-boot (in the first post of this topic) has been updated.

usb-boot now supports NOOBS.

If you answer 'Yes' to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?', the selected USB device must not be mounted anywhere (Raspbian Desktop auto-mounts USB devices). Previous versions of usb-boot did not check and the script would report failures if the USB device was mounted. usb-boot now checks and refuses to continue if the selected USB device is mounted. Simply eject or unmount (umount) the selected USB device and run usb-boot again.

JCB
Posts: 4
Joined: Sun Oct 21, 2018 2:38 am

Re: Running Raspbian on USB Devices : Made Easy

Sat Aug 24, 2019 8:23 am

Hello, total noob here with a RPI 4. I pasted the usb-boot file in pi directory, inserted a usb flash drive in a usb3 and ran the usb-boot from terminal, but the script doesn't allow me to select where my drives are or write in the red box you can see in the image, and then freezes.
What am I doing wrong?
Attachments
usb-boot.png
usb-boot.png (22.32 KiB) Viewed 2028 times

giorgos73
Posts: 1
Joined: Sat Aug 24, 2019 12:52 pm

Re: Running Raspbian on USB Devices : Made Easy

Sat Aug 24, 2019 1:03 pm

JCB wrote: Hello, total noob here with a RPI 4. I pasted the usb-boot file in pi directory, inserted a usb flash drive in a usb3 and ran the usb-boot from terminal, but the script doesn't allow me to select where my drives are or write in the red box you can see in the image, and then freezes.
What am I doing wrong?
Use the arrow keys on your keyboard to navigate to the desired device and press the spacebar to select it. Then use the tab key to navigate to the 'Ok' or 'Cancel' button and press the return key.

JCB
Posts: 4
Joined: Sun Oct 21, 2018 2:38 am

Re: Running Raspbian from USB Devices : Made Easy

Sat Aug 24, 2019 6:55 pm

Hi giorgos73,
It worked!!! Thank you very much! :D

pi@raspberrypi:~ $ mount | grep " on / "
/dev/sda2 on / type ext4 (rw,noatime)
pi@raspberrypi:~ $

martindomburg
Posts: 17
Joined: Mon Aug 26, 2019 8:33 am

Re: Running Raspbian from USB Devices : Made Easy

Thu Aug 29, 2019 10:57 pm

Hi,
Thank you for this tutorial! I managed it as an absolute noob !!
A small tip: It is in the opening post that you must place the usb-boot script in the pi folder and make chmod -x usb-boot executable with the command to launch it with sudo ./usb-boot. I had to get this from the responses, also the tip to check whether it actually loads from the USB drive is a good tool. Also nice to know in advance that you have to wait a while with the first boot from the USB 😊 First thought it crashed until I read your reaction on the 4th page.

I do have some questions:

- I have a 120 GB Zheino SSD drive with USB cable. If I put it on the USB 3 connection, it is extremely slow and raspbian often crashes. CPU is then 100%.
If I put the drive on USB 2, it will be super fast, how is that possible?

- On the USB 2, the ROOT and the VOLUME drive appear as an icon on the desktop, how do I remove them? This did not happen with the USB 3.

- Can I see how fast writing and reading is now?

- Is it true that when I disconnect the USB and boot that it no longer approaches the SD?

Thanks for the help.

Did you know:
I have over 10 degrees less CPU temperature thanks to the USB Boot!
I use the Reichelt housing, which consists entirely of cooling fins and is equipped with two fans that run continuously in the housing. With the boat from the SD, the CPU was constantly around 50 degrees. Now that I am from the USB boat it is 40 degrees.

Greetings Martin

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

Re: Running Raspbian from USB Devices : Made Easy

Thu Aug 29, 2019 11:59 pm

martindomburg wrote:
Thu Aug 29, 2019 10:57 pm
- I have a 120 GB Zheino SSD drive with USB cable. If I put it on the USB 3 connection, it is extremely slow and raspbian often crashes. CPU is then 100%.
If I put the drive on USB 2, it will be super fast, how is that possible?

STICKY: If you have a Raspberry Pi 4 and are getting bad speeds transferring data to/from USB3.0 SSDs, read this
martindomburg wrote:
Thu Aug 29, 2019 10:57 pm
- On the USB 2, the ROOT and the VOLUME drive appear as an icon on the desktop, how do I remove them? This did not happen with the USB 3.

Disable automount
martindomburg wrote:
Thu Aug 29, 2019 10:57 pm
- Can I see how fast writing and reading is now?

I think the 'hdparm' package will test and display transfer rates:

Code: Select all

sudo apt-get install hdparm

This is a command line utility (not GUI-based).
martindomburg wrote:
Thu Aug 29, 2019 10:57 pm
- Is it true that when I disconnect the USB and boot that it no longer approaches the SD?

If you wish to return to booting the SD card instead of the USB device, you must change the 'root=' portion of /boot/cmdline.txt to:

Code: Select all

root=/dev/mmcblk0p2

martindomburg
Posts: 17
Joined: Mon Aug 26, 2019 8:33 am

Re: Running Raspbian from USB Devices : Made Easy

Fri Aug 30, 2019 1:26 am

Great, thanks you!!!!!

martindomburg
Posts: 17
Joined: Mon Aug 26, 2019 8:33 am

Re: Running Raspbian from USB Devices : Made Easy

Sun Sep 01, 2019 11:47 am

Hi

In need some help again :)

After the boot worked fine with the SATA SSD, i purchased an M.2 SSD drive

https://tweakers.net/pricewatch/1375718 ... ificaties/

After running USB boot, Raspbian is not booting from the SSD, not on USB 2 or 3 (quirk is ok)

It just shows the 4 raspberry's, i have waited more then 45 minutes.

What could be wrong? The SSD whas mounted as NTFS as first before running USB boot. I put the quirk right so the driver would be recougnized on USB3 then run the USB boot with the copy file option ON.

Thanks for the help!

martindomburg
Posts: 17
Joined: Mon Aug 26, 2019 8:33 am

Re: Running Raspbian from USB Devices : Made Easy

Sun Sep 01, 2019 12:42 pm

Trange thing, after pulling the powerplug out, plugging it back in, the boot was completed succesfully.

But when i'm using HDParm, i get this result:
/dev/sda:
Timing cached reads: 1618 MB in 2.00 seconds = 809.60 MB/sec
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Timing buffered disk reads: 874 MB in 3.01 seconds = 290.80 MB/sec
Anything wrong with this?

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

Re: Running Raspbian from USB Devices : Made Easy

Sun Sep 01, 2019 7:07 pm

martindomburg wrote:
Sun Sep 01, 2019 12:42 pm
/dev/sda:
Timing cached reads: 1618 MB in 2.00 seconds = 809.60 MB/sec
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Timing buffered disk reads: 874 MB in 3.01 seconds = 290.80 MB/sec
Anything wrong with this?

Not that I see. Here's what I get on a fast flash drive:

/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Timing buffered disk reads: 548 MB in 3.01 seconds = 182.11 MB/sec

jkoconnell
Posts: 1
Joined: Mon Sep 09, 2019 4:55 pm

Re: Running Raspbian from USB Devices : Made Easy

Mon Sep 09, 2019 6:07 pm

Using setup from RonR's SD+USB script.

I have a problem where Pi won't boot from USB memory stick unless another USB device is attached (like keyboard or mouse).
If not attached, boot stalls until one is attached.

Sep 8 11:55:22 w2mmdpbx1 kernel: [ 2.009107] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Sep 8 11:55:22 w2mmdpbx1 kernel: [ 2.016794] hub 1-1.1:1.0: USB hub found
Sep 8 11:55:22 w2mmdpbx1 kernel: [ 2.023901] hub 1-1.1:1.0: 3 ports detected
... boot stalls ...
... attach USB keyboard ...
Sep 8 11:55:22 w2mmdpbx1 kernel: [ 1411.707688] dwc_otg_handle_wakeup_detected_intr lxstate = 2
Sep 8 11:55:22 w2mmdpbx1 kernel: [ 1412.281788] usb 1-1.1: reset high-speed USB device number 3 using dwc_otg
... boot completes.

/etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian

/etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
PARTUUID=9fbffe07-02 / ext4 defaults,noatime 0 1

/dev/disk/by-partuuid
total 0
lrwxrwxrwx 1 root root 15 Sep 9 12:01 000ee283-01 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Sep 9 12:01 000ee283-02 -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 10 Sep 9 12:01 9fbffe07-01 -> ../../sda1
lrwxrwxrwx 1 root root 10 Sep 9 12:01 9fbffe07-02 -> ../../sda2

cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=9fbffe07-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Any ideas?
Thanks

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

Re: Running Raspbian from USB Devices : Made Easy

Mon Sep 09, 2019 7:45 pm

jkoconnell wrote:
Mon Sep 09, 2019 6:07 pm
Any ideas?

There are several threads about Raspberry Pi's not booting if a keyboard is not attached (the problem is not related to usb-boot).

Here's one:

https://www.raspberrypi.org/forums/view ... 8&t=250922

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

Re: Running Raspbian from USB Devices : Made Easy

Fri Oct 04, 2019 6:41 pm

usb-boot (in the first post of this topic) has been updated.

usb-boot now allows the PTUUID/PARTUUID to be changed on the USB device when it's the same as that of the SD card. This condition is due to a problem introduced in the latest Raspbian Buster release: 2019-09-26 Raspbian Image PTUUID

Brad Q
Posts: 26
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian from USB Devices : Made Easy

Fri Oct 11, 2019 8:48 pm

Ron

You seeing any performance degradation after today's update? It included a bootloader update. It could just me. But it feels a little off? It would not necessarily be due to usb-boot.

Return to “Advanced users”