Table of contents
1.
Introduction
2.
A Brief About Linux Operating System
3.
What is an SD Card in Linux?
4.
Commands to Check SD Card in Linux
4.1.
1. lsblk Command
4.2.
2. fdisk Command
4.3.
3. dmesg Command
4.4.
4. df Command
4.5.
5. fsck Command
5.
Why Check SD Card in Linux?
6.
Frequently Asked Questions
6.1.
How do I check my SD card?
6.2.
How do I find my SD card ID in Linux?
6.3.
What is the SD command in Linux?
7.
Conclusion
Last Updated: Feb 27, 2025
Easy

How to Check SD Card in Linux?

Author Rinki Deka
1 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Linux is an operating system that is known for its versatility and powerful command line interface(CLI). It provides various tools to manage software and hardware components easily. It is also known for managing SD cards safely. 

how to check sd card in linux

In this article, we will discuss about how to check SD card in Linux. Firstly, we will discuss about what Linux is. Then we will understand what an SD card in Linux is. Then later in this article, we will discuss all the commands that are used to check SD card in Linux. 

So, let's get started!!

A Brief About Linux Operating System

Linux is an open-source operating system like Windows, Mac, etc. It serves as the core foundation of various operating systems, and we can call them Linux distributions. There are some popular Linux distributions such as Debian, Ubuntu, CentOS, etc. Each of these Linux distributions comes up with several features and functionalities. 

Linux Operating System

Linux operating system is famous for its security features. It is also known for its robustness and versatility. This makes it a popular choice for a variety of applications. It is also helpful in managing hardware components like SD cards.

What is an SD Card in Linux?

SD card stands for Secure Digital card. It is a removable storage device. It uses flash memory technology to store the data in it. It is mainly used to expand the size of any storage device. It is a portable device. It can be used in cameras, mobile phones, tablets, etc. This is one of the best ways to store our data. 

In Linux, an SD card can be used as a block device, such as a hard drive. If we have valid permissions, then, in Linux, we can perform read, write, and manage our data on the SD card.

**Now, you might be wondering how to check SD card in Linux. Let us discuss some commands that we can use to check an SD card in Linux.

Commands to Check SD Card in Linux

There are several commands to check an SD card in Linux:

1. lsblk Command

The lsblk command is used to list all available block devices. This will also include our SD card. We can run this command in our CLI. We will see a list of all devices in which we will also see information like their sizes and mount points. If we write this command in our CLI, 

lsblk

 

We will be getting the following result:

lsblk Command

Now, we can check if we have connected our SD card with the system, it will be visible here. 

2. fdisk Command

The fdisk command is used to view the partition layout of our SD card. We can use fdisk -l /dev/sdZ. We need to replace “Z” with the appropriate letter for our SD card. We can see detailed information about the partitions on the card. So, suppose our SD card is present in sda, we can write this command in our CLI

fdisk -l /dev/sda

 

We will be getting the following result:

fdisk Command

After executing the command, we will get information about the particular disk.

3. dmesg Command

The dmesg command is used to display kernel messages. This will also include information about recently connected devices like an SD card. We can run the dmesg | tail command in our CLI, and it will show the last few lines of kernel messages. If we write this command in our CLI

sudo dmesg|tail

 

We will be getting the following result:

dmesg Command

Now, we can check if any SD card is recently connected.

4. df Command

The df command is used to see the disk space usage. We can see the usage of our mounted file system by this command. This will also include our SD card if it's mounted. If we write this command in our CLI

df

 

We will be getting the following result:

df Command

Now, if we have our SD card connected, it will show here in this list.

5. fsck Command

fsck stands for file system consistency check. The fsck command is used to check and repair the file system on a storage device, such as a hard drive or a partition. Now, if we have our SD card in sda, then we can write the command in our CLI

sudo fsck /dev/sda1

 

xWe will be getting the following result:

fsck Command

Now, we can see the number of files and clusters if we have connected our SD card.

**Note: We are not currently using any SD card, so if you have an SD card, then you can check your SD card by writing above mentioned commands.

**Now you might be thinking, why do we need to check an SD card in Linux? 

Why Check SD Card in Linux?

There are several reasons to check an SD card in Linux:

  • Data Verification: If we verify an SD card in Linux, then we can make sure that the data on it is intact. We can also check that data hasn't been corrupted
     
  • Mounting: We know that before using an SD card, we need to mount it. So, if we check an SD card on Linux, then we can make sure that it's properly recognized and ready to be mounted
     
  • Troubleshooting: If we face any issue with our SD card, then we can check it using Linux commands. This will help us to identify problems and potential solutions

Frequently Asked Questions

How do I check my SD card?

You can check your SD card by connecting it to your system and using the disk management tool or file explorer.

How do I find my SD card ID in Linux?

Use the command lsblk -o NAME,SERIAL or udevadm info /dev/sdX to find the SD card's unique serial ID in Linux.

What is the SD command in Linux?

The SD command in Linux refers to commands like lsblk, fdisk, or df used to manage and display information about storage devices.

Conclusion

We have discussed how to check SD card in Linux. We have also explained commands to check the SD card in Linux with the help of screenshots. If you want to learn more about Linux, then you can check out our blogs:

Live masterclass