How To Check SD Card in Linux - 6 Easy Methods

Reading time icon 3 min. read


Readers help support MSpoweruser. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help MSPoweruser sustain the editorial team Read more

how to check sd card in linux

Wondering how to check SD card in Linux?

As a Linux user, sometimes you may want to make sure that your SD card is functioning properly or diagnose issues with it if any.

In this guide, I’ll discuss some easiest methods for checking the status, filesystem integrity, and partition details of the SD card in Linux.

So, let’s go!

How To Check SD Card in Linux

To check SD cards in Linux, you can use:

1. Using the lsblk Command

In Linux, the lsblk command is used to list blocks on the system. This includes partitions, hard drives, and removable devices, such as USB drives and SD cards.

Moreover, you can use it to retrieve information related to device names, sizes, and mount points.

Now, I’ll press CTRL+ALT+T to open my terminal, type “lsblk” and hit Enter.

running lsblk command to check sd card in linux

Notably, in the output, SD cards typically appear as devices starting with “/dev/sd“, followed by a letter like /dev/sdb, /dev/sdc and their TYPE would be “disk” or “mmcblk“.

2. Using the fdisk Command

fdisk is a popular command-line tool used for disk partitioning in Linux. It enables you to create, modify, view, and delete partitions on a storage device.

In addition, you can also use fdisk to check SD cards on your system.

To do so, run the “sudo fdisk -l” command in your terminal.

running fdisk command to check sd card in linux

Here, adding the “-l” option tells fdisk to display the detailed information on the terminal.

3. Using the dmesg Command

The Linux dmesg command displays kernel ring buffer messages. Specifically, it offers real-time information about device drivers, hardware, and system events.

However, you can also use it to verify the attached SD cards on your system.

For this, execute the “sudo dmesg | grep -i sd” command in your terminal.

running dmesg command to check sd card in linux

In the “sudo dmesg | grep -i sd” command, dmesg retrieves the kernel messages and passes the output to grep for filtering the lines containing “sd“.

Ultimately, you’ll see the information related to your storage devices, such as hard drives or SD cards.

4. Using the df Command

df shows the amount of disk space available on your mounted filesystem. Additionally, it provides details, such as used and available space, and the total disk space of each filesystem.

For instance, you can run the “df -h” command to check the space information related to your filesystem, including the SD card.

running df command to check sd card in linux

5. Using the fsck Command

fsck command is used for checking and repairing filesystems. It scans and fixes the inconsistencies on the filesystem to prevent potential errors.

You can also use fsck command to check the SD card and get a report of the number of files found.

To do so, run “sudo fsck /dev/sdaX” and replace X with the letter representing your SD card on the system.

running fsck command to check sd card in linux

6. Using the blkid Command

Another command-line utility on my list is blkid. This tool displays information about block devices, such as their Universally Unique Identifiers (UUIDs) and other attributes.

Moreover, it also assists you in identifying devices like SD cards and their filesystem types.

Now, I’ll simply run “blkid” in my terminal.

running blkid command to check sd card in linux

You may also be interested in:

So now you know how to check SD card in Linux. Feel free to share which method you liked the most in the comments below!

More about the topics: linux, sd cards