A tool for remapping bad sectors in CURRENT?

Dag-Erling Smørgrav des at des.no
Sat Mar 13 21:24:51 UTC 2010

Miroslav Lachman <000.fbsd at quip.cz> writes:
> So... can somebody with enough knowledge write some docs / script how
> to find the affected file based on LBA read error from messages /
> SMART log?

ZFS will tell you straight away, but I guess if you used ZFS, you
wouldn't be asking :)

For FFS, you can unmount the file system (boot from a CD or memory stick
or whatever if that file system is / or /usr), run fsdb on the failing
disk, use findblk to look up the inode number for the file that contains
the bad sector.  Note that you have to convert the LBA to an offset
relative to the start of the partition.

Unfortunately, you can't easily go from inode to file name; you have to
mount the file system and use something like find -inum.

Dag-Erling Smørgrav - des at des.no

More information about the freebsd-current mailing list