SD cards play a special role for Linux desktop users. Yes, they serve as a way to store photos or videos and get both onto your hard drive. They also provide a simple way to expand how many files you can carry on a laptop. But in many cases, these little squares of portable storage are what you need to turn your Windows or macOS machine into a Linux box in the first place.

There are multiple ways to configure and manage your SD cards, either from the command line or using a handful of graphical applications. Here's how you do it.

What Is a Partition Manager?

A partition is a region of digital storage space. This can be your entire hard drive, but this isn't always the case. Dual booters will have a portion dedicated to whichever Linux distribution is installed, and another allocated to Windows.

Some use partitions to keep their operating system separate from their personal files. Usually, there's also a separate partition for swap in Linux-based OSes.

A partition editor is a tool for managing these partitions. These are what you use to format SD cards, create new partitions, or make duplicates.

SD cards typically come with one partition, but you can break a 32GB card into two 16GB ones if you desire.

Here you can see the 32GB card inserted into a Linux computer running GNOME Disks.

GNOME-Disks-Partition

Memory cards are commonly assigned a simple device name like /dev/sda, /dev/sdb, or /dev/sdc. That's not always the case. Above, you see the significantly longer /dev/mmcblk0p1. If you were to use the command line, this is the location you would enter.

Another way to find the name is by entering into the terminal:

        mount
    

You will get a long list of results, so this approach is recommended for people who already have some idea of what they're looking for.

Some desktop environments and distributions come with their own partition editors. GNOME Disks (pictured above) integrates with the GNOME desktop, while KDE users may want the KDE Partition Manager. Many distributions still use GParted. All essentially do the same thing.

If you're looking for a single piece of software that doesn't require installing additional software and works across Linux distributions, dd is your best bet. This command-line tool makes backing up your SD card and writing an image a straightforward, one-line task. But you need to be careful because a single wrong command can wipe the contents of your entire hard drive.

Format an SD Card on Linux

Partition editors will generally give you an option to select a partition and format it into a new one. If you want to give away or recycle a card, you can opt to thoroughly erase all of its contents.

This process takes a while, so if you're merely looking to clear the data on a card so that you can put more stuff on it or intend to turn it into a bootable Linux drive, choosing the faster option is fine.

You have to choose a partition type when you do this. The FAT format will work across various desktop operating systems, and this is how most SD cards begin their life. Chances are, that is the option you want.

GNOME-Disks-Format-Partition

To wipe a card using the command line, we turn to dd. The command below will wipe all data from your card and replace it with zeroes. It's not impossible to recover data erased this way, but most people won't be able to.

        dd if=/dev/zero of=/dev/sdc
    

In dd commands, the if parameter determines the source of the data. The of indicates the destination. Here, we're copying zeroes onto /dev/sdc. Replace this with whatever location your computer assigns your card, as mentioned above.

After running this command, you may need to create a new partition. Maybe even two.

Create a Separate Partition

Creating a separate partition out of the one you're currently using is a risky way to lose data. To play it safe, back up your data and start fresh. Erase your current partition either by tapping the - icon or selecting the option from a menu. Then tap the + icon or select the corresponding menu option to create a new one.

Instead of using all of the available space, choose a new amount. Here you see space being created for two partitions of the same size.

GNOME-Disks-Separate-Partition

Repeat this process for as many partitions as you want to create.

If you want to do this from the command line, you can turn to fdisk to make the magic happen.

Back Up an SD Card on Linux

The most straightforward way to back up your SD card is to open a file manager and copy over the files into a folder on your computer. But this method admittedly isn't the best if you're looking to make identical copies or store numerous backups.

In that case, you want to create a partition image. Chances are, you can find this option in your partition editor.

GNOME-Disks-Create-Disk-Image

To do the same thing using dd, you will open a terminal and enter a line that looks like this:

        dd if=/dev/sdc of=sdcard.img
    

The command above backs up the contents of your SD card to an IMG file in your home folder, allowing you to restore an identical copy later on.

You need to have as much free space on your hard drive as the size of the SD card, meaning a 32GB card will consume 32GB on your computer. Waiting for the task to complete can take a while, and it will look like dd has stopped working. Just be patient.

Restore a Backup Image

When you're ready to restore your SD card, you will simply flip the two destinations in the dd command.

        dd if=sdcard.img of=/dev/sdc
    

In a partition editor, you use the option to restore an image. This will prompt you to select an image you've previously created to write to your SD card.

GNOME-Disks-Restore-Disk-Image

Create a Bootable SD Card on Linux

To boot Linux from an SD card using dd, first, download the image of the Linux distribution you're looking to test or install. Then insert the path to that file as the if parameter, just as you would when restoring an SD card. For example:

        dd if=/home/user/Downloads/parabola-2015.11.11-dual.iso of=/dev/sdc
    

This is the last of the dd commands we're covering here. Just know, dd is powerful enough to clone your entire hard drive, even if you're moving terabytes of data.

When you're ready to tackle more advanced commands, you can find a list over on the dd Wikipedia page. But again, be careful. You do not want to enter these in a hurry.

If you want to avoid the command line, search your distribution's package manager for a live USB stick creator. Ubuntu has the Startup Disk Creator. Fedora has the Fedora Media Writer. These and other distributions work with Etcher.

Related: How to Make a Bootable USB Drive with Etcher in Linux Using one of these tools, you select the Linux image you wish to install (or have the application download one on the spot) and designate your SD card as the target device.

SD Cards: Versatile and Compact

SD cards have many advantages over flash drives. They're thinner, lighter, and easier to carry in bulk. Since they typically sit flush with the side of a computer, it's possible to plug them in full-time in a way you can only do with the tiniest of flash drives, and they still protrude less.

If you prefer flash drives, that's fine too. The tools for managing one typically work with the other.