Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to repair a 'secondary Gentoo system'
Date: Mon, 11 Dec 2017 20:06:33
Message-Id: e75df4eb-8068-37fe-a255-07e938000f80@gmail.com
In Reply to: Re: [gentoo-user] How to repair a 'secondary Gentoo system' by Helmut Jarausch
1 Helmut Jarausch wrote:
2 > On 12/11/2017 05:58:42 PM, David Haller wrote:
3 >> Hello,
4 >>
5 >> On Mon, 11 Dec 2017, Helmut Jarausch wrote:
6 >> >But now, don't ask me why,
7 >> >chroot  /OtherGentoo   /bin/bash
8 >> >dies of a segment fault.
9 >> >
10 >> >Is there any means to repair such a Gentoo system short of
11 >> rebuilding it
12 >> >(nearly) from scratch?
13 >>
14 >> How about a bit of debugging first?
15 >>
16 >> # catchsegv chroot  /OtherGentoo   /bin/bash
17 >> # cd /OtherGentoo/ && chroot  /OtherGentoo/ /bin/bash
18 >>
19 >> (ISTR, there was/is a reason for first cd-ing into the chroot and then
20 >> chrooting with the full-path...)
21 >>
22 >> Have you (bind) mounted /sys, /dev, /proc into the chroot?
23 >>
24 >> I use this as the top and bottom of a little bit longer
25 >> chroot-wrapper-script:
26 >>
27 >> ==== /root/bin/chrooter ====
28 >> #!/bin/bash
29 >> root="$1"
30 >> shift
31 >>
32 >> test -e "${root}/proc/kcore" || mount --bind /proc/ "${root}/proc"
33 >> test -e "${root}/sys/block"  || mount --bind /sys/ "${root}/sys"
34 >> test -e "${root}/dev/root"   || mount --bind /dev/ "${root}/dev"
35 >> test -e "${root}/dev/pts/0"  || mount --bind /dev/pts/ "${root}/dev/pts"
36 >> [..]
37 >> cd "$root"
38 >> chroot "$root" /bin/bash -l
39 >> ====
40 >
41 > My procedure is quite similar, I only use
42 >
43 > mount --rbind /dev/ "${root}/dev"
44 >
45 > and
46 >
47 > mount --rbind /run  /${NROOT}/run
48 >
49 > ---
50 >
51 > I've tried
52 > catchsegv chroot  /OtherGentoo   /bin/bash
53 >
54 > as well as
55 >
56 > chroot  /OtherGentoo   catchsegv /bin/bash
57 >
58 > In both cases, I don't get any error messages BUT I don't get chrooted.
59 >
60 > Strangely enough, dmesg shows
61 >
62 > systemd-coredump[25375]: Failed to connect to coredump service: No
63 > such file or directory
64 >
65 > although I'm not using system but openrc on both system
66 >
67 > Thanks,
68 > Helmut
69
70 Just a thought.  Have you recompiled the package chroot belongs too? 
71 Maybe somehow the chroot file got corrupted or something and just fails
72 to run. 
73
74 I would also cd to your backup install and just poke around and see if
75 everything looks normal.  Like maybe /sbin is missing or something. 
76 Maybe look for some files that you know are used to chroot in, like bash
77 for example. 
78
79 Dale
80
81 :-)  :-)