public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Haller <gentoo@dhaller.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] How to repair a 'secondary Gentoo system'
Date: Mon, 11 Dec 2017 17:58:42 +0100	[thread overview]
Message-ID: <20171211165842.dovnjea2yza27log@grusum.endjinn.de> (raw)
In-Reply-To: <IPO57E5D.DPGFOKUV.QX4KF6NM@BOQMTVBL.P757M3U6.IANNQ7AA>

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
====

HTH,
-dnh

-- 
cat /kat/ n.  A furry keyboard cover


  reply	other threads:[~2017-12-11 16:59 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 [this message]
2017-12-11 19:12   ` Helmut Jarausch
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=20171211165842.dovnjea2yza27log@grusum.endjinn.de \
    --to=gentoo@dhaller.de \
    --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