Sample Header Ad - 728x90

/bin, /sbin symlinks mysteriously breaking, init file disappearing. How to debug?

0 votes
3 answers
303 views
Similar to here , but no solution was found for them either. I also tried checking the history, see if something was running 'rm' but no dice. Periodically, my device stops responding. The *only* commands I can use are builtin shell commands such as cd, echo, pwd. Any other command such as ls (bin) or fsck (sbin)... all show -bash: /usr/bin/ls: no such file or directory, yet the files still exist. If I cd into /usr/bin and run echo *, I see a list of all the commands that supposedly cannot be found. ls, sudo, ect... , but I cannot execute them. Attempting to manually execute /usr/bin/ls results in the same error. I checked my path variable... it seemed fine echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin The only files I noticed missing were usr/bin/init and usr/sbin/init (thus prompting the boot to initramfs on restart). Additionally, under root / the /bin and /sbin folders were *gone*, possibly the symlinks were missing? On a working install, there is a symlink between /bin -> /usr/bin When this occurs, since I have no permissions, and nothing else works, I am forced to restart by powering off/on the machine, followed by it booting to initramfs. I know a temporary fix to the the issue... From an USB with a fresh install of my distribution, I copy over /bin, /sbin, /lib to my boot partition under /root. But this doesn't solve it permanently, and the issue comes back after a while. I would really appreciate any help, I'm honestly completely lost as to what to do now. I have tried... *1. fsck the partitions.* Both my boot partition (mmcblk0p1) & root partition (mmcblk0p2) seem fine. Dirty bit was set on boot partition 0p1, likely due to hard poweroff. 2nd pass determined no issues. *2. badblocks* found 0 bad blocks in its read test *3. Memtest the device* I haven't been able to memtest it yet, as I cannot figure out how to get my device to boot to it. I flashed memtest to an SD card, as well as a usb. My device won't boot from either. I don't have a bios, it's running u-boot. Supposedly, I can interrupt the u-boot process to select where to boot, but pressing keys does nothing during boot. Someone here suggests it may be that there isn't USB support for the keyboard in u-boot, only once it boots to linux... making it impossible to boot from another drive? The device is an Orange Pi 5B, with Ubuntu 22.04 flashed to the EMMC drive built onto the device. *4. Test the PSU* I am running with this 5v 4a PSU, people Here seem to have similar issues. How can I test if my PSU is the issue, or if nothing else, can someone suggest one that wont have problems, so I can rule the PSU issue out?
Asked by MadAtTheKeyboard (1 rep)
Nov 4, 2024, 09:37 AM
Last activity: Aug 5, 2025, 05:30 AM