public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Helmut Jarausch <jarausch@skynet.be>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] How to repair a 'secondary Gentoo system'
Date: Mon, 11 Dec 2017 20:12:49 +0100	[thread overview]
Message-ID: <DBYDB4DM.H33UZDZF.NOJ2JSBF@4LJ2255N.JE52AS6M.VAVRWHVD> (raw)
In-Reply-To: <20171211165842.dovnjea2yza27log@grusum.endjinn.de> (from gentoo@dhaller.de on Mon Dec 11 17:58:42 2017)

On 12/11/2017 05:58:42 PM, David Haller wrote:
> Hello,
> 
> On Mon, 11 Dec 2017, Helmut Jarausch wrote:
> >But now, don't ask me why,
> >chroot  /OtherGentoo   /bin/bash
> >dies of a segment fault.
> >
> >Is there any means to repair such a Gentoo system short of  
> rebuilding it
> >(nearly) from scratch?
> 
> How about a bit of debugging first?
> 
> # catchsegv chroot  /OtherGentoo   /bin/bash
> # cd /OtherGentoo/ && chroot  /OtherGentoo/ /bin/bash
> 
> (ISTR, there was/is a reason for first cd-ing into the chroot and then
> chrooting with the full-path...)
> 
> Have you (bind) mounted /sys, /dev, /proc into the chroot?
> 
> I use this as the top and bottom of a little bit longer
> chroot-wrapper-script:
> 
> ==== /root/bin/chrooter ====
> #!/bin/bash
> root="$1"
> shift
> 
> test -e "${root}/proc/kcore" || mount --bind /proc/ "${root}/proc"
> test -e "${root}/sys/block"  || mount --bind /sys/ "${root}/sys"
> test -e "${root}/dev/root"   || mount --bind /dev/ "${root}/dev"
> test -e "${root}/dev/pts/0"  || mount --bind /dev/pts/  
> "${root}/dev/pts"
> [..]
> cd "$root"
> chroot "$root" /bin/bash -l
> ====

My procedure is quite similar, I only use

mount --rbind /dev/ "${root}/dev"

and

mount --rbind /run  /${NROOT}/run

---

I've tried
catchsegv chroot  /OtherGentoo   /bin/bash

as well as

chroot  /OtherGentoo   catchsegv /bin/bash

In both cases, I don't get any error messages BUT I don't get chrooted.

Strangely enough, dmesg shows

systemd-coredump[25375]: Failed to connect to coredump service: No such  
file or directory

although I'm not using system but openrc on both system

Thanks,
Helmut





  reply	other threads:[~2017-12-11 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 16:23 [gentoo-user] How to repair a 'secondary Gentoo system' Helmut Jarausch
2017-12-11 16:58 ` David Haller
2017-12-11 19:12   ` Helmut Jarausch [this message]
2017-12-11 19:45     ` David Haller
2017-12-11 20:56       ` Rich Freeman
2017-12-11 20:06     ` Dale
2017-12-12  1:45     ` [gentoo-user] " Kai Krakow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DBYDB4DM.H33UZDZF.NOJ2JSBF@4LJ2255N.JE52AS6M.VAVRWHVD \
    --to=jarausch@skynet.be \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox