Re: Recovery binary from lost+found

2023-12-31 Thread Kirill A. Korinsky


> On 31. Dec 2023, at 15:49, Otto Moerbeek  wrote:
> 
> There are toos like objdump and readelf that can tell you more, but
> just removing them is likely best. Object files can always be
> re-created on an open-source system.


I've run:

> island$ tar -ztvf base74.tgz | awk '{print $9}' | while read f; do doas test 
> -e /$f || echo "missed $f"; done
> missed ./usr/share/relink/kernel.tgz
> island$

that confirms your point that it should be just removed.

--
wbr, Kirill



Re: Recovery binary from lost+found

2023-12-31 Thread Otto Moerbeek
On Sun, Dec 31, 2023 at 03:01:10PM +0100, Kirill A. Korinsky wrote:

> 
> > On 31. Dec 2023, at 11:02, Otto Moerbeek  wrote:
> > 
> > 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.
> 
> 
> sounds like just remove it and forgot, isn't it?
> 
> > 
> > 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.
> 
> 
> As was said before this is binary files:
> 
> island# file *
> #1866245: ELF 64-bit LSB shared object, x86-64, version 1
> #2021828: ELF 64-bit LSB shared object, x86-64, version 1
> island#
> 
> and it has quite different size:
> 
> island# ls -la
> total 7912
> -r--r--r--   1 root  bin3680832 Dec 31 00:30 #1866245
> -r--r--r--   1 root  bin 317600 Dec 31 00:30 #2021828
> drw--T   2 root  wheel  512 Dec 31 01:10 .
> drwxr-xr-x  16 root  wheel  512 Dec 31 01:27 ..
> island#
> 
> an attempt to run it leads to crash, yes I've tried move to bin.
> 
> --
> wbr, Kirill
> 

There are toos like objdump and readelf that can tell you more, but
just removing them is likely best. Object files can always be
re-created on an open-source system.

-Otto



Re: Recovery binary from lost+found

2023-12-31 Thread Kirill A. Korinsky


> On 31. Dec 2023, at 11:02, Otto Moerbeek  wrote:
> 
> 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.


sounds like just remove it and forgot, isn't it?

> 
> 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.


As was said before this is binary files:

island# file *
#1866245: ELF 64-bit LSB shared object, x86-64, version 1
#2021828: ELF 64-bit LSB shared object, x86-64, version 1
island#

and it has quite different size:

island# ls -la
total 7912
-r--r--r--   1 root  bin3680832 Dec 31 00:30 #1866245
-r--r--r--   1 root  bin 317600 Dec 31 00:30 #2021828
drw--T   2 root  wheel  512 Dec 31 01:10 .
drwxr-xr-x  16 root  wheel  512 Dec 31 01:27 ..
island#

an attempt to run it leads to crash, yes I've tried move to bin.

--
wbr, Kirill



Re: Recovery binary from lost+found

2023-12-31 Thread Otto Moerbeek
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



Recovery binary from lost+found

2023-12-30 Thread Kirill A. Korinsky
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