Removing bad blocks from the USB drive with fsck
An easy way to repair a flash drive, or any drive really, is to use the fsck tool. This tool is great for removing bad file blocks, as most (if not all) corruption and unreadability comes from problems like this. To remove the corrupted file blocks from the USB flash drive, open a terminal window and enter the following commands.
Users must figure out what the drive designation is on the system before things can move forward. Do this by entering the lsblk command. This will list all of the attached disks on your system.
lsblk
Note: the lsblk command lists all disks, not just USB drives. Pay close attention to the output, as it is easy to mistake a hard drive for a flash drive.

To remove the bad file block, run the fsck command on either a specific partition (e.g. /dev/sdc1), or the entire disk (e.g. /dev/sdc). Once completed, the USB drive will have a healthy partition again and be fully operational on Linux.
sudo fsck -n -f //不属于本文
sudo fsck /dev/sdc1
Note: this tutorial assumes that the flash drive is /dev/sdc (or /dev/sdc1). Users may have different labels for their flash drive on their system.

Zeroing the USB drive
Sometimes a USB drive can be totally unreadable to the point where it is no longer worth saving. When this happens the best route is often to just zero out the data and start over. The best tool for the job in this situation is dd, and it works quite well.
Start by taking the drive label that was found earlier with the lsblk command, and apply the same logic (remember that /dev/sdc1 is a partition, and /dev/sdc is an entire device).
sudo dd if=/dev/zero of=/dev/sdc
Making a new file system

Zeroing a USB drive (or any device for that matter) renders the data on it totally useless. This means that you’ll need to create a new data partition. Choose a file system, and then run the command!
Fat32
sudo mkfs.msdos -f 32 /dev/sdc1
Ext4
sudo mkfs.ext4 -f /dev/sdc1
NTFS
sudo mkfs.ntfs -f /dev/sdc1
Conclusion
USB flash drives are useful devices. They make it easy for people to easily transfer data from one computer to the other, regardless of the operating system it’s running. That’s why it’s so important to know what to do when the drive is no longer accessible. Luckily, Linux ships with some really useful tools that make saving a flash drive quite easy.
Image credit: CES Thumb-Drive Style Press Kits
https://www.fosslinux.com/1532/create-a-boot-repair-live-usb-disk-drive-in-ubuntu-linux-mint-and-elementary-os.htm
Removing bad blocks from the USB drive with fsck的更多相关文章
- [OrangePi] Booting from USB drive
You can also boot from USB drive partition. The file named cmdline.txt must exist on BOOT (fat) part ...
- Does anyone successfully use USB drive in Windows7 guest?
Hi, Does anyone successfully use USB drive in Windows7 guest? If I pass a USB drive to Windows7 gues ...
- How to Mount a USB Drive in Ubuntu
Read more : http://www.ehow.com/how_6762235_mount-usb-drive-ubuntu.html Most USB drives will automou ...
- Is Usb Drive () ? DeviceIoControl, IOCTL_STORAGE_QUERY_PROPERTY
http://banderlogi.blogspot.com/2011/06/enum-drive-letters-attached-for-usb.html typedef enum _STORAG ...
- How to match between physical usb device and its drive letter?
struct tagDrives { WCHAR letter; WCHAR volume[ BUFFER_SIZE ]; } g_drives[ ]; // WCHAR GetUSBDrive( ) ...
- Install Slax on USB device (Slax U 盘安装)
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outsta ...
- LPC18xx LPC43xx LPC4370 Bootrom USB DFU FPB - Flash Patch and Breakpoint Unit
What is the difference between a Bootrom vs bootloader on ARM systems Bootrom Bootrom (or Boot ROM) ...
- 用UNetbootin来安装USB LINUX,好像比ULTRA ISO省事
UNetbootin can create a bootable Live USB drive, or it can make a "frugal install" on your ...
- fuel iso光盘刻录机usb Driver 烧录
ISO image to a DVD or burn the IMG file to a USB drive For a bare-metal installation ipmitool, HP iL ...
随机推荐
- ASP.NET Web配置指南
利用ASP.NET,可以指定影响服务器上所有的Web应用程序.仅影响单个的应用程序.影响个别页面.或影响Web应用程序中的个别文件夹的配置设置.可以对编译器选项.调试.用户身份验证.错误消息显示.连接 ...
- AmazonOrder xml web语义化
XML Processing Modules — Python 3.7.1 documentation https://docs.python.org/3.7/library/xml.html#xml ...
- 学习计划 nginx 中 php的配置详解
本章只看一个刚下载的nginx是如何支持php的 -- location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_inde ...
- MongoDB的"副本“数据库服务器
1.假设1数据库服务器为活跃服务器(主服务器),2和3为备份服务器,当1出现故障的时候,那么会在2和3中推选出一个(根据权重的等规则)作为活跃服务器,而当1又恢复正常了之后呢,它将以备份服务器的身份出 ...
- 使用QT设计师-信号和槽signal-slot(第一弹)
自定义信号和槽的步骤: 1.定义信号---signal1 = pyqtSignal() 2.定义槽信号---def setSlot(self): 3.连接信号和槽函数---signal1.connec ...
- oracle(一)复习起航
住了三年的宿舍,前几天不得不搬走.也断了好几天网,所以顺手拿了本以前买的<oracle编程艺术>,感觉翻译的书就是有些地方读起来不通顺,好吃力. 还好以前有点oracle经验,不然真看不懂 ...
- 前端 HTML 简介
HTML HTML是一个网页的主体部分,也是一个网页的基础.因为一个网页可以没有样式,可以没有交互,但是必须要有网页需要呈现的内容.所以HTML部分是整个前端的基础. HTML,全称是超文本标记语言( ...
- HBase-0.95.1源码分析之split
split操作执行的是将HBase中较大的Region分为两个.因为split比较耗时,因此split是在独立的线程中完成的,相关类是CompactSplitThread. 首先,CompactSpl ...
- Java-SpringMvc-响应Html代码展示
代码 @RequestMapping(value = "/test.do", method = {RequestMethod.GET}) public void test(Http ...
- 用Servlet获取表单数据
用Servlet获取表单数据 在webroot下新建userRegist2.jsp 代码如下: <%@ page contentType="text/html;charset=gb23 ...