It's not a normal situation, but as per the tags, you are already aware that it's data corruption. With a corrupt filesystem, any further modification can lead to further unexpected results (even more corruption). The safest is to remount the filesystem read-only, backup/save everything on a different media, (encrypted if necessary), and only do attempt further modifications when the filesystem has been umounted, and an appropriate fsck
has already processed the fs.
The rest of the similar questions seem to discuss weird filenames or weird filesystems - yours seem to be actually corrupt as the question mark in most of the fields show.
Update: I repeat, the issue does not seem to be a duplicate question regarding unusual/hard to see file names, but genuine filesystem corruption. Your hostname was suggesting that it's not an everyday system, so there might be some factors that can increase the chances of a corruption:
- less reliably storage and/or connections (USB cables, USB dongle storage, SD cards, SD card converters)
- system shut down at least once a day
- not fully mature filesystems (which is mature enough is roughly a personal preference though)
- journaling enabled file systems (it can hide corruption by masking the need for an fsck on an unorderly reboot)
- encrypted storage/volume managers - generally they are stable enough, but they still add one layer of software to occasionally cause problems)
As it has been suggested, it's really a good idea to consider the above factors where the corruption may have been introduced to reduce the chances of it reoccurring. It's quite weird that a clean, 24-character ASCII printable corruption got in the directory entries, that's not really a typical corruption for otherwise stable systems.
In my experience, a corruption is either a single flipped bits in a few hundred megabytes of written data, or an occasional block of data (512b/4k, or even larger in the case of LVM/RAID) completely replaced by either garbage, or unrelated data bytes. If you notice anything that can explain the issue, feel free to let us know so that there's a record to help others.
But, back to your question - if it's your main/only filesystem on your main drive, then the forcefsck feature is your best bet.
See here - Force fsck safe?
You will need to reboot the system for this to work (and possibly even after the fsck has completed). You can also try to run the fsck yourself from a Live CD installation, which would allow you to see the results more easily.
rm -i -- *
will go through each file in turn and offer to delete. Or you may need tols -lab
and possibly useunlink
. – pbhj Feb 21 '18 at 21:27mkdir -p foobar
and then delete it. – Foad Sep 04 '18 at 22:47