element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Documents Pi Desktop: Booting from the SSD (aka booting from USB devices on a Pi 3)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: cstanton
  • Date Created: 3 Jul 2017 2:38 PM Date Created
  • Last Updated Last Updated: 10 May 2021 8:50 PM
  • Views 10069 views
  • Likes 8 likes
  • Comments 66 comments
Related
Recommended

Pi Desktop: Booting from the SSD (aka booting from USB devices on a Pi 3)

Amazingly, the Raspberry Pi booting from a USB device is a huge point of controversy. A great deal many people believe that you still require the SDCard to be able to do it. This is definitely no longer the case, especially with the Raspberry Pi 3. So even though with the Pi Desktop you're going to be connecting a Solid State Drive via a SATA to USB 2.0 interface, where you're going to lose some speed, overall, it's still an improvement. If for nothing else, the capacity of what you can store on it. The add-on HAT board will take an mSATA SSD up to 1 Terabyte in size, and for that to be faster to boot and access than an SDCard and for some USB 'sticks' or 'drives' then that is a significant improvement in itself, and I know a lot of people out there want a dedicated Pi NAS box after all.

 

So why isn't this straight forward for a lot of people? Why can't you simply plug in your mSATA SSD, format it and get going? Well, I've identified are a few areas that people are mainly struggling with on this:

 

  • You have to enable the 'USB Boot bit' on the Raspberry Pi 3 first (this is permanent)
  • Your SSD has to be imaged in the 'right way'
  • Some have the impression that you still need the SDCard in, and that you need to mount the SSD (you can do this, though, you don't strictly have to use the SSD as a boot device)
  • The mSATA SSD has to be supported by the add-on HAT (I'm not actually sure of any that aren't and there's no reference list at the moment, this is mostly hypothetical).
  • There are/were problems with the PiDesktop debian file supplied by Embest (these are being worked on and there is an official github repo here).

 

On the SSD being imaged in 'the right way', you can end up encountering problems imaging your SSD card as you likely do with your SDCard, especially with Microsoft Windows. Windows has a terrible interface to the SDCard readers with the various software that's available. This is either because the software can only refer to the device via the 'drive letter' or by the 'hardware device ID'. Unfortunately most software (eg. Win32DiskImager, I'm looking at you) can only handle imaging drives when it has a drive letter. This totally fails if you haven't even partitioned your device yet and assigned it a drive letter, and some people feel forced to format it to FAT32, this can break things even further. You don't need to format or pre-partition your device, merely assign it a drive letter. There're two useful pieces of software I use to handle this, one is the free software 'Active Partition Manager' and the other is the Disk Management Snapin for Management Console.

 

Let's go through some steps on setting this up. By all means comment on this with your experiences or software you've used that has been successful. What you're about to read is my except from the user manual.

 

image

 

Connecting an mSATA SSD

 

Inside the Pi Desktop we can access the data stored onto the mSATA SSD in one of two ways. Either via USB from the add-on board and then into the attached Raspberry Pi (where we can also boot from it), or connect it to an external computer via USB without having to open up the Pi Desktop case (though you still need to 'turn on' the Pi Desktop for this to work).

 

If the mSATA SSD that you have connected is pre-formatted with a partition using a FAT32 file system (FS), then this FS is typically accessible by all known modern operating systems (OS), and easily accessible. Though if it uses a typical Linux FS such as ext2/3/4, this is trickier to access by all OSs.

 

Note: If you’re connecting the mSATA SSD add-on board to a computer other than the Raspberry Pi inside the Pi Desktop, then you will need the appropriate cable, and you will also have to power the add-on board/Pi Desktop and press the power-on switch. This will also power on the Raspberry Pi if it is still connected.

 

Imaging and Setting Up Partitions

An easy to use utility for managing the partitions on the drive is ‘gparted’ from the Raspbian (OS) (for example if you booted from the SDCard):

 

> http://gparted.org/

 

This is a graphical user interface (GUI) tool that can be used to manage the partitions on your drives, connected via USB or otherwise. It can be installed via the apt package manager from the command line interface (CLI) :

 

> sudo apt-get update

> sudo apt-get install gparted

 

Then you can either run it from the menu of your Raspbian OS, or from the CLI:

 

> sudo gparted

 

From here you can (re)partition your mSATA SSD if it’s running a supported file system. If you are using the CLI, then you will want to issue the following command:

 

> sudo fdisk /dev/<identifier>

 

Where <identifier> is the mount point for the mSATA SSD.

 

Alternatively, you can simply write an image to the mSATA SSD, just as you would write an image to an SDCard. The Raspberry Pi Foundation have instructions on how you write images here:

 

https://www.raspberrypi.org/documentation/installation/installing-images/

 

Note: if you write an image to your mSATA SSD then the data used and accessible from the OS will only be of the size of the image written, unless you resize the partitions.

 

Mounting the mSATA SSD to Access Files

 

Raspbian

The Raspbian OS is based upon Debian Linux, and as such supports the majority of commands and functions that you would use to mount drives within that OS (these typically involve fstab - https://wiki.debian.org/fstab, and pmount - https://wiki.debian.org/pmount ).

 

From the GUI

Depending on your version of Raspbian, and how you have it configured, when you boot your Raspberry Pi to the GUI and then connect the attached mSATA SSD, you will be prompted what to do with your “Removable media” that has been inserted, and the drive will be automatically mounted.

 

It is possible that the GUI will not behave in this way, and instead you will have a transparent icon representing the drive on your desktop, which you can then double-click with the left mouse button and Raspbian will attempt to mount it.

 

From the CLI

When mounting the drive from the GUI, you will have made the drive accessible from the CLI. Typically this is located within the following folder:

 

/media

 

However, sometimes we can’t use the GUI, or merely we don’t want to. To mount the drive we must first know how Linux is referring to it. Linux has the majority of its hardware listed under the ‘/dev’ folder structure, with connected devices typically using the format of ‘/dev/sd<x>’ where <x> is a letter. These can even extend further with ‘/dev/sd<x><y>’ where <y> is the number of the partition(s) on the device.

 

There are a few commands in which we can determine what the device is of a USB device we connect, first, connect the USB device, and then type the following:

 

> dmesg

 

This will tell you basically the contents of a system log which gives you information about the device you have just plugged in. You can also issue the following commands:

 

> lsusb

 

Which will tell you about the device identifiers, and also:

 

> lsblk

 

This command will tell you the /dev/ mount points.

 

Note: If you have problems running a command, try typing ‘sudo’ before it.

 

Now, you will need somewhere to mount the drive to. Let’s make a directory and set the permissions onto it:

 

> sudo mkdir /media/ssd

> sudo chmod 755 /media/ssd

 

Once you know the device mount point, you can then issue the following command:

 

> sudo mount /dev/sd<x><y> /media/ssd

 

Note: Mounting will only work if the mSATA SSD has a file system and partitions setup (see ‘Imaging and Setting Up Partitions’ in this document.), you will want to mount the relevant partition (which has a number, such as /dev/sdb1) as opposed to the device itself (/dev/sdb).

 

The Raspberry Pi Foundation’s official magazine, The Mag Pi has a good article on this:

 

https://www.raspberrypi.org/magpi/connecting-disks-with-the-command-line/

 

 

Microsoft Windows

Thanks to an open source project called Ext2Fsd (Ext2 File System Driver) it is now possible to very easily mount linux FS onto Microsoft Windows OS.

 

You can download and install the software from these websites:

 

http://www.ext2fsd.com/

https://sourceforge.net/projects/ext2fsd/

 

To install the software you will need to have administrative rights on the computer you’re installing it onto, and the ability to install the required system drivers. Afterwards you will likely have to reboot.

 

After you have connected the mSATA SSD HAT board to your computer, you will see it in Windows device manager as a USB Mass Storage Device and also as a drive:

 

imageimage

 

 

From the start menu, you will want to open the ‘Ext2Fsd’ folder and then ‘Ext2 Volume Manager’:

 

image

 

From the software we can then see the partitions of all of the drives listed, including the identified ext FS:

 

image

 

Since in this example, we have already imaged the mSATA SSD with Raspbian, a FAT32x partition is listed (drive E:). it is the EXT4, Linux FS we want below it:

 

image

 

image

 

 

 

Make sure we want to give it a drive letter so we can access it, there are various mounting options you can choose from.

 

image

 

Windows Explorer then has the new drive listed, which we can then open and view the Linux EXT FS:

 

image

 

You can now alter the files and unmount them as necessary.

 

Boot from the mSATA SSD

Configuring your Raspberry Pi to boot from a USB device is a one-way setting. You are configuring a ‘flag’ or a ‘bit’ on your Raspberry Pi chip that you cannot revert.

 

The Raspberry Pi will always prioritise booting from the SDCard when one is present.

 

To set this up, you will need an SDCard in your Raspberry Pi that has the Raspbian OS on it. Inside the file located in:

 

/boot/config.txt

 

You need to set this option to the value ‘1’ :

 

program_usb_boot_mode=1

 

Then power on your Raspberry Pi with the SDCard inserted. That’s all there is to it. Once you’re in Raspbian, you can run the following command from the CLI:

 

> vcgencmd otp_dump | grep 17:

 

This should output the following:

 

17:3020000a

 

Now all you need to do is ensure your mSATA SSD has an OS on it, that it’s connected via USB and power up your Pi Desktop. If you’re unsure about these steps then you can read the following guide on the Raspberry Pi Foundation site:

 

https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

 

You can write the same Raspbian image to your mSATA SSD as you have done to your SDCard. You now no longer need the SDCard to boot your Raspberry Pi once this flag is set.

 

I've got a Pi Desktop sat on my desk here, if there's any further information you need, or believe I should elaborate on any part of this, then go ahead and ask by adding a comment and I'll do my best.

  • raspberry pi 3 ssd
  • rpiintermediate
  • ssd
  • raspberry pi 3 hard drive
  • raspberry_pi
  • setup ssd
  • pi desktop
  • raspberry pi 3
  • raspberry pi 3 setup
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • cstanton
    cstanton over 8 years ago in reply to DAB +3
    Both fortunately, and unfortunately, DAB, that's exactly what you have to do. Dive in. The hardware in its current state isn't going to change from needing the config file altering on the SDCard for that…
  • fvan
    fvan over 8 years ago in reply to DAB +2
    I agree with DAB, ease of use (or installation) is key. Look at the recurrent issues on Raspberry Pi, a lot of cases are about incorrectly flashed SD cards etc ... If that's already too difficult, this…
  • DAB
    DAB over 8 years ago +1
    Nice post, but what most of us want is to be able to just add the SSD and reboot. Until you can make it that easy, most of us are just too scared to dive in with our limited Linux skills. DAB
  • hellojohnson
    hellojohnson over 6 years ago

    Hei,

    Hi, I wanted to confirm if someone already figured out how to reboot from this board?

    https://www.aliexpress.com/item/X800-2-5-inch-SATA-HDD-SSD-Storage-Expansion-Board-for-Raspberry-Pi-3-Model-B/3279178926…

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • hoopsurfer
    hoopsurfer over 7 years ago in reply to lynnejohn

    I reproduced the failure, I have been testing using Berryboot as a solution for pidesktop that is VERY easy - nearly minimal steps after creating the Bootberry SD card and assembling the case.  Raspian and  Ubuntu MATE installed fine for me with that approach.  I'll add a summary at http://github.com/hoopsurfer/pidesktop.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • lynnejohn
    lynnejohn over 7 years ago in reply to lynnejohn

    I have placed a Raspbian stretch image to the KingSpec 64Gb mSata and booted without a sd card in place. When

    running etcher with the Raspbian image, the boot partition ends up being formatted as a FAT32. I then took

    the Ubuntu Mate image, placed it on the KingSpec mSata(using etcher), reformatted the boot partition as a

    FAT32 and put the files(from the original boot partition) back on and changed the boot partition

    cmdline.txt file to use a different "root=" value. This method is described here:

     

    https://www.dropbox.com/s/y1wgjd32npfsqif/RUN%20UBUNTU-MATE%20FROM%20USB.txt?dl=0

     

    This still did not work. I think minimally the Pi desktop instructions should specify the builds to be

    used in the imaging software. Currently the instuctions can give you the impression that any Debian

    based build will work. We want to run the Pi's as a manufacturing workstation so we are trying to

    use Ubuntu Mate as it has a more polished look.

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • lynnejohn
    lynnejohn over 7 years ago in reply to lynnejohn

    I've now imaged a Raspbian stretch image to a USB drive and the Pi boots without a sd card inserted. Does the latest Raspbian image use a disk format that is different from Ubuntu Mate?

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • lynnejohn
    lynnejohn over 7 years ago in reply to hoopsurfer

    Thanks for the link, it is a better description than I've seen before. Unfortunately I am still having no luck. If I place the sd card in and a imaged USB stick(Ubuntu Mate), the system boots fine. An sd card alone gives me the Raspberry Pi boot images on the screen, but nothing else happens.

     

    So what I can tell so far:

    1) My Pi Desktop and/or KingSpec msata card is having some type of issue. My windows PC sees the card fine when I use both USB cables and image the it. Have there been any hardware issues seen

              on the Pi Desktop v03?

    2) The Raspberry Pi will not boot straight away to a USB device even thought the boot bit has been set correctly. It seems like it needs a sd card in the slot(I've heard this said in other threads as well.)

              Are there any extra steps needed on a freshly imaged USB device to get it to work or could this have something to do with the image itself(it is Ubuntu Mate)?

     

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • hoopsurfer
    hoopsurfer over 7 years ago in reply to hoopsurfer

    https://github.com/hoopsurfer/pidesktop/blob/master/install.md has detailed explaination.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • hoopsurfer
    hoopsurfer over 7 years ago in reply to lynnejohn

    Once you configured boot from SSD (for RP3 Model B only - not needed for B+), image with etcher (using both USB ports (one or power, the other for data), no SD card is needed to boot from the SSD, you can use a blank SD to speed up boot times. If you use a SD with an OS on it you will confuse yourself because the SD will boot first.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • lynnejohn
    lynnejohn over 7 years ago

    As with many folks I've been having my share of issues trying to get a Raspberry Pi 3 (Model B v1.2), Pi Desktop(Rev03) and a KingSpec 64Gb mSata to boot without a sd card in the slot. I've been using Ubuntu Mate and imaging it to both the sd card and msata(via USB connection) on a windows PC using etcher(as recommended my the Ubuntu Mate community.)

     

    I have been able to image, boot and configure the Pi's usb boot mode bit(after upgrading Ubuntu Mate). Everything falls apart after unplugging the sd card and trying to boot using the msata card only. Because others have seen the behavior using Raspbian, I can only think it is something else.

     

    I am attempting to use method #2 from this link:

    https://github.com/pi-desktop/pi-desktop/blob/master/Boot-From-a-USB-Mass-Storage-Device/Boot-From-a-USB-Mass-Storage-De…

     

    What I may be missing is the changing the msata boot partition config.txt file. The link mentions "See this figure,the boot partition and root partition are all exist in the U disk:" as a reference for the exact name that needs to be placed in the config.txt file. My problem is I am not sure what they are talking about. Could someone suggest a simple command that I could run from the Ubuntu Mate cli to give be the name of the msata card that should be placed in the config.txt file?

     

    Thanks...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • hoopsurfer
    hoopsurfer over 7 years ago
    Model B+ Test Installs on Pi Desktop Case with Different SSDs

    After getting my hands on a Model B+, I was able to test it with the Pi Desktop Case using different SSDs, I used Raspian images and the imaging process took about 8 minutes, once installed here are boot/reboot times measured first without an SD card installed, then with a blank SD card installed. No cameras and the boot time was measured from pressing the power button to the first flash of the case LED - a feature of the pidesktop 1.1.4 release. The reboot time is from first flash of the case LED to case LED on - effectively when the reboot timer in the power MCU starts and ends.

    Raspberry Pi 3 Model B+ with Raspian Stretch 2018-03-13 - with and without a blank SD card

    mSATA SSD DeviceBoot Time to LED FlashReboot Time w/o SDReboot Time w/ Blank SDSamsung 860 EVO 250GB33.3 w/o SD, 27.9 w/SD30+s (reboot fails)27.7s-28.6s (fails sometimes)Kingston 120GB32.3s w/o SD, 27.2s w/SD30+s (reboot fails)26.4s-27.4sKingspec 64GB32.3s w/o SD, 27.2s w/SD30+s (reboot fails)26.8s-29.9s (fails sometimes)

    Raspberry Pi 3 Model B (Boot from USB Set) with Raspian Stretch 2017-11-29 - with and without a blank SD card

    mSATA SSD DeviceBoot Time to LED FlashReboot Time w/o SDReboot Time w/ Blank SDSamsung 860 EVO 250GB32.7s w/o SD, 28.7 w/SD30+s (reboot fails)27.8s-28.6s (fails sometimes)Kingston 120GB31.2s w/o SD, 26.2s w/SD30+s (reboot fails)25.9s-26.8sKingspec 64GB31.2s w/o SD, 26.2s w/SD30+s (reboot fails)26.3s-29.6s (fails sometimes)

    A Few Observations:

    • Note "Boot from USB" is enabled out of the box on the Model B+, however using a formatted blank SD card is still recommended.
    • None of the devices was able to reboot consistently without a blank SD card inserted.
    • The Kingston device has the fastest reboot times and so was less likely to fail to reboot.
    • While boot times were fairly consistent, reboot times vary more that would be expected. As noted in the results reboots did fail and when they did it is bacause the boot process takes too long and the reboot timer elapses and shuts off power. That timer is not always 30 seconds, in fact it seems more like 26s-27s when it does fail. When reboot does fail it seems to be after previous reboots, not a reboot after a cold start. I have reported what appears to be an underlying firmware bug.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • hoopsurfer
    hoopsurfer over 7 years ago

    For Pi day my project I took on the task of upgrading to the new Pi Desktop case configured to boot from the USB mSATA SSD.  I have forked and rewritten much of the supporting software and have simplified installation instructions. Note that while all the tools are provided, I haven't rewritten the documentation related to booting from an SD card.  I have made fixes to the systemd services since Embest does not appear to be maintaining the software and I have asked to get a copy of the firmware so we can make fixes there.  It works reasonably well as described.   Take a look at https://github.com/hoopsurfer/pidesktop  for the details and grab the .deb file if you want to give it a try.   Next up is getting a handle on reboot timing issues (one of the firmware bugs), testing with various brands of SSDs and testing with the new Model 3B+. 

     

    Happy Pi Day

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube