Please help a stupid guy to chroot 06 October 2017, 00:24:32 Hi, please explain to explain like if it were a 5 year old boymy arch root partition is sda2my boot is sda1and my home is sda7i did this:mkdir /mnt/archmount /dev/sda2 /mnt/archmount /dev/sda1 /mnt/arch/bootmount /dev/sda7 /mnt/arch/homecd /mnt/archif i doarch-chroot /mnt/arch /usr/bin/bashor arch-chroot /mnt/arch /bin/bashit say :mount : /mnt/arch/proc proc already mounted in /proc failed to setup chroot /mnt/archif i do:mkdir /mnt/archmount /dev/sda2 /mnt/archmount /dev/sda1 /mnt/arch/bootmount /dev/sda7 /mnt/arch/homecd /mnt/archmount -t proc proc proc/mount --rbind /sys sys/mount --rbind /dev dev/mount --rbinf /run run/cp /etc/resolv.conf etc/resolv.confchroot /mnt/arch /bin/bashit say:chroot failed to run command bin/bash no such file or directorywhat im doing wrong? Last Edit: 06 October 2017, 00:34:15 by adcdam
Re: Please help a stupid guy to chroot Reply #1 – 06 October 2017, 04:27:33 mount /dev/sda2 /mnt/mount /dev/sda1 /mnt/bootmount /dev/sda7 /mnt/home
Re: Please help a stupid guy to chroot Reply #2 – 06 October 2017, 07:15:29 And use the 'artools-chroot' command if you're using the Artix ISO
Re: Please help a stupid guy to chroot Reply #3 – 07 October 2017, 10:07:36 This reminds me of something funny, last week I was trying to chroot to my broken artix from other installations and it wasn't functional.Someone mentioned artix-chroot, so I booted the iso. It wasn't installed so I tried to install it. Nothing.Finally, I think it was @mandog, pointed me to the arch-wiki for proper chroot procedure. After I did everything and worked great, I saw a mention of "artools-chroot" which I assume incorporates the wiki procedure. When I get some time I will investigate on the differences between arch-chroot and artools-chroot.
Re: Please help a stupid guy to chroot Reply #4 – 07 October 2017, 10:53:15 Quote from: fungalnet – on 07 October 2017, 10:07:36It wasn't installed so I tried to install it. Nothing.artools-chroot is provided by artools-base : Code: [Select]~ >>> pacman -Ql artools-base | grep binartools-base /usr/bin/artools-base /usr/bin/artools-chrootartools-base /usr/bin/basestrapartools-base /usr/bin/chroot-runartools-base /usr/bin/fstabgenartools-base /usr/bin/mkchrootartools-base /usr/bin/signfile
Re: Please help a stupid guy to chroot Reply #5 – 07 October 2017, 11:29:25 I know but artix-chroot doesn't exist yet Not in the fashion of manjaro-chroot or arch-chroot
Re: Please help a stupid guy to chroot Reply #6 – 07 October 2017, 11:47:40 @fungalnet, below the chroot procedure for both standard and encrypted partition. I prefer the standard chroot approach (usable for ALL the platforms) than the personalized version, that I can never fully control #-------------------------------## Standard chroot ##-------------------------------#This command manually Identify and Prepare the Installed Partition(s)1. Open your terminal and start a root session: su2. List all your partitions: lsblk -f3. Mount your system partition. The syntax to mount the system partition is: mount /dev/[partition_to_mount] /mntExample: if the system partition is /dev/sda3, this will be mounted using the following command: mount /dev/sda3 /mnt if a separate partition /dev/sda1 has been used for the GRUB, mount it with the following command: mount /dev/sda1 /mnt/boot4. Change to the root directory of your mounted partitions: cd /mntTo complete the operation, and to mount completely the file system, it will be necessary to enter a series of commands in the following order:mount -t proc proc /mnt/procmount -t sysfs sys /mnt/sysmount -o bind /dev /mnt/devmount -o bind /run /mnt/runmount -t devpts pts /mnt/dev/pts/cp /etc/resolv.conf /mnt/etc/resolv.confchroot /mntDONE and now you are positioned on the chroot-ed file system, where all your command will act.#---------------------------------## LUKS Partition chroot ##---------------------------------#1) Boot with a liveUSB2) Open a Terminal session3) Identify the hd partition: lsblkIn this example I suppose that:/dev/sda1 is the /boot partition/dev/sda2 is the LUKS encrypted partitionNOTE: replace sda1 or sda2 with the partition name that you get with the lsblk command$ su$ cryptsetup open --type luks /dev/sda2 root # where sda2 is the encrypted device$ mount /dev/mapper/root /mnt$ mount /dev/sda1 /mnt/boot # mount here the boot partition$ mount -t proc proc /mnt/proc$ mount -t sysfs sys /mnt/sys$ mount -o bind /dev /mnt/dev$ mount -o bind /run /mnt/run$ mount -t devpts pts /mnt/dev/pts$ cp /etc/resolv.conf /mnt/etc/resolv.conf$ chroot /mntDONE also for an encrypted partition.I hope this can help you. Last Edit: 07 October 2017, 11:52:16 by francesco
Re: Please help a stupid guy to chroot Reply #7 – 08 October 2017, 03:52:46 Thanks a lot!!!! im able to boot now
Re: Please help a stupid guy to chroot Reply #8 – 08 October 2017, 16:30:09 Quote from: adcdam – on 08 October 2017, 03:52:46Thanks a lot!!!! im able to boot now A pleasure if the info help you
Re: Please help a stupid guy to chroot Reply #9 – 16 March 2023, 11:29:44 Have not found found anything more current on the subject of artix-chroot, so will ask here...Are the instructions in the above post still valid, as of March 2023?Are the below instructions from Arch wiki required in their exact content when using artix-chroot?QuoteIf you are running a UEFI system, you will also need access to EFI variables. Otherwise, when installing GRUB, you will receive a message similar to: UEFI variables not supported on this machine:# mount --rbind /sys/firmware/efi/efivars sys/firmware/efi/efivars/Next, in order to use an internet connection in the chroot environment, copy over the DNS details:# cp /etc/resolv.conf etc/resolv.confFinally, to change root into /path/to/new/root using a bash shell:# chroot /path/to/new/root /bin/bash
Re: Please help a stupid guy to chroot Reply #10 – 16 March 2023, 12:53:21 All the necessary bind-mounts are taken care by artix-chroot, including efivars. 1 Likes