I've been dualbooting Artix runit with Windows 7 without any problem for several months now. But today, when restart from Windows, Artix displayed this error
/dev/sda3: recovering journal
/dev/sda3: clean, 194917/11231232 files, 3226083 blocks
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.
sh: can't access tty: job control turned off
I did some research myself but most source are from Arch/systemd so I don't think they are useful in my case.
My
ls -l sbin/init
returned
lrwxrwxrwx 1 0 0 7 Jan 1 1970 sbin/init -> busybox
Some changes to the system that I made that could lead to the error:
+ I installed .NET framework 4 in my Windows
+ I removed some unused dependencies that did not appeared in pacman -Qdtq
+ Some Arch users got root root instead of the double 0s when run ls -l sbin/init so I think that could be the problem
I appreciate all help and support.
Thank you!
I'm fairly certain sbin/init should symlink to runit-init on Artix runit systems. I have no idea why it is symlinked to busybox for you, but that would explain you being unable to boot the system.
That should have no effect on your GNU/Linux partitions.
This could be the culprit. In my experience, not every package reported as "unused" is disposable.
Is there any way to return my system to its normal state?
How can I reinstall culprit? pacman did not work.
Thank you for your responses, I did not expect it to be this quick!
Assuming you use grub as your bootloader, you can hit e during bootup and temporarily alter your kernel parameters (https://wiki.archlinux.org/index.php/Kernel_parameter#GRUB). You can add init=/usr/bin/runit-init which should then allow you to boot up. Of course, that assumes you still have runit-init on your system and it didn't mysteriously get removed with whatever happened. If that does not work, you would need to chroot into your root partition. In any either case, you should probably reinstall your init (runit and runit-rc) and double check to make sure that your init symlink is correct.
If the other (rather good) ideas don't resolve it, my further suggestion is that /var/log/pacman.log should hold a record of what you did if you needed to check, and possibly the removed packages are still in /var/cache/pacman/pkg/ and if they are, pacman -U will easily reinstall them after chrooting in. Otherwise they can be found in the repos online. No need for a network connection on the problem machine either, you can get the package(s) and put them on a usb with another computer, then use pacman -U again.
When cd /usr/bin I couldn't find runit-init but run-init so I tried both but it didn't work. I also looked into https://rlbcontractor.com/fixing-a-broken-linux-system-with-chroot (https://rlbcontractor.com/fixing-a-broken-linux-system-with-chroot) but I'm too afraid to try as I am rather inexperienced.
Could you give me a detailed guide on how to chroot?
Checked pacman.log and I didn't remove culprit but some packages belong in base-devel and /var only contain a /run file. However, /new_root (which I didn't create) contain all files you described, can this information be helpful?
I dualboot so I can use Windows when Artix is broken
Dude
https://www.merriam-webster.com/dictionary/culprit
Number 3. /facepalm
Damnit. Well at least now you know I'm not a native English speaker.
That guide is what you need to do (with regards to the arch section of it). The only difference is that with an artix live iso/usb you would use artools-chroot instead of arch-chroot.
I've successfully mount my partition but artools-chroot returned command not found so I used chroot instead. I know it is the right partition because it have my user file. But when I attempted to pacman -U my deleted packages, it returned
error: could not open file: /etc/mtab: No such file or directory
error: could not determine filesystem mount points
error: not enough free disk space
error: failed to commit transaction (unexpected error)
And I was unable to restore them. I'm so close to fixing it, how do I continue from here?
It seems quite odd artools-chroot wasn't found. Were you using an artix live iso? Well it doesn't matter in either case you can always do the chroot manually. It consists of many steps if you want a working system. Follow the Arch guide (https://wiki.archlinux.org/index.php/Chroot#Using_chroot) here.
It's odd to me too, first is busybox and now this, do you have the same problem with your system? Yes I was in the live inviroment
Thanks for the link, I will look into it
I've been able to chroot my system using artix-chroot (I found it while looking through lib64) and I executed
pacman -Syu
pacman -S base-devel runit runit-rc
mkinitcpio -P
all without issue. However, that didn't solve the problem, when I look into /sbin and /bin, init was nowhere to be found. Is it possible to generate or recover it?
/sbin and /bin are only symlinks to /usr/bin...
Interesting, but I also checked /usr/bin and I couldn't find init there either, this might be the last problem I have to deal with.
How should I fix it?
by installing your init again? pacman -S runit.. ..?
Well, theeast seems to say this:
Which is only possible if they didn't chroot.
The whole point is to first chroot into the hard disk partition which should be mounted to /, then reinstall. Otherwise the reinstall only happens in the live filesystem setup in RAM and goes away upon restart.
@OP: In order to have a working temporary system chrooted to your hard disk, you first need to redirect Linux pseudo file systems through
mount, then chroot.
But I did, first
sudo -i
mount /dev/sda3 /mnt
then
artix-chroot /mnt
I saw that artix: [root]:~# become sh-5.1#
Also, when I pacman -Syu the second time right after rebooting, all repositories except community are up to date, so I definitely made changes to the system. runit and runit-rc were both up to date when I reinstalled them so I'm really stuck here
Any error messages? Have you tried to do ls -l /sbin/init inside the chrooted environment?
pacman -S runit runit-rc now return
....
:: Running post-transaction hooks...
(1/3) Applying kernel sysctl settings...
Skipped: Current root is not booted.
(2/3) Creating temporary files...
Failed to open file "/sys/devices/system/cpu/microcode/reload": Read-only file system
error: command failed to execute correctly
(3/3) Displaying runit service help ...
==> Add a service:
ln -s /etc/runit/sv/<service> /run/runit/service/
==> Start/stop/restart a service:
sv <start/stop/restart> <service>
and ls -l /sbin/init returned
ls: cannot access '/sbin/init': No such file or directory
All of these commands are done in the chroot system
put here your /etc/fstab
ls -l /etc/fstab returned
-rw-r--r-- 1 root root 415 Feb 23 03:44 /etc/fstab
Well, that is different from:
which looks like a result of playing around with busybox in place of runit/OpenRC/s6.
alium meant the result of
cat /etc/fstab inside the chrooted environment.
/usr/bin/init was owned by artix-sysvcompat but that got replaced by system/base sometime around October 2019. Reinstalling "base" might help with that.
Yes, I installed base and it said
....
(1/1) Detecting init ...
==> Found runit-init
and after rebooting, Artix worked normally again
I'd like to thank everyone for your advice and guidance and for sticking around.
This is one hell of a learning experience!