You are not logged in.

#1 2021-09-24 05:18:43

gardenair
Member
Registered: 2021-08-17
Posts: 25

[SOLVED]Why use "arch-chroot" in installation.

hi,
          Installing Arch Linux was really fun & I really enjoyed it a lot. Reading the manual and then implement it was great. Well one thing that is confusing me is that at the start of  Arch Linux installation the prompt was

[root@archiso ~] # 

during installation we switch the regular prompt by using  "arch-chroot"

[root@archiso ~] # arch-chroot /mnt

now prompt is

[root@archiso /]#

The thing which I want to clear is that why we use "arch-chroot"  for the further installation process? Do we want to isolate the installation process? Is it just like chroot "jail"  What is the logic behind it in Arch Linux installation?

Thanks in advance.

Last edited by gardenair (2021-09-25 13:43:19)

Offline

#2 2021-09-24 05:44:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,301
Website

Re: [SOLVED]Why use "arch-chroot" in installation.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#3 2021-09-24 08:39:39

dogknowsnx
Member
Registered: 2021-04-12
Posts: 58

Re: [SOLVED]Why use "arch-chroot" in installation.

Short answer: During installation you're (still) booted into the archiso (installation medium).

Last edited by dogknowsnx (2021-09-24 08:46:00)

Offline

#4 2021-09-24 09:49:11

gardenair
Member
Registered: 2021-08-17
Posts: 25

Re: [SOLVED]Why use "arch-chroot" in installation.

very simple but powerful answer .Yes first  we use Arch iso prompt then eventually we switch into  "arch-chroot". s the Arch wiki tell that

 "The bash script arch-chroot is part of the arch-install-scripts package. Before it runs /usr/bin/chroot, the script mounts API filesystems like /proc and makes /etc/resolv.conf available from the chroot. "

Can someone elaborate it in more more simple way ?

Last edited by gardenair (2021-09-24 09:49:35)

Offline

#5 2021-09-24 10:26:52

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,061
Website

Re: [SOLVED]Why use "arch-chroot" in installation.

You need to chroot into the new install to do things like install a bootloader.  That can not be done without a chroot first.

Offline

#6 2021-09-24 10:37:39

Awebb
Member
Registered: 2010-05-06
Posts: 5,869

Re: [SOLVED]Why use "arch-chroot" in installation.

Try doing what you'd do within the chroot without it and observe the results. Take a special look at symlinks, locale-gen and other things that assume your / to be the one of your future system and not that of the installer.

Online

#7 2021-09-25 12:43:32

gardenair
Member
Registered: 2021-08-17
Posts: 25

Re: [SOLVED]Why use "arch-chroot" in installation.

Well, I try to install Arch Linux and this time I do not switch into

arch-chroot @ /mnt.

I continue my installation using the archiso prompt i.e

root@archiso ~ #

It gave me an error when I write the command for grub installation.

root@archiso ~ #grub-install /dev/sda
installing for i386-pc platform.
grub-install:error:failed to get canonical path of 'airootfs'

It stopped at grub due to the non-availability of the correct installation path for /dev/sda. It was all due to not switching into

# arch-chroot /mnt

which was just an experiment that why Arch Linux  use "arch-chroot.
Yes, it is a bash script that works in the background & loads stuff for the users to help the installation process.
https://ibb.co/JR33wYh

Offline

#8 2021-09-25 12:50:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,759
Website

Re: [SOLVED]Why use "arch-chroot" in installation.

The grub installation may have been the first step that produced an error message, but several other steps failed to do what was intended, and even if grub installed correctly, the newly installed system would not likely boot and would be broken from the start.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB