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

Re: Pi3 - USB boot

Sat Apr 28, 2018 5:41 pm

Gavinmc42 wrote:
Sat Apr 28, 2018 12:28 pm
We have some now and a new one is being built locally, now have excuse to check it out ;)
Never would have gone to Costco for electronics.
While Costco's selection of Electronics is limited, sometimes you can find awesome deals there. We buy a lot of our cell phones there because they are cheaper than anywhere else (plus they throw in some accessories), and I recently got a ridiculously great deal on a gaming laptop. The SanDisk 2x64GB card price is good, but not a super deal.
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
ab1jx
Posts: 740
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Pi3 - USB boot

Sun Apr 29, 2018 2:58 am

I buy most stuff by starting at http://www.froogle.com

I have a hard drive with USB adapter but basically gave up on it as a boot device. It will boot OK and work fine in the short term. I think what happens is that when the drive spins down to a sleep mode from lack of activity the Pi doesn't realize that. If there's swap on the drive the Pi tries to access it and can't when the drive's asleep so it crashes. If a drive is connected the old fashioned way with IDE/ATA or SCSI the computer knows to wake the drive up when it needs it for something. That seems to not happen connecting via USB.

So I boot from a high-endurance SD and then manually mount the USB hard drive. If I reboot or halt it gets unmounted first. If the Pi crashes then the hard drive will need an fsck, but that's not usually very often, once every couple weeks or so. If I'm doing something with a high risk of crashing I unmount the drive first. It's been pretty stable using it this way for several months, as a boot drive it would crash once a day or more.

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi3 - USB boot

Sun Apr 29, 2018 4:36 am

Thanks guys, all input welcome.

When running Raspbian even Lite, my ratio of good to bad 16GB SD's is quite high, about 50%.
I even tried 16GB USB and had issues and I really need at least 32GB now.

Most older 8GB SD's worked fine for quite some time,95%, but that was years ago ;)
With Linux OS's getting bigger a reliable solution is need.
Especially if I want to move to Pi3B+ Aarch64 as a development tool.

How fast will a Pi3B+ boot from network?
Will it boot from a POE switch?
But that really is another post.
I have a lot of fun with Zero's booting from USB, time to try Netboot 3B+'s?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Remus66
Posts: 10
Joined: Wed May 23, 2018 8:08 am

Re: Pi3 - USB boot

Wed May 23, 2018 11:41 pm

Here is a question for you.

I am trying to have my Pi3 to boot from the mSATA SSD. I have gone through all the partitioning, etc, but how do I copy an image to the SSD?

All the sites say to use Etcher, but does Etcher work on Pi's? or do I have to utilise another PC?, or do is there another way.

User avatar
Gavinmc42
Posts: 2359
Joined: Wed Aug 28, 2013 3:31 am

Re: Pi3 - USB boot

Thu May 24, 2018 1:07 am

Yep, Etcher does not like USB SSD drives, I had to use Win32DiskImager on a Windows PC.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
ab1jx
Posts: 740
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Pi3 - USB boot

Thu May 24, 2018 1:13 am

Assuming there's nothing else on the SSD you care about, I'd just use dd. The image contains 2 partitions, doing a dd to the drive will just overwrite what's there (almost) and give you 2 partitions on it.

See the dd man page but something like:

Code: Select all

dd if=myfile.img of=/dev/sdc
should work. Your drive may not be called /dev/sdc, that's just an example. Plug it in then look at the end of the dmesg output to see what it's called. Or look at sfdisk -l. Devices are assigned letters sequentially as they're found, it won't always be called exactly the same thing. That's why there are DUIDs and UUIDs.

Don't use a partition number like sda2 or sdb1, you want to write to the whole device. And if it's a blank device there's room to screw up, you can just do it again a different way. Writing it will take a few minutes at least, dd doesn't give any progress indication.

Remus66
Posts: 10
Joined: Wed May 23, 2018 8:08 am

Re: Pi3 - USB boot

Thu May 24, 2018 1:35 am

Check out my last post on this thread. It works now and I am unsure of what i did.

I suppose that is the beauty of the Pi, you learn by trying things.

viewtopic.php?f=91&t=214237&p=1319374#p1319374

daturach
Posts: 1
Joined: Sat May 26, 2018 12:07 pm

Re: Pi3 - USB boot

Sat May 26, 2018 12:55 pm

Hello

This is my experience booting from an external HDD, with a Pi3, model B, ver. 1.2, running latest raspbian stretch.
HDD is quite old, model PyroGate 50 GB, Hi-speed Business Drive, manufactured in 2008.

I went through all these intrications, enabling USB boot mode in config.txt, etc. So far so good.
I managed to boot from that HDD, but yesterday, when I tried to boot again, it did not work.

I spent "some" time figuring out the process to make it work again. I was about to give up, but luckily this process works for me.
It's a bit cumbersome, but as I intend to use that system as a server for recording data, I expect to let it run as long as it can...

The process is quite detailed, kind of for dummies but it's in case I need to do it in 3 or 4 years time...
The SD card is bootable, the one I used to configure "USB boot".
HDD has a separate power supply, something like 5V, 4A.

Anyway, here it is:

- Insert SD card and switch on Raspberry. Do not connect the HDD to the USB port of the Raspberry.
- Raspberry will boot.
- Switch on the HDD and connect the USB cable to the Raspberry.
- After about 3-4 secs, the HDD will be recognized by the Raspberry.
- Shutdown Raspberry but let HDD connected to Raspberry.
- Remove power from Raspberry and remove SD card.
- Switch on Raspberry (without SD card).
- Raspberry will boot from HDD.

Et voilà.

I don't know why it's that complicated. Maybe someone else has a similar HD.
In any case, I am not going to buy a new device for that application. Hey, it's a 50 GB HD with plenty of space for such a system.

Thanks

Walter

nes_pi
Posts: 20
Joined: Mon Jun 25, 2018 1:35 am

Re: Pi3 - USB boot

Thu Jun 28, 2018 7:31 am

Wow. Just cloned my 64gb SD card to a cheap Sandisk X110 64gb SSD in a USB enclosure. Even though the sd card i was using was the fastest rated Evo+ for random reads and writes, i am finding the pi is wildly faster than when running off the microSD card!

Maybe now i will clone my ssd to the microSD card for backups :lol: And the microsd will be saved for when i want to boot RISC OS!

If i leave a sd card in there for storage with no OS installed, will it still boot from the usb drive?

I notice my pi runs about 5 degrees hotter celsius when running over USB than off the microSD. Perhaps i need to run it off a powered hub to take the strain off the pi. Hopefully my fans get here soon from china (I bought a lot on ebay because i had a lot of pi's to put fans on. I also bought a 10 pack of transistors off ebay, $1.55)


Walter, maybe you dont have the usb boot line in your config.txt.

jerrm
Posts: 59
Joined: Wed May 02, 2018 7:35 pm

Re: Pi3 - USB boot

Thu Jun 28, 2018 1:52 pm

nes_pi wrote: I notice my pi runs about 5 degrees hotter celsius when running over USB than off the microSD. Perhaps i need to run it off a powered hub to take the strain off the pi.
Temp may be due to the fact the Pi is constantly at 10% CPU utilization when there is no SD card. A rather important detail none of the docs bother to mention.

There is a fix now. See viewtopic.php?f=28&t=211912.

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

Re: Pi3 - USB boot

Thu Jun 28, 2018 11:37 pm

nes_pi wrote:
Thu Jun 28, 2018 7:31 am
Wow. Just cloned my 64gb SD card to a cheap Sandisk X110 64gb SSD in a USB enclosure. Even though the sd card i was using was the fastest rated Evo+ for random reads and writes, i am finding the pi is wildly faster than when running off the microSD card!

Maybe now i will clone my ssd to the microSD card for backups :lol: And the microsd will be saved for when i want to boot RISC OS!

If i leave a sd card in there for storage with no OS installed, will it still boot from the usb drive?
Yes, as long as the SD card itself is not bootable (no OS). That will even reduce the boot time, and reduce the additional CPU load from polling an empty SD card slot (which could account for some of the extra heat you are observing).

I notice my pi runs about 5 degrees hotter celsius when running over USB than off the microSD. Perhaps i need to run it off a powered hub to take the strain off the pi. Hopefully my fans get here soon from china (I bought a lot on ebay because i had a lot of pi's to put fans on. I also bought a 10 pack of transistors off ebay, $1.55).
Depends on how hot your Pi is getting? Remember the Pi can run at temperatures hot enough to hurt your skin and still be within design specs. The Pi3B won't start thermal throttling until it hits 80C/176F, which is painfully hot!

Personally I'm not a fan of fans. They consume additional power, add noise, and over time they will fill your system with dust.

I keep my Pi3B(+) computers cool in Flirc Gen2 cases. They not only look very cool (picture is link),
Image
the case itself acts as a huge heatsink to keep the Pi running cool, without the nose, power requirements or dust of fans.
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?

LTolledo
Posts: 804
Joined: Sat Mar 17, 2018 7:29 am

Re: Pi3 - USB boot

Fri Jun 29, 2018 9:19 am

I've converted all of my RPi3B to boot purely (no microSD card in the slot) on USB Flash Memory. Installed the fix to prevent high CPU usage.

I've even able to have my RPi3B to boot purely on a 1TB 2.5" HDD...

Havent tried booting from a self powered 3.5" HDD though....might try it for testing... but in the end I think is a bit impractical for me.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
ab1jx
Posts: 740
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Pi3 - USB boot

Fri Jun 29, 2018 11:24 am

My next leap might be an external RAID like
https://www.startech.com/HDD/Enclosures ... S352BU313R
or
https://www.startech.com/HDD/Enclosures ... S3540BU33E

I'd like the redundancy of external battery-backed drives. A hardware RAID working through the USB bottleneck couldn't be any slower than a single drive.

User avatar
ab1jx
Posts: 740
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Pi3 - USB boot

Tue Jul 10, 2018 9:12 pm

I discovered (months too late) the rootdelay=10 option you can put in your /boot/cmdline.txt. This tells the system to expect up to a 10 second delay for the root filesystem (the one set with the root= earlier in the line). I've had maybe a dozen crashes over 6 months because when I'd walk away from the Pi (it's always on) something would time out and go to sleep, meanwhile the Pi had swapped something out to it. When the Pi tried to read it back the device was asleep, so crash. I have probably a perfectly good 1 TB laptop drive in a USB adapter that I gave up on booting from. I keep stuff on it, but manually mount partitions and boot from SD.

Oh well, it gives me more flexibility. I can stick in a Raspbian SD, right now I'm booted into arm64 Debian, I've tried arm64 Gentoo. I'm building http://www.linuxfromscratch.org at the moment in a partition on the USB drive. It has been done before: http://intestinate.com/pilfs/guide.html

I think the ultimate heat sinking method would involve machining a block of aluminum thick enough so you could mount the Pi circuit board upside down on a big heat sink and not have any of the components hit the heat sink. You could make one for the GPU at the same time, slightly thicker. Use heat sink compound, that white stuff. But I've never overclocked anything, I don't think it's worthwhile.

User avatar
DJKing101
Posts: 8
Joined: Fri Nov 16, 2018 4:18 pm

Re: Pi3 - USB boot

Fri Nov 16, 2018 4:21 pm

Hi, in know we are in November now, no longer July but would this Hard Drive work on a 3B+, and how can we change the timeout period?

POWER CONSUMPTION
Mode active
Value 4.5 Watt

(nicked from cnet, lol)
I love my Rapberry 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196

W. H. Heydt
Posts: 9433
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Pi3 - USB boot

Fri Nov 16, 2018 5:53 pm

DJKing101 wrote:
Fri Nov 16, 2018 4:21 pm
Hi, in know we are in November now, no longer July but would this Hard Drive work on a 3B+, and how can we change the timeout period?

POWER CONSUMPTION
Mode active
Value 4.5 Watt

(nicked from cnet, lol)
Assuming that is the max power the drive needs (and not the figure for just running), it's within the current limit for a Pi3B+ of 1.2A total for the USB power. The Pi3B+ comes with the "boot from USB" bit set at the factory. See above, or look at https://www.raspberrypi.org/documentati ... des/msd.md for the details. (That's worth reading anyway if you're going to play around with MSD booting.)

fruitoftheloom
Posts: 18290
Joined: Tue Mar 25, 2014 12:40 pm

Re: Pi3 - USB boot

Fri Nov 16, 2018 6:28 pm

DJKing101 wrote:
Fri Nov 16, 2018 4:21 pm
Hi, in know we are in November now, no longer July but would this Hard Drive work on a 3B+, and how can we change the timeout period?

POWER CONSUMPTION
Mode active
Value 4.5 Watt

(nicked from cnet, lol)

What hard drive model number ? or is it a secret ? is it in a 3rd party USB enclosure ?
adieu

My other Computer is an Asus CS10 ChromeBit

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

Re: Pi3 - USB boot

Fri Nov 16, 2018 7:33 pm

DJKing101 wrote:
Fri Nov 16, 2018 4:21 pm
Hi, in know we are in November now, no longer July but would this Hard Drive work on a 3B+, and how can we change the timeout period?

POWER CONSUMPTION
Mode active
Value 4.5 Watt

(nicked from cnet, lol)
That's not enough info. Got a link to the HDD model and specs?

Even with the full specs it's impossible to guarantee success (there are too many variables). In general, hard drives are the most problematic due to power requirements and long spin-up times. That being said, it can be done with some hard drives.
...and how can we change the timeout period?
There is another OTP bit that increases the wait time for USB drives from the default 2 seconds to 5 seconds. To enable the additional wait time, add "program_usb_boot_timeout=1" to config.txt on a Raspbian SD card and boot it once in the system. This is a permanent change that sets bit 24 of register 66 in the OTP memory block (for either the 3B or 3B+ models).

To verify that bit 24 has been set, the command is:

Code: Select all

vcgencmd otp_dump | grep 66
which returns the following hexadecimal values.
  • RPi model 3B
  • 66:00009daa (default)
  • 66:01009daa (bit programmed)
  • RPi model 3B+
  • 66:02009eaa (default)
  • 66:03009eaa (bit programmed)
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
ab1jx
Posts: 740
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Pi3 - USB boot

Fri Nov 16, 2018 9:04 pm

It's useful to have hdparm installed. You can at least find out the actual drive model number then look up specs. I imagine if you buy a drive in an enclosure they may not tell you that.

hdparm -I /dev/sda tells me:

Code: Select all


/dev/sda:

ATA device, with non-removable media
	Model Number:       ST1000LM048-2E7172                      
	Serial Number:      ZDE74Q7B
	Firmware Revision:  SDM1    
	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
	Used: unknown (minor revision code 0x001f) 
	Supported: 10 9 8 7 6 5 
	Likely used: 10
Configuration:
	Logical		max	current
	cylinders	16383	16383
	heads		16	16
	sectors/track	63	63
	--
	CHS current addressable sectors:    16514064
	LBA    user addressable sectors:   268435455
	LBA48  user addressable sectors:  1953525168
	Logical  Sector size:                   512 bytes
	Physical Sector size:                  4096 bytes
	Logical Sector-0 offset:                  0 bytes
	device size with M = 1024*1024:      953869 MBytes
	device size with M = 1000*1000:     1000204 MBytes (1000 GB)
	cache/buffer size  = unknown
	Form Factor: 2.5 inch
	Nominal Media Rotation Rate: 5400
Capabilities:
	LBA, IORDY(can be disabled)
	Queue depth: 32
	Standby timer values: spec'd by Standard, no device specific minimum
	R/W multiple sector transfer: Max = 16	Current = 16
	Advanced power management level: 254
	Recommended acoustic management value: 208, current value: 208
	DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
	     Cycle time: min=120ns recommended=120ns
	PIO: pio0 pio1 pio2 pio3 pio4 
	     Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
	Enabled	Supported:
	   *	SMART feature set
	    	Security Mode feature set
	   *	Power Management feature set
	   *	Write cache
	   *	Look-ahead
	   *	Host Protected Area feature set
	   *	WRITE_BUFFER command
	   *	READ_BUFFER command
	   *	NOP cmd
	   *	DOWNLOAD_MICROCODE
	   *	Advanced Power Management feature set
	    	Power-Up In Standby feature set
	   *	SET_FEATURES required to spinup after power up
	    	SET_MAX security extension
	   *	48-bit Address feature set
	   *	Device Configuration Overlay feature set
	   *	Mandatory FLUSH_CACHE
	   *	FLUSH_CACHE_EXT
	   *	SMART error logging
	   *	SMART self-test
	   *	General Purpose Logging feature set
	   *	WRITE_{DMA|MULTIPLE}_FUA_EXT
	   *	64-bit World wide name
	   *	IDLE_IMMEDIATE with UNLOAD
	    	Write-Read-Verify feature set
	   *	WRITE_UNCORRECTABLE_EXT command
	   *	{READ,WRITE}_DMA_EXT_GPL commands
	   *	Segmented DOWNLOAD_MICROCODE
	   *	Gen1 signaling speed (1.5Gb/s)
	   *	Gen2 signaling speed (3.0Gb/s)
	   *	Gen3 signaling speed (6.0Gb/s)
	   *	Native Command Queueing (NCQ)
	   *	Host-initiated interface power management
	   *	Phy event counters
	   *	Idle-Unload when NCQ is active
	   *	READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
	    	DMA Setup Auto-Activate optimization
	    	Device-initiated interface power management
	    	Asynchronous notification (eg. media change)
	   *	Software settings preservation
	   *	SMART Command Transport (SCT) feature set
	   *	SCT Write Same (AC2)
	   *	SCT Features Control (AC4)
	   *	SCT Data Tables (AC5)
	    	unknown 206[12] (vendor specific)
	    	unknown 206[13] (vendor specific)
	   *	DOWNLOAD MICROCODE DMA command
Security: 
	Master password revision code = 65534
		supported
	not	enabled
	not	locked
	not	frozen
	not	expired: security count
		supported: enhanced erase
	166min for SECURITY ERASE UNIT. 166min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c500a6037f81
	NAA		: 5
	IEEE OUI	: 000c50
	Unique ID	: 0a6037f81
Checksum: correct
It's a laptop 1 TB drive in a StarTech enclosure. There's actually much more info, I think smartmon tells you the number of hours it's been spun up and the maximum temperature it's been exposed to.

Return to “General discussion”