element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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 13565 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 9 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 9 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 9 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
  • r_mac
    r_mac over 8 years ago in reply to cstanton

    BerryBoot is similar to NOOBS. It is a minimal boot that allows you to install various operating systems and then choose which one you want to use at startup.

    Link to download page: BerryBoot v2.0 - bootloader / universal operating system installer

    I am going to follow the steps in the Original Post today and see if I can get it working. I want to have available; 2017-11-29-raspbian-stretch and also Octoprint / Octopi for controlling a 3D printer. Plus other operating systems for experimental purposes.

    I have four 32GB SanDisk Ultra Fit flash drives and could set each one up with a separate operating system and use the mSATA as storage, but would prefer to keep at least one USB port open on the element14 Desktop.

    There are some steps in the OP that I haven't tried yet, maybe something will happen today.

    thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • cstanton
    cstanton over 8 years ago in reply to r_mac

    I'm not familiar with BerryBoot, do you have more information about it and which particular version of it you're using? I'm assuming there's different versions, I mean I could google for it however I then run the risk of finding something different to what you're using or a different setup entirely.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • r_mac
    r_mac over 8 years ago

    I'm just getting started with a RPi 3 and was reluctant to join another 'Community' in my quest for help in setting up the element14 desktop. But, from what I've read here so far, I think this might be the best source for getting help.

    I want to boot from a mSATA (Samsung 850 EVO 120GB) mounted on the hat card in an element14 Desktop using BerryBoot. It doesn't seem this will work because I haven't figured out how to get the “pidesktop-base.deb” installed for BerryBoot.

    Is this possible? If so I would greatly appreciate advice about how to accomplish it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rapibus
    rapibus over 8 years ago

    I had everything in place, the SSD partitioned  and then the SD card (cheap quality) went dead and had to be replaced. Before continuing the setup I'd like to empty the SSD completely but I'm not yet knowledgeable enough (it is my first SSD experience) to know how to do this. I have connected the SSD to a Ubuntu machine and I can read the SSD with GParted. So any help will be most welcome. TIA

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • cstanton
    cstanton over 8 years ago in reply to etsbne

    I'm thinking that it's either a fault with the HAT add-on, or the mSATA SSD you're using is pulling more power than it expects and so it's starving the USB of power.

     

    david-foo would be the best person to ask, next to our technical support or returning the product: http://bit.ly/2bhcbpN / http://bit.ly/2eeQGGo

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • etsbne
    etsbne over 8 years ago in reply to cstanton

    OK. I have tried all that. It seems like the only thing left was the .deb. But I ran dpkg with -r and then -P. Now when I run dpkg -l | grep 'pidesktop-base' I get no output. Gone.

     

    Still wont reboot or boot w USB attached.

     

    Its like it can't shut down fully. It gets to a state with the red Pi LED on constant and stays there. Same thing at boot only now the hat's blue LED stays lit too. Like power is getting to the Pi and hat from the powered USB hub because if I unplug the Hat power supply and leave the USB hub attached the LED's stay lit.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • cstanton
    cstanton over 8 years ago in reply to etsbne

    Have you done a:

     

    dpkg -l | grep 'pidesktop-base'

     

    To ensure it's removed? It's usually a good idea to do -r and -P with dpkg to make sure it's removed and purged.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • etsbne
    etsbne over 8 years ago in reply to cstanton

    sudo apt-get purge pidesktop-base

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • cstanton
    cstanton over 8 years ago in reply to etsbne

    What's the command that you've used to remove the package?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • etsbne
    etsbne over 8 years ago in reply to cstanton

    The SSD is a Samsung 850 EVO mSATA 250 GB

     

    It behaves the same with or without the package as far as not booting with USB devices attached

    • 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube