| 357 | === Unassigned sectors === |
| 358 | |
| 359 | This section was written by Kay Diederichs. Even though this section assumes Linux and the ext2/ext3 file system, the strategy should be more generally applicable. |
| 360 | |
| 361 | I read your badblocks-howto at and greatly benefited from it. One thing that's (maybe) missing is that often the `smartctl -t long` scan finds a bad sector which is not assigned to any file. In that case it does not help to run `debugfs`, or rather `debugfs` reports the fact that no file owns that sector. Furthermore, it is somewhat laborious to come up with the correct numbers for `debugfs`, and `debugfs` is slow ... |
| 362 | |
| 363 | So what I suggest in the case of presence of `Current_Pending_Sector/Offline_Uncorrectable` errors is to create a huge file on that file system. |
| 364 | |
| 365 | {{{ |
| 366 | dd if=/dev/zero of=/some/mount/point bs=4k |
| 367 | }}} |
| 368 | |
| 369 | creates the file. Leave it running until the partition/file system is full. This will make the disk reallocate those sectors which do not belong to a file. Check the `smartctl -a` output after that and make sure that the sectors are reallocated. If any remain, use the debugfs method. Of course the usual caveats apply - back it up first, and so on. |
| 370 | |