Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to boot because of libreadline.so.8
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Fri May 24, 2024 2:36 pm    Post subject: Unable to boot because of libreadline.so.8 Reply with quote

We recently had a long power outage and one of our servers is not rebooting. I first was suspecting a bad drive due to Read-only file system messages, but paging up in the output I think I see the real issue.

Code:
Run /sbin/init as init process
INIT: version 3.09 booting
/bin/sh: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory

From here mkdir calls are failing with Read-only file system

I did a fsck on these partitions and no corruptions were found.

Can anyone help?

Thanks!
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1621
Location: South America

PostPosted: Fri May 24, 2024 2:58 pm    Post subject: Re: Unable to boot because of libreadline.so.8 Reply with quote

hanj wrote:
Code:
/bin/sh: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory

Well, that's pretty descriptive, is libreadline (still) there?

Code:
$ ls -F /{,usr/}lib*/libreadline*

_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22382

PostPosted: Fri May 24, 2024 3:04 pm    Post subject: Reply with quote

Also, does this system use a separate /usr, and if so, is that /usr mounted soon enough?
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Fri May 24, 2024 3:25 pm    Post subject: Re: Unable to boot because of libreadline.so.8 Reply with quote

GDH-gentoo wrote:
hanj wrote:
Code:
/bin/sh: error while loading shared libraries: libreadline.so.8: cannot open shared object file: No such file or directory

Well, that's pretty descriptive, is libreadline (still) there?

Code:
$ ls -F /{,usr/}lib*/libreadline*


I'm in via LiveCD.

Code:
/usr/lib/libreadline.so
/usr/lib/libreadline.so.8
/usr/lib/libreadline.so.8.1


Thanks
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Fri May 24, 2024 3:26 pm    Post subject: Reply with quote

Hu wrote:
Also, does this system use a separate /usr, and if so, is that /usr mounted soon enough?


I do have a separate partition for /usr. Unsure about the mounting time. Is there a way to determine that?

Thanks
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Fri May 24, 2024 3:33 pm    Post subject: Reply with quote

Hu wrote:
Also, does this system use a separate /usr, and if so, is that /usr mounted soon enough?


I think you might be onto something. I see sda3 mounting which is /root, and the failure happens right after. So sda6 /usr doesn't seem to be mounted.

Thanks
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22382

PostPosted: Fri May 24, 2024 3:34 pm    Post subject: Reply with quote

If you mount /usr via initramfs, that should be fine. If you don't, that likely explains your problem. It looks like older libreadline was installed in /lib, and so could work without the initramfs mount.
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Fri May 24, 2024 3:36 pm    Post subject: Reply with quote

Hu wrote:
If you mount /usr via initramfs, that should be fine. If you don't, that likely explains your problem. It looks like older libreadline was installed in /lib, and so could work without the initramfs mount.


I don't think I use initramfs.. this is an ancient kernel too. Sorry for my ignorance on this, but how can I see if I'm using initramfs? Also, would copying those libs to /libs work to get things booting again?

Thanks!
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Fri May 24, 2024 3:50 pm    Post subject: Reply with quote

Hu wrote:
If you mount /usr via initramfs, that should be fine. If you don't, that likely explains your problem. It looks like older libreadline was installed in /lib, and so could work without the initramfs mount.


Okay, it's definitely related to that. I just did a test by copying libreadline* to /lib and now it's failing on libmount. Any ideas to properly handle this?

Thanks!
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22382

PostPosted: Fri May 24, 2024 3:58 pm    Post subject: Reply with quote

I think the proper solution is to read and implement the changes from 2024-01-05: Separate /usr now requires an initramfs. As an emergency measure, you could keep copying files from /usr/lib into /lib, and make plans to undo all that later. If you have the free space for it, you could make a directory /usr/lib on / and mirror /usr/lib into it.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1621
Location: South America

PostPosted: Fri May 24, 2024 4:44 pm    Post subject: Reply with quote

hanj wrote:
Sorry for my ignorance on this, but how can I see if I'm using initramfs?

Check your bootloader configuration. /boot/grub/grub.cfg if you are using GRUB, for example.

Hu wrote:
I think the proper solution is to read and implement the changes from 2024-01-05: Separate /usr now requires an initramfs.

Indeed, it is. Separate /usr and no initramfs has been unsupported by Gentoo since 2013 or something. But until recently, Gentoo also took measures to not actively break this setup either for the cases where it could still work (for example, by having ebuilds install selected libraries in /lib instead of /usr/lib)

What changed is that Gentoo has decided to not care anymore, so the news item was reissued, as an "OK, users, last chance" sort of warning.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4843
Location: Bavaria

PostPosted: Fri May 24, 2024 6:26 pm    Post subject: Reply with quote

hanj,

you have only two choice:

1. /usr must be a directory in the root directory / root partition, and not an external mounted partition - as @Hu already said, or
2. You use an initramfs (*) which mounts your external /usr before starting the system. Here you have more choices:
2a. Use dracut and let it create this initramfs, or
2b. Do it yourself with this wiki article: https://wiki.gentoo.org/wiki/Early_Userspace_Mounting


*) What is an initramfs ? ->
https://wiki.gentoo.org/wiki/PC_Boot_Process
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Initramfs_Overview
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Thu Aug 08, 2024 2:25 pm    Post subject: Reply with quote

I have initramfs set up with dracut. Things are happy now. How often do I need to create new initramfs images? If I do updates to libreadline for example, will I need to make a new image? If there are libs that need to be updated in that initramfs - is there a process or notification that will let me know that my image is outdated? Is it best to cron this and create new images nightly, etc?

Thanks!
hanji
_________________
Server Admin Blog - Uno-Code.com
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 133

PostPosted: Fri Aug 09, 2024 4:30 pm    Post subject: Reply with quote

hanj wrote:
I have initramfs set up with dracut. Things are happy now. How often do I need to create new initramfs images? If I do updates to libreadline for example, will I need to make a new image? If there are libs that need to be updated in that initramfs - is there a process or notification that will let me know that my image is outdated? Is it best to cron this and create new images nightly, etc?


You don't need to update the initramfs for new readline versions, since it can still boot just fine using the old version and then switch over to the real rootfs at which point applications will use the updated readline.

You only need to recreate the initramfs when there are changes which are needed for the initramfs to set up the initial environment and mount filesystems etc.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum