public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Michael <confabulate@kintzios.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] chroot: on update I got "mount: /proc: mount failed: Unknown error 5005.,Unable to mark /proc slave: 32"
Date: Wed, 17 Jul 2024 20:50:17 +0100	[thread overview]
Message-ID: <4923378.GXAFRqVoOG@rogueboard> (raw)
In-Reply-To: <edaca869-df88-4ebd-b163-b7f7d9735404@ya.ru>

[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]

Hi Vitaly,

On Wednesday, 17 July 2024 18:08:08 BST Vitaly Zdanevich wrote:
> Hi, I did a chroot according to
> https://wiki.gentoo.org/index.php?title=Chroot
> 
> My script in the chroot folder:
> 
> ```
> mount --rbind /dev dev
> mount --make-rslave dev
> mount -t proc /proc proc
> mount --rbind /sys sys
> mount --make-rslave sys
> mount --rbind /tmp tmp
> mount --bind /run run
> 
> mount -o bind /var/db/repos/ var/db/repos/
> 
> chroot . /bin/bash
> 
> ```
[snip ...]

The wiki and the Handbook, explain you need to have a mountpoint for the file 
system in which you are trying to chroot.

For example, the wiki page states:

mkdir /mnt/mychroot  <== this is the mountpoint
cd /mnt/mychroot

or if you are trying to chroot on an existing installation on some block 
device, e.g. say it is partition /dev/sdb3, you would run:

mkdir /mnt/mychroot
mount /dev/sdb3 /mnt/mychroot

Consequently, the mount commands after you mount the OS partition and before 
you chroot become:

cd /mnt/mychroot
mount --rbind /dev /mnt/mychroot/dev
mount --make-rslave /mnt/mychroot/dev
mount -t proc /proc /mnt/mychroot/proc
mount --rbind /sys /mnt/mychroot/sys
mount --make-rslave /mnt/mychroot/sys
mount --rbind /tmp /mnt/mychroot/tmp
rmount --bind /run /mnt/mychroot/run

After the above you can chroot into the mounted filesystem:

chroot /mnt/mychroot /bin/bash


The same approach is followed in the Handbook for a new installation:

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/
Base#Mounting_the_necessary_filesystems

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-07-17 19:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 17:08 [gentoo-user] chroot: on update I got "mount: /proc: mount failed: Unknown error 5005.,Unable to mark /proc slave: 32" Vitaly Zdanevich
2024-07-17 19:50 ` Michael [this message]
2024-07-18  4:11 ` Waldo Lemmer

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=4923378.GXAFRqVoOG@rogueboard \
    --to=confabulate@kintzios.com \
    --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