Situation: One day my SSD hard failed and deleted many files randomly, consisting some files of the OS. Damage was big enough that made the OS unable to boot and even unable to chrooted.
Fortunately I had another Ubuntu on another disc and I was able to recover chroot
and then boot and network functionality of damaged OS. Then I booted the damaged OS and ran a script that reinstalled every package installed on it (with apt-get install <package> --reinstall
) it wasn't as easy as I'm describing it, there were lots of packages that needed specific attention.
After that almost everything's fine except running 32bit binaries like wine and adb. I need an expert in this field to tell me what should I do to recover executing 32bit binaries.
For example suppose that I wanna run wine:
First lets run it on fish
:
# wine
Failed to execute process '/usr/bin/wine'. Reason:
The file '/usr/bin/wine' does not exist or could not be executed.
Now lets run it on bash
:
# wine
bash: /usr/bin/wine: No such file or directory
Lets enter the full location:
# whereis wine
wine: /usr/bin/wine /usr/bin/X11/wine /usr/share/wine /usr/share/man/man1/wine.1.gz
# /usr/bin/wine
bash: /usr/bin/wine: No such file or directory
Lets see if the file really exists:
# ls -l /usr/bin/wine
-rwxr-xr-x 1 root root 9748 Dec 18 05:11 /usr/bin/wine
What ldd
and file
say:
# ldd /usr/bin/wine
not a dynamic executable
# file /usr/bin/wine
/usr/bin/wine: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xe4e2fb58bdbbbc2dedf7483825900ed35a6dc989, stripped
How to solve this?
Damaged OS is Ubuntu 13.10 amd64.
The
ldd
results are expected, since the "binary" is just an script:So, what's the solution? Remove them completely and install them. We don't really know how much damage is there so removing and reinstalling is the most safest:
The same with any package that doesn't work. You can verify the package that correspond to the binary using
dpkg -S
:Run
or
At least this should make
ldd
behave well. I don't know if this will solve the other problems, it might. If not then I would just look at theldd
output, and install/reinstall the packages which contains those libraries.You could use Rescatux for repairing your broken machine. You can make it to bootable usb using Unetbootin. Hope this could solve your issue.