Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dual Boot lost. Grub2 Error: fail connect lvmetad.socket
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
magifu
n00b
n00b


Joined: 16 Jul 2018
Posts: 6

PostPosted: Thu Jul 19, 2018 8:06 pm    Post subject: Dual Boot lost. Grub2 Error: fail connect lvmetad.socket Reply with quote

Hello Gentoo-people and good day to you all. I'm very new to Gentoo...in fact, if we discount the several days of installation of the OS and the programs I wanted....i've only been using it a couple days! haha

Well, here's my issue:

I installed 2 linux distros on my computer (dual boot via Grub2) and Gentoo was without sound.


I fixed the sound by reconfiguring the kernel a little, saved it (make it and make install) and tried to update my grub to recognize it ...which I *thought* I needed to do...but now I doubt that. Regardless, I did the entire grub-mkconfig -o /boot/grub/grub.cfg and my bootloader was borked in that it no longer sees slackware.

I tried running the same grub command from slack to see if it picked it up, but it didnt.
I also tried updating grub and os-prober but they had no updates as well as just running the same grub-mkconfig commmand again and hoping for a different result.
I also searched for the same identical problem but the ones i came across either had different messages, different setups and the like...at any rate, nothing that I could confidently apply to my situation.


I don't really know/understand what exactly is going on, but I "assume" it has to do with the 8mb bios boot (/sda1) and the 512mb /boot (/sda7)

To be honest, i was rather out of sorts as to why I needed it to begin with (seeing this is a bios/gpt not uefi system).

Nevertheless, I am looking to get this reconfigured properly to see both systems or else I might be interested in switching bootloaders all together.

Any help you can provide is sincerely appreciated.

error provided when running grub-mkconfig
Code:

grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.14.52-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
Found linux image: /boot/vmlinuz-4.14.52-gentoo.old
Found initrd image: /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
done


My laptop
Code:

Laptop, Inspiron 1420 X86_64
Gentoo and Slackware
Gentoo linux 4.14.52-gentoo
intel Core 2 Duo
2G ram


my set up:

Code:
 fdisk -l /dev/sda
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Device         Start       End  Sectors  Size Type
/dev/sda1       2048     18431    16384    8M BIOS boot
/dev/sda2      18432  41961471 41943040   20G Linux filesyst
/dev/sda3   41961472  50350079  8388608    4G Linux swap
/dev/sda4   50350080 117458943 67108864   32G Linux filesyst
/dev/sda5  117458944 159401983 41943040   20G Linux root (x8
/dev/sda6  159401984 167790591  8388608    4G Linux swap
/dev/sda7  167790592 168839167  1048576  512M EFI System
/dev/sda8  168839168 234441614 65602447 31.3G Linux home


Code:
gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 234441648 sectors, 111.8 GiB
Sector size (logical/physical): 512/512 bytes
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048           18431   8.0 MiB     EF02  grub
   2           18432        41961471   20.0 GiB    8300  slackroot
   3        41961472        50350079   4.0 GiB     8200  slackswap
   4        50350080       117458943   32.0 GiB    8300  slackhome
   5       117458944       159401983   20.0 GiB    8304  genroot
   6       159401984       167790591   4.0 GiB     8200  genswap
   7       167790592       168839167   512.0 MiB   EF00  boot
   8       168839168       234441614   31.3 GiB    8302  genhome


Code:
 lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk
├─sda1   8:1    0     8M  0 part
├─sda2   8:2    0    20G  0 part
├─sda3   8:3    0     4G  0 part
├─sda4   8:4    0    32G  0 part
├─sda5   8:5    0    20G  0 part /
├─sda6   8:6    0     4G  0 part [SWAP]
├─sda7   8:7    0   512M  0 part /boot
└─sda8   8:8    0  31.3G  0 part /home
sr0     11:0    1  1024M  0 rom
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 121

PostPosted: Thu Jul 19, 2018 8:46 pm    Post subject: Reply with quote

If you are not using lvmetad (a metadata caching daemon for LVM) you can safely disable it in
Code:
/etc/lvm/lvm.conf
by setting
Code:
use_lvmetad=0

EDIT:
After that you should regenrate initramfs.

As for slackware (BTW I used to use it before gentoo) are the linux image and initramfs(initrd) files in /boot folder? Seems from the output of
Code:
grub-mkconfig -o
that they are missing. Please give us an output of
Code:
ls /boot


You could also install sys-boot/os-prober to help grub2 in finding installed distros.
Back to top
View user's profile Send private message
magifu
n00b
n00b


Joined: 16 Jul 2018
Posts: 6

PostPosted: Fri Jul 20, 2018 12:15 am    Post subject: Reply with quote

Thank you for your kind and speedy reply!

yes, gentoo has os-prober installed. maybe slack doesn't, im not sure. but yes, i'll go try that too!

I did indeed edit
Code:
 /etc/lvm/lvm.conf

disabling
Code:

use_lvmetad=0

It did get rid of the error when i ran
Code:

grub-mkconfig -o /boot/grub/grub.cfg


Sadly, it didn't show the slack distro in grub.

I booted into slack via usb and here's it's /boot

Code:

README.initrd
System.map
System.map-generic-4.4.14
System.map-huge-4.4.14
boot_message.txt
coffee.dat
config
config-generic-4.4.14
config-huge-4.4.14
elilo-ia32.efi
elilo-x86_64.efi
grub
inside.bmp
inside.dat
onlyblue.bmp
onlyblue.dat
slack.bmp
tuxlogo.bmp
tuxlogo.dat
vmlinuz
vmlinuz-generic
vmlinuz-generic-4.4.14
vmlinuz-huge
vmlinuz-huge-4.4.14


And here is Gentoos
Code:

ls /boot
config-4.14.52-gentoo      initramfs-genkernel-x86_64-4.14.52-gentoo  System.map-4.14.52-gentoo.old
config-4.14.52-gentoo.old  lost+found                                 vmlinuz-4.14.52-gentoo
grub                       System.map-4.14.52-gentoo                  vmlinuz-4.14.52-gentoo.old


Not sure if this would be relevant but here's my /mounts as well:

slackware

Code:

mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda4 on /home type ext4 (rw)
gvfsd-fuse on /home/user/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user= user


here's the gentoo mount

Code:

mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=317792,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb5 on / type ext4 (rw,noatime,data=ordered)
tmpfs on /run type tmpfs (rw,nodev,relatime,size=254796k,mode=755)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
cgroup_root on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755)
openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib64/rc/sh/cgroup-release-agent.sh,name=openrc)
none on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
/dev/sdb7 on /boot type ext2 (rw,noatime,errors=continue)
/dev/sdb8 on /home type ext4 (rw,relatime,data=ordered)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
none on /run/user/1000 type tmpfs (rw,relatime,mode=700,uid=1000)
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 121

PostPosted: Fri Jul 20, 2018 10:14 am    Post subject: Reply with quote

Gentoo "os-prober" should find slackware installation but its script have to be enabled in "/etc/grub.d/" by "chmod +x". Please see https://wiki.gentoo.org/wiki/GRUB2#Enabling_or_disabling_configuration_scripts

Please, give us an output of
Code:
ls -l /etc/grub.d/
on gentoo install.

Besides that, you can create custom rule for slackware installation and place the file in "/etc/grub.d/"

I should look something like this:
Code:
#!/bin/sh -e
echo "Adding Slackware Linux to GRUB 2"
cat << EOF
menuentry "Slackware" {
set root=(hd0,2)
linux /boot/vmlinuz root=/dev/sda2 ro quiet nosplash
}
EOF


It should have executable permissions also for being activated.
Remeber to run grub-mkconfig.
Back to top
View user's profile Send private message
magifu
n00b
n00b


Joined: 16 Jul 2018
Posts: 6

PostPosted: Fri Jul 20, 2018 2:36 pm    Post subject: Reply with quote

Hey, thanks again.

Ok, here it is:
Code:

ls -l /etc/grub.d/
total 60
-rwxr-xr-x 1 root root  8684 Jul 19 13:09 00_header
-rwxr-xr-x 1 root root 10007 Jul 19 13:09 10_linux
-rw-r--r-- 1 root root 10455 Jul 19 13:09 20_linux_xen
-rw-r--r-- 1 root root 11301 Jul 19 13:09 30_os-prober
-rw-r--r-- 1 root root   214 Jul 19 13:09 40_custom
-rw-r--r-- 1 root root   216 Jul 19 13:09 41_custom
-rw-r--r-- 1 root root   483 Jul 19 13:09 README


next I did as the link you provided requested:
Code:

root #chmod -x /etc/grub.d/{20_linux_xen,30_os-prober,40_custom,41_custom}


I also did try enabling it
Code:

ls -l /etc/grub.d/total 60
-rwxr-xr-x 1 root root  8684 Jul 19 13:09 00_header
-rwxr-xr-x 1 root root 10007 Jul 19 13:09 10_linux
-rwxr-xr-x 1 root root 10455 Jul 19 13:09 20_linux_xen
-rwxr-xr-x 1 root root 11301 Jul 19 13:09 30_os-prober
-rwxr-xr-x 1 root root   214 Jul 19 13:09 40_custom
-rwxr-xr-x 1 root root   216 Jul 19 13:09 41_custom
-rw-r--r-- 1 root root   483 Jul 19 13:09 README


So what else I did was to ensure that os-prober was indeed on slack (and it was), so I did a reinstall and grub-mkconfig there...and slack DID see Gentoo...,,but when i rebooted, it only showed slack in grub. So gentoo was gone and I needed to get a usb with the gentoo installation and chroot into that to reinstall grub from gentoo. But alas, still nothing in grub.

Now, when I get a few minutes or whatever is needed, i'll try to modify that rule for the slackware installation and see how that goes!

Thank you for all of your assistance! :)
Back to top
View user's profile Send private message
magifu
n00b
n00b


Joined: 16 Jul 2018
Posts: 6

PostPosted: Fri Jul 20, 2018 3:34 pm    Post subject: Reply with quote

UPDATE:
Although the grub-mkconfig didn't output anything (ie slackware found)...i did the obligatory reboot anyhow after posting the reply below...and there is a slackroot entry within grub!!

Thank you very much PrSo for your kind and patient help!!!
:)


=================================
unnecessary former reply
===========================
I did indeed try adding the script you provided to 40_custom and reenabling chmod+x on all of grub.d, but I only got syntax errors else nothing new reported following the grub-mkconfig or os-prober.

That script seemed catered to my system ive only got the one drive and slack's root is indeed on /dev/sda2....so yeah, I don't know where to go following that.
---=======================================
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 121

PostPosted: Fri Jul 20, 2018 3:55 pm    Post subject: Reply with quote

If you don't mind to make little mess you could make /boot partition shared between gentoo and slackware by cp -a everything from slackware /boot dir to /dev/sda7, edit slackware's fstab to add /dev/sda7 to be mounted as /boot and try under gentoo "grub-mkconfig -o" with os-prober. (delete the custom rule).

EDIT:
--------
Good to know it is working, and leaving above for consideration.
--------
Back to top
View user's profile Send private message
magifu
n00b
n00b


Joined: 16 Jul 2018
Posts: 6

PostPosted: Fri Jul 20, 2018 6:02 pm    Post subject: Reply with quote

Thank you again!

You know, i was musing that very thing...but wasn't sure if i'd end up borking something.

So basically mount /dev/sda7 somewhere in slack (like /mnt or /media), then cp /boot -a to that mount point (im assuming just any arbitrary location at first).
Then after it's been copied, umount /dev/sda7 and remount it like mount /boot /dev/sda7
then change slacks fstab to reconsider the new mount point for boot.
then leave grub alone in slack.
jump over to gentoo and delete the custom rule
then likely disable the chmod +x to the grub.d (?)
then run grub-mkconfig -o /boot/grub/grub.cfg again and voila?

If im wrong in any of these notions, I'd be more than welcome to your advice! haha thanks again.! :)

kind of a n00b question but, will my copying /boot to /dev/sda7 not share the /boot folder so that both systems kernels etc reside there, both entirely accessible from either distro? Are there any precautions I need to take for that? This is why I didn't give it a shot earlier.

Thank you again for all of your time!

ADDITION: I also notice that in the /etc/grub.d/40_custom I commented out the line (that warns that you don't) "exec tail -n +3 $0"
And yet that was how it booted into slack....if I accomplish the boot configuration that you are suggesting above, then it's a moot point, but I still wonder if I was in error to comment that out and what the possible problem would be in doing so.
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 121

PostPosted: Fri Jul 20, 2018 8:04 pm    Post subject: Reply with quote

You can do this under gentoo also, but I think that two (suppose different versions) of grub would collide with each other. You really need only one bootloader to rule them all.

To omit folders during copying files, command should look like this:
Code:
 cp /boot/* /mountpoint_of_/dev/sda7/
You can remove unnecessarily files like elilo-ia32.efi elilo-x86_64.efi from slackware grub/elilo installation(or remove grub/elilo from slackware) also, or, alternatively remove gentoo grub2 package by emerge -C sys-boot/grub. It depends from you.(then cp -a /boot/* /mountpoint_of_dev/sda7 -this copy folders also).

Later edit slackware fstab to add /boot mount point ie:
Code:
/dev/sda7   /boot           vfat            defaults,noatime        0 0

"chmod -x" the custom rule you have created, and run "grub-mkconfig -o..." with os-prober enabled.

The above should be modified depending from the choice you have made (gentoo grub vs slackware grub)

The only culprit could be the size of slackware image files contrary to the size of /dev/sda7...., I think.

After that you could check /boot/grub/grub.cfg if slackware/gentoo command line and paths are correct.(set root and etc.)

For me grub was to tricky.
Now I use efibootmgr to manage efivarfs directly.(as mentioned in first post alternative)

As for commenting out the custom rule script command here is a good explanation
what it does: https://unix.stackexchange.com/questions/420205/what-logic-does-the-command-exec-tail-n-3-0-from-grub2-config-have
Back to top
View user's profile Send private message
magifu
n00b
n00b


Joined: 16 Jul 2018
Posts: 6

PostPosted: Sat Jul 21, 2018 2:17 am    Post subject: Reply with quote

Thank you again my friend.

I will look into both the dual systems sharing /dev/sda7 as well as the possibility of the alternate bootloader over the next few days.
I've not used grub in sometime as my main machine is uefi ....i guess i've forgotten how complex grub can be.

I would mark it as solved, but I understand that this is not really "a thing" in the Gentoo forums, so I'll just update later if i succeed or not.

Thank you again for all of your help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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