Linux проверка флешки на ошибки linux как проверить физические показатели?

Along the way to today, this thread raised some questions.

-How long will this take (implied by discussion of letting it run overnight).

Here is my console command line at 33% completion:

Testing with pattern 0xaa: 33.35% done, 49:47 elapsed. (0/0/0 errors)

and again later:

Testing with pattern 0xaa: 54.10% done, 1:17:04 elapsed. (0/0/0 errors)

Next came this segment:

Reading and comparing: 43.42% done, 2:23:44 elapsed. (0/0/0 errors)

This process repeats with oxaa, then 0x55, 0xff, and finally 0x00.

ArchLinux gave an unqualified statement:

For some devices this will take a couple of days to complete.

N.B.: The testing was started about 8:30 p.m., testing had completed before 8:45 a.m. the next day, completing in about 12 hours for my situation.

-Destructive testing isn’t the only method possible.

Wikipedia offered this statement:

My current distro man page confirms the -n is nondestructive.

-n Use non-destructive read-write mode. By default only a non-
destructive read-only test is done.

And finally that
it isn’t worth it. statement.

A summarizing statement, based on the situation of billions of memory sites in a flash chip, a failure is a cell that has already been written and erased tens of thousands of times, and is now failing. And when one test shows a cell has failed, remember that each file you added and erased is running up those cycles.

It’s your data.

Everyone has a flash drive. They’re great little things, and they make moving data around easy. However, sometimes flash drives can get corrupted or just flat-out quit working. Thankfully, if you’re using Linux, you already have access to an array of tools that can help you fix the problem. We are using Ubuntu for this tutorial, but everything applies to most modern Linux distributions. Here is how you can repair a corrupted USB drive in Linux.

:/>  Настройки tcp ip windows 7

In this article, we prioritize the safety of your data. First, you’ll see how you can back up your flash drive’s contents and then proceed to various fixes for the problem at hand. This way, if an attempt at fixing the problem ends up making it worse, you may still be able to revert to the snapshot of the current state of your flash drive.

Take a Compressed Full Backup Image

In Linux, there are many tools for backing up any storage device. However, the tried-and-tested approach relies on dd and GunZip (better known as gzip).

1. To make a backup of your flash drive, first connect it to your computer. Fire up your favorite terminal (or press CTRL+Alt+T).

2. Locate your flash drive:

4. To back up your flash drive to an image file compressed with ZIP in a single command, use:

5. To restore the backup, you’ll have to reverse the two commands’ sequence and define your flash drive as the output device. The full command will look like this:

Fix Corrupted Filesystem with FSCK

For this command, you’ll have to define the partition instead of the full drive. You’ll find it with a similar name as your device by issuing:

Then, run fsck on it with:

fsck devdiskby-idYOUR_FLASH_DRIVE-PARTITION-TO-CHECK

In this command:

Format USB Drive with Fdisk/MKFS from the Terminal

If fsck didn’t manage to repair the device’s filesystem, you can try to format it to use it as if it is new.

1. The first step is to erase any existing filesystem structures and recreate them from scratch. You can use fdisk for this. Run it with sudo on your device with:

:/>  HDD Scan показывает BAD в самом конце и все еще на разных LBA [Архив]

5. Your partition will be unformatted, and since it won’t have a filesystem yet, it will be unusable. To create a filesystem, you can use one of the mkfs tools that come with all modern Linux distributions. To format your partition as FAT32, usable by most devices, use:

mkfs.fat devdiskby-idYOUR_FLASH_DRIVE-PARTITION

6. To format your partition with NTFS, for use with modern versions of Windows, or with EXT4, for use only with Linux, use:

The GUI Way to Check and Fix USB Drive with Disks

If you don’t like typing commands, you can turn to the Disks tool for checking and formatting your USB drive. Disks is pre-installed on Ubuntu.

1. Visit your apps menu and search for “disks.” Launch the app when you locate it.

4. Enter a name for your USB drive in the Volume Name field and choose from the three most popular filesystems for it:

  • Ext4 for use with Linux
  • NTFS for use with modern versions of Windows
  • FAT for use with both, as well as other types of devices (from smartphones to gaming consoles)

Rejuvenated USB Drive

OK’s real life started at around 10, when he got his first computer – a Commodore 128. Since then, he’s been melting keycaps by typing 24/7, trying to spread The Word Of Tech to anyone interested enough to listen. Or, rather, read.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Способ проверки, используя программы, которые уже есть в Linux по умолчанию.

Подключаем и монтируем диск/флешку/карту.

Выясняем путь устройства:

sudo fdisk -l

:/>  Как узнать частоту обновления (герцовку) монитора - ПК Консультант

В ответе будет что-то вроде:

По объему и разделам можно сориентироваться, какое из устройств то самое, которое требуется проверить. В примере флешка — это Диск /dev/sdb: 14,4 GiB. У неё есть разделы /dev/sdb1 и /dev/sdb2. Если проверить надо полностью все разделы, то указываем /dev/sdb:

Найденные ошибки запишутся в текстовый файл.