User avatar
bugsy_malone 666
Posts: 289
Joined: Mon Dec 17, 2012 10:50 pm
Location: Basingstoke UK

USB Stick vs SD card on Pi A/B/B+/Zero/2

Mon Nov 21, 2016 7:21 pm

So I am understanding that you can use a small SD card containing just the 'boot' bit thats normally on the windows formatted part of the card to boot the Pi to a USB stick.

I wondered whether people have noticed in improvements of performance or if there are any issues with this? Basically at work when we retire some of the older blackberry phones alot of them have 2gb SD cards in them, inherently this isnt much use unless you run the 'lite' version of Jessie for basic stuff, but its fine on things like my server which essentially does little more than run BTSync.

However, recently I have been looking at the MyCroft AI and so started using their stuff to try and build my own for testing, I figured that because of the way it works 2gb would be enough - nope that filled up quickly, so then I cloned to a 4gb SD card, but if its anything like the Retropie situation, what you think will be a good size card turns out to never be big enough.

So then I was understanding you can get the Pi to run happily from USB, albeit with a minimal SD card. For me I think this would work pretty well as USB sticks are cheaper per GB than SD cards, they are also quick and easy to clone if I need to move up a size and dont have my SD card adaptor to hand.

So what do I need to know and is it a good idea?

User avatar
DougieLawson
Posts: 35518
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Mon Nov 21, 2016 8:24 pm

It's still experimental. It also doesn't work on my B+ which needs max_usb_current=1 to get the hard drive to spin up.

I wouldn't use it for anything on a production machine until the USB/PXE bootcode goes out of beta testing.
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Mon Nov 21, 2016 11:11 pm

bugsy_malone 666 wrote:So I am understanding that you can use a small SD card containing just the 'boot' bit thats normally on the windows formatted part of the card to boot the Pi to a USB stick.

I wondered whether people have noticed in improvements of performance or if there are any issues with this?
Any changes in performance would depend on the SD card and/or USB flash drive you are using.

SD cards, and often USB flash drives as well, are optimized for sequential read/write performance, while computers typically do a lot of non-sequential (random) I/O. Unfortunately most SD and USB flash devices suck horribly at random I/O, so they are just about the poorest choice for a computer OS drive you could make (SSD drives designed for computer use have much more powerful processors and are much faster at random I/O).

As an example, I have a Patriot 128GB Supersonic Rage 2 Series USB 3.0 Flash Drive, described as follows...

"With read and write speeds of up to 400MB/s (Read) and 300MB/s (Write), the Patriot Supersonic Rage 2 uses high quality MLC NAND coupled with a state of the art IC controller for excellent performance when working with large file transfers."

Did you notice the "Marketing Speak" disclaimer in there? You probably did, because I bolded the text.

This drive is extremely fast when doing sequential I/O, which would be the case when working with large file transfers. Approaching cheap SSD performance.

However, when I tested it for random I/O in Crystal Diskmark I got this:
  • Random Read 4KiB (Q= 32,T= 1) : 6.216 MB/s [ 1517.6 IOPS]
  • Random Write 4KiB (Q= 32,T= 1) : 0.026 MB/s [ 6.3 IOPS]
  • Random Read 4KiB (Q= 1,T= 1) : 5.512 MB/s [ 1345.7 IOPS]
  • Random Write 4KiB (Q= 1,T= 1) : 0.010 MB/s [ 2.4 IOPS]
Random reads are only single digit MB/s, and random writes are absolutely abysmal (KB/s)! I've actually gotten better random write numbers from cheap USB 2.0 flash drives.

So anyway, to make a short story long (see what I did there) you'll want a USB drive with good random I/O performance if you are going to use it an an OS drive.

Another option, if you don't need a ton of storage, would be to get a small SSD and a SATA to USB adapter. Small SSD drives are cheap now. Actually cheaper than some high end Micro-SD cards. I imagine even a cheap SSD would outperform most (if not all) Micro-SD cards. Of course I'm in the USA, so the pricing situation might be very different over there in the UK. Here you can find 60GB SSD drives for <$30 ($26.99 is the lowest I found after a quick search), and 120GB SSD drives for < $40 ($37.99).

I hope you found something useful in this rambling post. 8-)
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?

IanS
Posts: 231
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Tue Nov 22, 2016 12:53 pm

Your high speed USB drive is also USB3, so when connected to a USB2 host such as an RPi, there is no way it is going to reach its full speed.

User avatar
bugsy_malone 666
Posts: 289
Joined: Mon Dec 17, 2012 10:50 pm
Location: Basingstoke UK

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Tue Nov 22, 2016 5:24 pm

I guess my main interest was about reliability and if it performs as well as an average class 4 micro SD.

I have a couple of Rpis that I plan to do all sorts with as mentioned various models. Frequently I set up 2 at my house as CCTV recorders while I'm away should anything happen in the day I can see whats happening, like during the summer when the power blew a hole in the ground and we could see where the workmen were repairing as to what on earth the mess was when we got home.

Now I have found USB memory sticks are a bit cheaper than cards and in some cases it would be nice to just plug in a stick to anything and be able to use it as that stick, then when it needs more capacity, find another bigger stick laying around and use it, I use memory sticks in more things than i do micro SDs plus I dont lose them!

Plus then there is the USB hard drive situation, I picked uo a 750gb HD from Sainsburys the other day for £25, Amazon want that much for about 128gb in anything. SSD's are getting cheaper but price per MB mechanical drives still have an advantage. plus older teck like SATA 80gb hds are useless to most people, but its massive to an Rpi!

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

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Wed Nov 23, 2016 2:44 am

IanS wrote:Your high speed USB drive is also USB3, so when connected to a USB2 host such as an RPi, there is no way it is going to reach its full speed.
The test results I posted were run on my i7 notebook's USB 3.0 port (CrystalDiskMark is a Windows application). Yes, those horrible random I/O numbers were tested at USB 3.0 speeds!
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: 4444
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Wed Nov 23, 2016 2:57 am

bugsy_malone 666 wrote:...plus older teck like SATA 80gb hds are useless to most people, but its massive to an Rpi!
That reminds me of the old Atari days when I picked up my first 20MB hard drive for my Atari ST.

No, that's not a typo, it was 20MB, and when I later upgraded it to 80MB I thought I'd never use all that space. :lol:
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
bugsy_malone 666
Posts: 289
Joined: Mon Dec 17, 2012 10:50 pm
Location: Basingstoke UK

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Sun Nov 27, 2016 11:51 am

Its ok, last year I managed to finally get my hands on a harddrive unit for my Amiga 500, it came with 20mb scsi, I then upgraded it to 1gb!

I just thought about it for some of the projects I have been doing where I have tons of 2gb sd cards and 80gb IDE/Sata hard drives that are perfectly usable, when usb adaptors are cheap compared to SD cards of the same size.

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB Stick vs SD card on Pi A/B/B+/Zero/2

Sun Nov 27, 2016 6:10 pm

bugsy_malone 666 wrote:So I am understanding that you can use a small SD card containing just the 'boot' bit thats normally on the windows formatted part of the card to boot the Pi to a USB stick.
DougieLawson wrote:It's still experimental. It also doesn't work on my B+ which needs max_usb_current=1 to get the hard drive to spin up.

I wouldn't use it for anything on a production machine until the USB/PXE bootcode goes out of beta testing.
You have been able to run USB root filesystem on pi since 2012. i.e. just the 20meg of files on SD
That's not experimental, and is the way many of us have run for years.

The "experimental" stuff is for booting without SD at all (on pi3), or just a single file bootcode.bin on other models.

To answer the performance question - yes a USB root setup is generally very noticeably faster.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Return to “General discussion”