Linux is a free and open-source operating system evolving from the UNIX operating system. It was first released by Linus Torvalds in 1991. It has become the most popular UNIX-like operating system due to its stability, security, and flexibility.
However, a great many people are unclear about some operations on Linux, such as “access Linux files from Windows”, “how to install Linux on Windows”, and the one discussed here. How to do an SD card health check Linux? Let’s keep reading.
Can Linux Check SD Card Health
Can you check SD card health Linux? Of course, yes! Linux provides some commands and tools to help check the health of an SD card, such as the fsck command, smartmontools, etc. You can use them to monitor the read and write errors, bad sectors, and file system errors on the SD card.
How to Do an SD Card Health Check Linux
Here we will show you how to perform an SD card health check Linux with the following 4 ways. You can try them in order or choose one that works best for you.
Way 1. Run the fsck Command
The fsck (file system check) is a command line tool built into most Linux-based operating systems. It can be used to check and repair the integrity of a file system on storage devices, including SD cards. With this command, you can fix any file system errors caused by improper handling or unexpected shutdowns.
Step 1. Start your Raspberry Pi computer and click on the Terminal icon at the top menu bar to access the Command Line. Also, you can select Menu > Accessories > Terminal or press Ctrl + Alt + F1 keys to open the Command Line window.
Step 2. In the pop-up command prompt window, type the following command and press Enter. Here you need to replace X with the drive letter of your SD card and “1” represents the partition number of your SD card. (e.g., sudo fsck /dev/sdb1)
sudo fsck /dev/sdX1
Step 3. Run the following command to check and repair the file system integrity of the SD card.
sudo fsck -V /dev/sdX1
Way 2. Run the dd Command
The dd command is also an SD card health checker Linux that can be used to write data to partitions and disks. Here you can follow the guide below to check SD card health Ubuntu.
Step 1. Open the Terminal command again as we showed above.
Step 2. Type the following command and press Enter. Here you should replace dev/sdb with the device name of your SD card. Then this command will write zeroes to the first sector of your SD card, which can remove the data that may cause errors on the card.
sudo dd if=/dev/zero of=/dev/sdb bs=512 count=1 conv=notrunc
Way 3. Use the Smartmontools Package
The smartmontools package is a set of applications that can test hard drives and read their hardware SMART statistics. It can be used to check SD card health Ubuntu. Here’s how to check SD card in Linux using the tool.
Step 1. Download Smartmontools from its official website and install it on your Linux system.
Step 2. Insert the SD card into your Linux and open the Terminal command.
Step 3. Type the following command and hit Enter. Here you need to replace /dev/sdb with the device name of your SD card.
sudo smartctl -a /dev/sdb
However, if you are unfamiliar with these commands, using a professional SD card health checker is a better choice.
Way 4. Use a Professional SD Card Checker
According to the above information, you may find the SD card health check commands are not easy to run on Linux. So, we highly recommend you use a free and comprehensive disk checker – MiniTool Partition Wizard. It can help you easily test SD card speed, and repair file system errors, and check bad blocks, on SD cards.
MiniTool Partition Wizard FreeClick to Download100%Clean & Safe
Step 1. Take out the SD card from your Linux system and insert it into a Windows computer.
Step 2. Launch MiniTool Partition Wizard to enter its main interface and click on Disk Benchmark from the top toolbar. Then select your SD card from the drop-down menu and click Start.
Step 3. To check file system errors, select the SD card from the disk map and click on Check File System from the left action panel. Then select Check & fix detected errors option in the pop-up window and click on Start.
Step 3. To check bad blocks on the SD card, select the drive and click on Surface Test from the left panel. Then click on Start Now to start the check. If any blocks are marked with red color, it indicates there are bad blocks on the SD card.
How to do an SD card health check Linux? We have introduced the top 4 methods above. If you have any better ways to check the health of SD card Linux, please leave them in the following comment area.