V
V
Vitaly Pukhov2015-10-21 04:19:36
Iron
Vitaly Pukhov, 2015-10-21 04:19:36

Is there a file system that works with bad disks?

I formulated the question a little clumsily, the essence is as follows, let's say there is a certain HDD that has endured a lot in its life and it has a lot of clearly bad and slow sectors, controllers can remove bad sectors from service, but they do this only when they are forced to and a "list" of such bad sectors they usually have limited. So far, I found the only working solution in self-made software, which clogs the entire disk with identical files, then compares them all with the original, leaves all those who were considered bad, deletes the rest, as a result, all bad sectors will be "inside" files that will forever lie on the disk. This approach has a lot of disadvantages, for example, you can forget about defragmentation, it will be impossible to do it, etc.
The question is, is there a file system that supports such lists or puts some marks on itself, saying that it’s better not to write here?
ps about throwing out I will answer right away - the desire to throw out immediately disappears when I see the price tags but new screws, and 2TB is not small.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim Moseychuk, 2015-10-21
@Neuroware

controllers are able to remove bad sectors from service, but they do this only when they are forced to
These are all fairy tales that tell about programs that re-allocate bad blocks. In fact, if you look into the AHCI specification, you won't find anything like that. There are no such commands in the protocol. The controller should take care of this. If bad blocks appear on the disk (not just an entry in SMART, but unreadable areas), then this only means that the spare area is over and there is nowhere to re-allocate sectors.
The most common reason for the appearance of broken sectors is mechanical damage to the ferromagnetic coating on pancakes. Flakes of matter fly off the pancake and turn into dust. Then dust particles get between the head and the disk, thereby contributing to further degradation of the surface. This process is avalanche.
But if you are not embarrassed by the imminent death of the disk and data loss, then yes, there are such file systems. For example ext4. mkfs.ext4 has the -l option, after which you can specify the file generated by the badblocks program. Also, mkfs.ext4 can check the disk itself before creating the file system. Bad sectors will be ignored.
If there are many bad sectors at the beginning of the partition, then the file system cannot be created, because. The file system driver expects the superblock to be located at a strictly defined location on the disk. In this case, it makes sense to try to move the beginning of the section to another location, trimming the section on the left.
UPD: In order to prolong the life of such a disk, you can identify bad areas. Frame them with several gigabytes (with a large disk volume, due to the recording density, it is better to have several tens) on each side. Merge nearby areas. The resulting ranges do not mark up at all. The result should be something like 200 gigabytes at first not used, and then a partition. This will minimize the number of head movements over the faulty area, which will slow down the degradation.
But this method is not suitable if bad sectors are distributed throughout the disk.

S
sbh, 2015-10-21
@sbh

Although you have already written an answer about throwing it out, I still can’t help but write IMHO.
This approach to problem solving is a crooked crutch.
You can draw an analogy with a car. When 2 and 4 gears do not work for you, but in principle you can ride.
With this approach, you will lose files as well. And suddenly.
Save some money and buy a new drive. Sectors die for a reason, and over time, your entire disk will die.

P
Puma Thailand, 2015-10-21
@opium

2TB bush in good condition costs 2-3 thousand rubles

M
Mikhail Zhilin, 2015-10-30
@Merdue

Victoria or MHDD, but if there are a lot of bad sectors or blocks, then carefully back up all the data that will be available, this can be a long process and the disk will continue to pour entropy! It can only be thrown away!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question