Ubuntu

How do I Check and Access Files on my SD Card in Linux/Ubuntu?

How do I Check and Access Files on my SD Card in Linux Ubuntu

An SD Card is a storage drive that is widely used in various devices like Cameras and Phones. SD Cards are portable storage devices providing a high data transfer rate. SD Cards can also be used in Linux Distributions like Ubuntu for file and data transfer.

This article discusses the process of how you can access the SD Card files in Linux-based Ubuntu.

How Do I Check and Access Files on My SD Card in Linux/Ubuntu?

Linux offers many ways to do different tasks related to SD cards. There are different methods you can use to access the files, check their status, and verify the file system integrity of your SD Card in Linux.

Method 1: Use the “lsblk” Command to Check the Mounted SD Card

The “lsblk” command lists the device storage and any secondary storage device like SD Cards attached to your System. The “lsblk” command is used as:

lsblk

This will show the storage type, size, name, and “MOUNTPOINTS” of your storage devices:

Using the same above command, once you Insert the SD Card, you can see it in the list:

Method 2: Use the “fdisk” Command to Check Mounted SD Card

The “fdisk” command allows us to view and manipulate the primary and secondary storage devices on our system. To list all the devices, enter the command:

sudo fdisk -l

This will display all the partitions and their file system as well:

Scroll down in the list and you can find your SD Card in the “Devices” with the path “/dev/sdcX”. The “X” varies from system to system:

Here we have our SD Card details having a size of 3.7GB and a file system of FAT32. To check the complete details of our SD Card, use the command:

sudo fdisk -l /dev/sdc

The “sdc” can vary on your system, for now running the command will give additional details:

Method 3: Use the “fsck” Command to Check Mounted SD Card

The “fsck” command can also be used to check for mounted devices on your Ubuntu system using the command:

sudo fsck

It will also detect and fix file system errors if they happen. To check for any file system errors in your SD Card, run the command:

sudo fsck /dev/sdc1

The “sdc1” can vary on your system. Once the command executes, the details will be displayed:

If the SD Card is not properly unmounted or it has some issues, it will ask for some actions to be performed. These actions are asked in a sequence and depending on your choice, you can improve the integrity:

Method 4: Use the GUI to Check the Mounted SD Card and Files on the SD Card

The SD Card Mounted can be seen on the left side taskbar as well as in the shortcuts menu. In our case, it is displayed as “New Volume”:

Click on the New Volume Drive to access the SD Card. Once clicked, you will see the SD Card files Window:

You can access the files and directories in the SD Card from here now.

How to Access Files on the SD Card in Ubuntu?

To access the files on your SD Card once it is mounted and you can see it on your terminal after running the commands above, create a Folder and then mount that directory. For a detailed explanation of how to create a mount point and then mount the SD Card to it, read the step-by-step procedure here: Mount SD Card in Ubuntu.

Once the SD Card is mounted, navigate to the “mnt” directory using the “cd” command:

cd /mnt

Once you are inside the directory, use the command below to list and access the files on your SD Card:

ls

This will display all the files on your SD Card and you can access them:

Now we can access the files in the SD Card. For instance, to access the file “Log.txt” in the above list, use the command:

nano Log.txt

This will open the “Log.txt” file in the nano editor:

That’s all about checking and accessing the files on the SD card in Ubuntu.

Conclusion

To access files, check the status of SD Cards, and verify the integrity of your SD cards. For this purpose, you can use different approaches in Ubuntu, such as using the “lsblk” command, the “sudo fdisk -l” command, GUI, etc. In this article, we have seen how by verifying the presence of an SD Card using different methods, we can access files and folders in our SD Card.

Similar Posts