On Sun, Dec 31, 2023 at 01:59:28AM +0100, Kirill A. Korinsky wrote: > Greetings, > > How can I recovery binary files from lost+found? > > I have: > island$ doas ls -l /usr/lost+found > total 7904 > -r--r--r-- 1 root bin 3680832 Dec 31 00:30 #1866245 > -r--r--r-- 1 root bin 317600 Dec 31 00:30 #2021828 > island$ > > -- > wbr, Kirill >
Amongst other things, fsck_ffs(8) looks for inodes not mentioned in any directory, i.e. files that are orphans. fsck_ffs links those files into the lost+found dir, using the inode number for a name. Try to figure the contents of the file, using e.g. file(1) or hexdump(1). On success, just move the files to the right place with the right name. Often you'll find that those files are not longer useful, in that case just remove them from lost+found. -Otto