hammer2: ls reports "No such file or directory"
Matthew Dillon
dillon at backplane.com
Mon Oct 12 11:19:15 PDT 2020
Generally speaking this error occurs if a directory entry is present but
the related inode cannot be found. You can use a hammer2 directive to
destroy the directory entry to clean it up. But before you do so you want
to check the media for CHECK FAIL errors.
The easiest way to do this is to just read off the entire directory
structure with tar, e.g. 'tar cf /dev/null filesystem' and then check the
dmesg output for errors. 'dmesg | fgrep CHECK'. Something like that.
If the filesystem appears clean other than the disconnected directory
entry, then you can use 'hammer2 destroy filename' to destroy the directory
entry. Be very careful when doing that.
If the filesystem has other problems, such as CRC errors, other CHECK
errors, etc.... then it is best to make a full backup and reformat.
Also make sure that bulkfree runs don't have errors. 'hammer2 bulkfree
...' and then check dmesg output as well.
--
In terms of how a disconnected inode can happen. It has become more rare
but it might still be possible if a power failure or panic occurs during
heavy filesystem activity. It shouldn't be possible for CRC errors to
occur unless the media itself corrupted the data.
-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20201012/813c87da/attachment-0002.htm>
More information about the Users
mailing list