The CIRCUITPY Drive

When CircuitPython finishes installing, or you plug a CircuitPython board into your computer with CircuitPython already installed, the board shows up on your computer as a USB drive called CIRCUITPY.

The CIRCUITPY drive is where your code and the necessary libraries and files will live. You can edit your code directly on this drive and when you save, it will run automatically. When you create and edit code, you'll save your code in a code.py file located on the CIRCUITPY drive. If you're following along with a Learn guide, you can paste the contents of the tutorial example into code.py on the CIRCUITPY drive and save it to run the example.

CircuitPython looks for code.py and runs the contents of the file automatically when the board starts up, reloads, or when you save changes to the file. This is what makes it so easy to get started with your project and update your code!

Working with Multiple Devices

There are many boards that work with CircuitPython. You may find yourself in a situation where you're working with more than one board at the same time. What happens when you have multiple boards plugged into your computer? You have multiple CIRCUITPY drives! How do you know which one is which? You can rename each CIRCUITPY drive to avoid confusion.

Renaming CIRCUITPY

When you rename CIRCUITPY, it writes the name to the filesystem. This means that the name change will persist through disconnecting the board, as well as reloading CircuitPython!

The name must be 11 characters or less! This is a limitation of the filesystem. You will receive an error if you choose a name longer than 11 characters.

Renaming CIRCUITPY on Mac

Renaming your CIRCUITPY drive on Mac is simple. Click on the drive in Finder so you can see the contents. Then, right click on the drive in Finder and choose "Rename".

Once you click "Rename", in the right-click menu, the drive name will show up in a text box where you can rename the drive. Type in the new name.

Renaming CIRCUITPY on Windows

Renaming the CIRCUITPY drive on Windows is easy. Open File Explorer and find the CIRCUITPY drive. Right click on it, and click "Rename".

Renaming the CIRCUITPY drive on Windows is easy. Open File Explorer and find the CIRCUITPY drive. Right click on it, and click "Rename".

You can also rename the drive through the "Properties" menu, which can be opened several different ways through the Windows File Explorer, including right clicking on the CIRCUITPY drive and choosing "Properties".

Once you click "Rename" in the right-click menu, the drive name will show up in a text box where you can rename the drive. Type in the new name.

Renaming CIRCUITPY on Linux

Renaming CIRCUITPY on Linux requires a couple of steps. You'll need to identify the mount point, and then run a command to rename the drive.

Open a terminal program. Run the following to find out where your board is mounted:

Download: file
df | grep CIRCUITPY

You will see CIRCUITPY on the right end of the resulting line. The dev/foo (where foo is the name of the mount point) on the left end of that line is the mount point.

Next you can run the following to unmount the board, replacing foo with your specific mount point.

Download: file
sudo umount /dev/foo

To rename the board, run the following:

Download: file
sudo fatlabel /dev/foo NEW_NAME

Then, eject your board, unplug it, and plug it back in to force it to remount with the new name.

To check to see if it worked, look for the drive in your file manager. Or, you can run the following:

Download: file
df | grep NEW_NAME

Renaming CIRCUITPY through CircuitPython

You can also rename the board using CircuitPython. Create a new file on your CIRCUITPY drive called boot.py. Copy the following code into the new boot.py file:

Download: file
import storage

storage.remount("/", readonly=True)

m = storage.getmount("/")
m.label = "NEW_NAME"

storage.remount("/", readonly=False)

Eject your board, and reboot the board either by pressing the reset button once, or unplugging it and plugging it back in. After a moment, it should show up in your file explorer with the NEW_NAME you chose for it! You can delete boot.py after the newly named board shows up in your file explorer.

Reverting to CIRCUITPY

You can follow the same processes above to rename the drive back to CIRCUITPY.

You will also revert to CIRCUITPY by erasing the filesystem. If you are in a situation where you need to erase the filesystem on your CircuitPython board, the drive name will revert to CIRCUITPY on completion.

This guide was first published on Dec 19, 2017. It was last updated on Dec 19, 2017. This page (The CIRCUITPY Drive) was last updated on May 25, 2019.