Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to fix the problem of USB disk drive in Linux terminal

Shulou Source: shulou.com Published: 2022-06-01 06:12:09 09月14日 Update

This article will explain in detail how to repair the USB drive in the Linux terminal. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Use fsck to remove bad blocks from USB drives

The easiest way to repair flash drives or other types of drives in Linux is to use the fsck tool, which is a powerful tool for removing bad blocks, solving "unreadable" problems, and fixing most file system problems. Before that, however, you need to use the lsblk command to determine the U disk, which lists all the disks connected to the current Linux system.

To delete bad file blocks, execute the fsck command on a specific partition (such as / dev/sdc1) or an entire disk (such as / dev/sdc), and once done, you will get a healthy Linux partition.

Clear USB drive

When it appears that the U disk is completely unreadable and the data in it is worthless, the fix for * * is to use the dd command to completely zero the U disk.

Similarly, use the lsblk command to find the U disk, and then use a command similar to the following to clear the zero:

Sudo dd if=/dev/zero of=/dev/sdb

After the zeroing operation is completed, you need to repartition the disk with fdisk or other tools, and then select the following command to format it for normal use:

FAT32

Sudo mkfs.msdos-f 32 / dev/sdb1

EXT4

Sudo mkfs.ext4-f / dev/sdb1

NTFS

This is the end of the sudo mkfs.ntfs-f / dev/sdb1 article on "how to fix the USB drive problem in the Linux terminal". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Commands problems drives drivers tools disks articles terminals that is files more systems good practical powerful healthy content methods data articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno Shulou Information macOS MariaDB